Ahmed Al Sawy
Ahmed Al Sawy

Reputation: 83

Could not find com.twitter.sdk.android:twitter-core:3.0.0

I want to do Twitter login and I used this library react-native-twitter-signin and I followed the instructions related to it, but I get this problem on Android.

* What went wrong:
Execution failed for task ':app:mergeDebugAssets'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Could not find :react-native-twitter-signin:.
     Required by:
         project :app
   > Could not find com.twitter.sdk.android:twitter-core:3.0.0.
     Searched in the following locations:
       - https://repo.maven.apache.org/maven2/com/twitter/sdk/android/twitter-core/3.0.0/twitter-core-3.0.0.pom
       - file:/C:/Users/ahmed/.m2/repository/com/twitter/sdk/android/twitter-core/3.0.0/twitter-core-3.0.0.pom
       - file:/D:/3-Work/now/rubemillion/node_modules/react-native/android/com/twitter/sdk/android/twitter-core/3.0.0/twitter-core-3.0.0.pom
       - file:/D:/3-Work/now/rubemillion/node_modules/jsc-android/dist/com/twitter/sdk/android/twitter-core/3.0.0/twitter-core-3.0.0.pom
       - https://dl.google.com/dl/android/maven2/com/twitter/sdk/android/twitter-core/3.0.0/twitter-core-3.0.0.pom
       - https://www.jitpack.io/com/twitter/sdk/android/twitter-core/3.0.0/twitter-core-3.0.0.pom
     Required by:
         project :app > project :react-native-twitter-signin

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.      

I remember that I solved this problem before, where I made many modifications related to maven in the Gradle file, but I am facing this problem again and I do not know what the solution is.

Here is my gadlew file,

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext {
        buildToolsVersion = "30.0.2"
        minSdkVersion = 23 
        compileSdkVersion = 31
        targetSdkVersion = 31
        ndkVersion = "21.4.7075529"
         googlePlayServicesAuthVersion = "19.2.0" // <--- use this version or newer

    }
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath("com.android.tools.build:gradle:4.2.2")
        classpath('com.google.gms:google-services:4.3.10')
        classpath 'com.android.tools.build:gradle:4.2.1' // <--- use this version or newer
        classpath 'com.google.gms:google-services:4.3.10' // <--- use this version or newer
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        mavenCentral()
        mavenLocal()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url("$rootDir/../node_modules/react-native/android")
        }
        maven {
            // Android JSC is installed from npm
            url("$rootDir/../node_modules/jsc-android/dist")
        }

        google()
        maven { url 'https://www.jitpack.io' }
    }
}

Upvotes: 3

Views: 3414

Answers (1)

pavelety
pavelety

Reputation: 874

The com.twitter.sdk.android package has been deprecated, because it has vulnerabilities CVE-2018-1000850, CVE-2018-1000844, so you better move to some other library so you wont require this dependency.

But as a workaround for unsupported react-native-twitter-signin you should:

Add jcenter repository to android\build.gradle:

allprojects {
    repositories {
        ...
        maven { url 'https://jcenter.bintray.com' }
    }
}

Override dependency version in android\app\build.gradle

dependencies {
    ...
    implementation 'com.twitter.sdk.android:twitter-core:3.2.0'
}

This is the only public repo that still has similar version of the library.

Upvotes: 5

Related Questions