react-native fbsdk error

Created on 6 Mar 2018  Â·  9Comments  Â·  Source: facebook/react-native

FAILURE: Build failed with an exception.

  • What went wrong:
    A problem occurred configuring project ':app'.

    Could not resolve all dependencies for configuration ':app:_debugApkCopy'.
    Could not find com.android.support:appcompat-v7:27.0.2.
    Searched in the following locations:
    file:/home/progton/Android/Sdk/extras/android/m2repository/com/android/support/appcompat-v7/27.0.2/appcompat-v7-27.0.2.pom
    file:/home/progton/Android/Sdk/extras/android/m2repository/com/android/support/appcompat-v7/27.0.2/appcompat-v7-27.0.2.jar
    file:/home/progton/Desktop/Oauth/android/sdk-manager/com/android/support/appcompat-v7/27.0.2/appcompat-v7-27.0.2.jar
    Required by:
    Oauth:app:unspecified
    Oauth:app:unspecified > com.facebook.react:react-native:0.49.5
    Could not find com.android.support:appcompat-v7:27.0.2.
    Searched in the following locations:
    file:/home/progton/Android/Sdk/extras/android/m2repository/com/android/support/appcompat-v7/27.0.2/appcompat-v7-27.0.2.pom
    file:/home/progton/Android/Sdk/extras/android/m2repository/com/android/support/appcompat-v7/27.0.2/appcompat-v7-27.0.2.jar
    file:/home/progton/Desktop/Oauth/android/sdk-manager/com/android/support/appcompat-v7/27.0.2/appcompat-v7-27.0.2.jar
    Required by:
    Oauth:app:unspecified > Oauth:react-native-fbsdk:unspecified
    Oauth:app:unspecified > com.facebook.android:facebook-android-sdk:4.31.0 > com.facebook.android:facebook-common:4.31.0
    Oauth:app:unspecified > com.facebook.android:facebook-android-sdk:4.31.0 > com.facebook.android:facebook-login:4.31.0
    Could not find com.android.support:support-annotations:27.0.2.
    Searched in the following locations:
    file:/home/progton/Android/Sdk/extras/android/m2repository/com/android/support/support-annotations/27.0.2/support-annotations-27.0.2.pom
    file:/home/progton/Android/Sdk/extras/android/m2repository/com/android/support/support-annotations/27.0.2/support-annotations-27.0.2.jar
    file:/home/progton/Desktop/Oauth/android/sdk-manager/com/android/support/support-annotations/27.0.2/support-annotations-27.0.2.jar
    Required by:
    Oauth:app:unspecified > com.facebook.android:facebook-android-sdk:4.31.0 > com.facebook.android:facebook-core:4.31.0
    Could not find com.android.support:support-core-utils:27.0.2.
    Searched in the following locations:
    file:/home/progton/Android/Sdk/extras/android/m2repository/com/android/support/support-core-utils/27.0.2/support-core-utils-27.0.2.pom
    file:/home/progton/Android/Sdk/extras/android/m2repository/com/android/support/support-core-utils/27.0.2/support-core-utils-27.0.2.jar
    file:/home/progton/Desktop/Oauth/android/sdk-manager/com/android/support/support-core-utils/27.0.2/support-core-utils-27.0.2.jar
    Required by:
    Oauth:app:unspecified > com.facebook.android:facebook-android-sdk:4.31.0 > com.facebook.android:facebook-core:4.31.0
    Could not find com.android.support:support-v4:27.0.2.
    Searched in the following locations:
    file:/home/progton/Android/Sdk/extras/android/m2repository/com/android/support/support-v4/27.0.2/support-v4-27.0.2.pom
    file:/home/progton/Android/Sdk/extras/android/m2repository/com/android/support/support-v4/27.0.2/support-v4-27.0.2.jar
    file:/home/progton/Desktop/Oauth/android/sdk-manager/com/android/support/support-v4/27.0.2/support-v4-27.0.2.jar
    Required by:
    Oauth:app:unspecified > com.facebook.android:facebook-android-sdk:4.31.0 > com.facebook.android:facebook-common:4.31.0
    Could not find com.android.support:cardview-v7:27.0.2.
    Searched in the following locations:
    file:/home/progton/Android/Sdk/extras/android/m2repository/com/android/support/cardview-v7/27.0.2/cardview-v7-27.0.2.pom
    file:/home/progton/Android/Sdk/extras/android/m2repository/com/android/support/cardview-v7/27.0.2/cardview-v7-27.0.2.jar
    file:/home/progton/Desktop/Oauth/android/sdk-manager/com/android/support/cardview-v7/27.0.2/cardview-v7-27.0.2.jar
    Required by:
    Oauth:app:unspecified > com.facebook.android:facebook-android-sdk:4.31.0 > com.facebook.android:facebook-common:4.31.0
    Could not find com.android.support:customtabs:27.0.2.
    Searched in the following locations:
    file:/home/progton/Android/Sdk/extras/android/m2repository/com/android/support/customtabs/27.0.2/customtabs-27.0.2.pom
    file:/home/progton/Android/Sdk/extras/android/m2repository/com/android/support/customtabs/27.0.2/customtabs-27.0.2.jar
    file:/home/progton/Desktop/Oauth/android/sdk-manager/com/android/support/customtabs/27.0.2/customtabs-27.0.2.jar
    Required by:
    Oauth:app:unspecified > com.facebook.android:facebook-android-sdk:4.31.0 > com.facebook.android:facebook-common:4.31.0

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 29.012 secs
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/android-setup.html

Locked

Most helpful comment

In the android/app/build.grade file, I used

compileSdkVersion 23
buildToolsVersion "23.0.1"

to

compileSdkVersion 26
buildToolsVersion "26.0.2"

and in android/build.gradle file

add this code in the repository section

allprojects {
repositories {
...................
maven { url 'https://maven.google.com' }
configurations.all {
resolutionStrategy {
force 'com.facebook.android:facebook-android-sdk:4.28.0'
}
}

}
}

These changes rectified my errors.

All 9 comments

Looks like you haven't followed the getting started for fbsdk guide and installed properly the dependencies.

I have gone through each and every steps mentioned but getting same error.

Thanks and regards,
Salman khan A

On Tue, Mar 6, 2018, 18:24 Lorenzo Sciandra notifications@github.com
wrote:

Looks like you haven't followed the getting started
https://developers.facebook.com/docs/react-native/configure-android-current
for fbsdk guide and installed properly the dependencies.

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/facebook/react-native/issues/18225#issuecomment-370771984,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AUGovjmOsqSZxMgIJ_e_57mDScs7nf7Mks5tbocKgaJpZM4SekpM
.

+1 Same problem here

+1 Same problem here

+1 Same problem here

+1 Same problem here

This answer put me on track: https://stackoverflow.com/a/47786292/8577483

In the android/app/build.gradlefile, I used

compileSdkVersion 27
buildToolsVersion "27.0.2"

In the android/build.gradle file, I used

allprojects {
    repositories {
        // ...
        configurations.all {
            resolutionStrategy {
                force 'com.facebook.android:facebook-android-sdk:4.28.0'
            }
        }
    }
}

And finally I needed to downgrade the react-native-fbsdk package from version 0.7.0 to 0.6.3

In the android/app/build.grade file, I used

compileSdkVersion 23
buildToolsVersion "23.0.1"

to

compileSdkVersion 26
buildToolsVersion "26.0.2"

and in android/build.gradle file

add this code in the repository section

allprojects {
repositories {
...................
maven { url 'https://maven.google.com' }
configurations.all {
resolutionStrategy {
force 'com.facebook.android:facebook-android-sdk:4.28.0'
}
}

}
}

These changes rectified my errors.

Thank you Salman18!

I connected react-native-fbsdk v. 0.7 folowing Salman's advice.

For example:
https://github.com/javadoffuad/react-native-facebook-login

Was this page helpful?
0 / 5 - 0 ratings