Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not find androidsdk.modules

So in the middle of running my program, my build.gradle failed with this error. I mean it actually worked a second before, and not a second after. I changed nothing in my gradle.

Could not find androidsdk.modules:shield:unspecified.
Required by:
    project :app > com.facebook.android:facebook-login:5.15.2
    project :app > com.facebook.android:facebook-core:5.15.2
    project :app > com.facebook.android:facebook-common:5.15.2
Search in build.gradle files

Here is my gradle.

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-android'

android {
    compileSdkVersion 28
    buildToolsVersion "29.0.2"
    defaultConfig {
        multiDexEnabled true
        applicationId "com.example.casualdatingapp"
        minSdkVersion 26
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    lintOptions {
        disable "ResourceType"
    }
    compileOptions {
        sourceCompatibility = JavaVersion.VERSION_1_8
        targetCompatibility = JavaVersion.VERSION_1_8
    }
}

dependencies {


    implementation 'com.google.firebase:firebase-functions:19.0.1'
    implementation "com.android.support:support-compat:28.0.0"
    implementation 'com.google.firebase:firebase-messaging:20.1.0'
    implementation 'net.yslibrary.keyboardvisibilityevent:keyboardvisibilityevent:2.3.0'
    implementation 'com.github.jakob-grabner:Circle-Progress-View:1.4'
    implementation 'com.github.smarteist:autoimageslider:1.3.2'

    implementation "com.android.support:support-v4:+"
    implementation 'com.nineoldandroids:library:2.4.0'
    implementation 'com.daimajia.slider:library:1.1.5@aar'
    implementation "com.yuyakaido.android:card-stack-view:2.3.4"
    implementation 'org.mongodb:stitch-android-sdk:4.1.0'
    implementation 'com.mindorks:placeholderview:0.7.1'
    implementation 'com.github.bumptech.glide:glide:3.7.0'
    implementation 'com.google.code.gson:gson:2.7'
    api 'com.theartofdev.edmodo:android-image-cropper:2.8.+'
    implementation 'com.android.support:cardview-v7:28.0.0'
    implementation 'com.google.android.gms:play-services-location:17.0.0'
    implementation 'com.facebook.android:facebook-login:[5,6)'
    implementation 'com.soundcloud.android:android-crop:1.0.1@aar'
    implementation 'com.mikhaellopez:circularimageview:3.2.0'
    api 'com.google.android.material:material:1.2.0-alpha01'
    implementation 'com.edmodo:rangebar:1.0.0'
    implementation 'pub.devrel:easypermissions:3.0.0'
//    implementation 'com.squareup.picasso:picasso:2.3.2'
    implementation 'com.squareup.picasso:picasso:2.71828'
    implementation 'com.android.support:multidex:1.0.3'
    implementation 'com.google.firebase:firebase-analytics:17.2.0'
    implementation 'com.google.firebase:firebase-storage:19.1.0'
    implementation 'com.google.firebase:firebase-auth:19.2.0'
    implementation 'com.google.firebase:firebase-firestore:21.3.1'
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.0.2'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0'
    implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.1.0'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test.ext:junit:1.1.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    def nav_version = "2.1.0"

    // Java language implementation
    implementation "androidx.navigation:navigation-fragment:$nav_version"
    implementation "androidx.navigation:navigation-ui:$nav_version"

    // Kotlin
    implementation "androidx.navigation:navigation-fragment-ktx:$nav_version"
    implementation "androidx.navigation:navigation-ui-ktx:$nav_version"

}
repositories {
    mavenCentral()
    maven { url "https://jitpack.io" }
}

apply plugin: 'com.google.gms.google-services'
apply plugin: 'kotlin-android-extensions'

I don't know how or why this happened. Reverting to a previous git repo that worked didn't change anything... What could possibly be the issue?

like image 452
Andrew Young Avatar asked Feb 04 '20 00:02

Andrew Young


4 Answers

This fixed it for me. Only started happening today.

implementation 'com.facebook.android:facebook-android-sdk:5.15.3'
like image 166
Rob Trautvetter Avatar answered Nov 19 '22 05:11

Rob Trautvetter


I'm getting the same error when I try to build a project in Unity.

For Unity solved replacing the implementations to:

implementation 'com.facebook.android:facebook-applinks:[5,5.11.1)' 
implementation 'com.facebook.android:facebook-core:[5,5.11.1)' 
implementation 'com.facebook.android:facebook-login:[5,5.11.1)' 
implementation 'com.facebook.android:facebook-share:[5,5.11.1)'

in the Gradle template.

like image 20
Mario Avatar answered Oct 04 '22 03:10

Mario


We can config 3 thing about the facebook SDK to a react native Android app:

  1. Version lib in package.json.
  2. Dependency on android/app/build.gradle
  3. Facebook sdk version on android/build.gradle.

This errors is probably a bug: https://github.com/facebook/react-native-fbsdk/issues/701

For me work this config:

  1. "react-native-fbsdk": "1.1.2", in package.json
  2. implementation 'com.facebook.android:facebook-android-sdk:[5,5.11.1)' on android/app/build.gradle.
  3. facebookSdkVersion = '5.15.3' in android/build.gradle
like image 3
Lucas Garcez Avatar answered Nov 19 '22 04:11

Lucas Garcez


I should have mentioned that this solution works for React Native. Rob's solution is best for native Android.


I just now had the same problem and here's what worked for me. Add facebookSdkVersion = "5.15.3" to

android
|--build.gradle
buildscript {
    ext {
        buildToolsVersion = "28.0.3"
        minSdkVersion = 18
        compileSdkVersion = 28
        targetSdkVersion = 28
        ...

        // This is a temporary fix for react-native-fbsdk v1.1.2
        facebookSdkVersion = "5.15.3"
    }
}

References:

  • https://github.com/facebook/facebook-android-sdk/issues/673
  • https://github.com/facebook/react-native-fbsdk/issues/701
like image 3
Tom Daniel Avatar answered Nov 19 '22 04:11

Tom Daniel