Facebook Sdk Android Error Building

facebook-android sdk github
react native facebook login
facebook integration in android androidhive
error resource android:style widget material button. colored not found
facebook sdk integration android
android:textappearance material widget button borderless colored react-native
login error facebook android
com.facebook.android:facebook-android-sdk maven

I am trying to build my react-native project and using react-native fbsdk.

However, I get these errors:

/home/luiz/MYP/app/node_modules/react-native-fbsdk/android/build/intermediates/res/merged/release/values-v24/values-v24.xml:3: AAPT: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Borderless.Colored'.

/home/luiz/MYP/app/node_modules/react-native-fbsdk/android/build/intermediates/res/merged/release/values-v24/values-v24.xml:4: AAPT: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Colored'.

/home/luiz/MYP/app/node_modules/react-native-fbsdk/android/build/intermediates/res/merged/release/values-v24/values-v24.xml:3: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Borderless.Colored'.

/home/luiz/MYP/app/node_modules/react-native-fbsdk/android/build/intermediates/res/merged/release/values-v24/values-v24.xml:4: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Colored'.


:react-native-fbsdk:processReleaseResources FAILED

My current OS is Linux Elementary 0.4.1 Loki x64.

I am using react-native@0.37.0 and, because of this, react-native-fbsdk@0.4.0.

I've already tried:

  • cd android && ./gradlew clean

  • delete the project and re npm install it

  • and try in Android API's 23 and 24.

After digging into gradle, I came up with following solution.

Key is to exclude facebook-android-sdk required by react-native-fbsdk and pull in desired (working) version on facebook-android-sdk module - preferably without modifying anything in node_modules folder.

Fortunately, gradle offers this.

// android/app/build.gradle

dependencies {
    compile(project(':react-native-fbsdk')){
      exclude(group: 'com.facebook.android', module: 'facebook-android-sdk')
    }
    compile "com.facebook.android:facebook-android-sdk:4.22.1"
}

Android build failed: Unable to find facebook-core:5.11.1 · Issue , 374: [Unity] ERROR: FAILURE: Build failed with an exception. implementation '​com.facebook.android:facebook-android-sdk:5.11.0' compile('com.facebook.android:facebook-android-sdk:4.22.1') I'm no gradle guy so if someone knows of a better way of forcing the version from parent gradle.build, please comment and I'll update the answer.

Apparently facebook has updated their sdk yesterday and the latest (4.23.0) sdk may have a bug or something.

You can resolve this by Changing your node_modules\react-native-fbsdk\android\build.gradle from:

compile('com.facebook.android:facebook-android-sdk:4.+')

To:

compile('com.facebook.android:facebook-android-sdk:4.22.1')

I'm no gradle guy so if someone knows of a better way of forcing the version from parent gradle.build, please comment and I'll update the answer.

** EDIT **

@Andreyco managed to solve this without changing node_modules. You can scroll down to his answer or click here.

Also, as notified by @JuanJoseTugores there's a pull request in react-native-fbsdk waiting to be approved, so you can check the bug's progress and be notified when it's resolved.

** Another Update ** Facebook closed the bug that was opened for them regarding this issue, saying they fixed the sdk. So now all the workarounds can be removed.

Apparently FB still not solved this. We just upgraded to RN 0.44 & FB 0.6.0

Getting Started - Android SDK, The Facebook SDK for Android is the easiest way to integrate your Android app with Facebook. To use the Facebook SDK in a project, add the SDK as a build dependency and A non-native Login Dialog appears with an error message: ''. The Facebook SDK for Android contains six component SDKs that you can connect to individually.

I was able to resolve this without modifying files under node_modules/.... I upgraded our react-native-fbsdk version to 0.6.0 and then add this to our application's build.gradle file to pin facebook-android-sdk at version 4.22.1:

project(':react-native-fbsdk') {
    configurations.all {
        resolutionStrategy {
            force 'com.facebook.android:facebook-android-sdk:4.22.1'
        }
    }
}

configurations.all {
    resolutionStrategy {
        force 'com.facebook.android:facebook-android-sdk:4.22.1'
        ...
    }
}

Edit: We are building with:

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.3"
    ...
}

Component SDKs - Android SDK, The Facebook SDK for Android consists of six component SDKs: SDKs in your project, add one of the following implementation statements to your build script:. I'm trying to build the test app included in the facebook SDK (latest version 7.0.1), running on unity 5.1.1, but I get the following error: 'unable to merge android manifests'. My Android SDK Manager indeed shows that I have sdk up to 22 but not 23. The facebook SDK is supposedly working with API level 15 and up.

I just encountered this error. First, RN Facebook SDK v.0.6.0 only works for react-native >= 0.44.0, so you have to update your dependency in package.json to react-native: ^0.44.0. Then go to Android build.gradle file and make this changes: compileSdkVersion 25 and compile "com.android.support:appcompat-v7:25.0.0"

Android SDK, Facebook SDK for Android. Helps you build engaging social apps and get more installs. View SDKs. Version 7.0.0 nghuuhieu1994 changed the title Codeless API cause build error on Android Facebook SDK v7.16.0 Codeless API cause build error on Android Jun 7, 2019

this fixed for me

in android/build.gradle

subprojects {
    afterEvaluate {project ->
        if (project.hasProperty("android")) {
            android {
                compileSdkVersion 27
                buildToolsVersion '27.0.3'
            }
        }
    }
}

Downloads - Android SDK, Add the compile dependency with the latest version of the Facebook SDK in the build.gradle file: +' // Facebook Android SDK (everything) compile  We're aware of an issue causing Android builds to fail if they contain the Facebook SDK. You may see an error message like The team is working on a fix. I'll update this thread when we have more information.

Error building for Android with latest facebook SDK, Hi, I'm trying to build the test app included in the facebook SDK (latest version 7.0​.1), running on unity 5.1.1, but I get the following error: The official Facebook SDK for Android helps you create apps that integrate with Facebook, and provides access to several key features, including Facebook authentication, and reading and writing to the platform’s APIs.

can't build android app with facebook sdk, FB Init() work correctly in play mode, i receive logging in =true;. But. when i try to build my apk for Android i get this error: Error building Player:  Failing to build on Unity 2019.3.0f6 and crash at launching on Android. bug #388 opened Feb 9, 2020 by GunLengend 5 of 5 Failing to build in Unity 2019.3.0f6 - Conflict with Firebase SDK - Duplicate dependencies bug

Unity: Firebase and Facebook SDK error build Android APK , 2) Import Latest FirebaseAuth.unity and FacebookSDK. 3) Build Android apk and BOOM error. Been searching for duplicate *.jar but didn't found any. Configuring your app for Android. Step 1: Switch to the Android Platform. Go to the Unity Editor. From the menu, choose 'File', 'Build Settings…' In the Build Settings dialog, under 'Platform', select 'Android' as the target and click 'Switch Platform'.

Comments
  • I'm on the same problem bro, tested in MacOS Sierra with the same API's
  • Suddenly happens to me too. RN 0.41.2 & RN-FBSDK 0.5
  • I am using react-native@0.37.0 and, because of this, react-native-fbsdk@0.4.0. I'll edit the question.
  • For some reason this is not woking for me
  • Follow @atlanteh answer then. It will work for sure, until patch is published its okay to adjust node_modules imho. My answer show more general solution, applicable to similar issues
  • @RamonJamOnCanales I got same issue but solved using this inside buidl.gradle configurations.all { resolutionStrategy { force 'com.facebook.android:facebook-android-sdk:4.22.1' .... } } stackoverflow.com/a/44205756/292927
  • Thanks... That answer save my day
  • Editing anything in node_modules is greatest idea ever
  • Obviously you are right. This is only a workaround I found in order to immediately solve this problem. This is why I asked if someone with a better gradle understanding can solve it in the parent build.gradle which is not in node_modules
  • I did manage to solve this by setting compileSdkVersion to 24 in android/app/build.gradle. Btw, were you able to complite older react-native-fbsdk (e.g. 0.5.0)? It looks like no matter what, it pulls in latest Android SDK.
  • After updated compileSdkVersion in your android/app/build.gradle file, please also make sure you have the corresponding SDK installed (Android Studio > Configure > SDK Manager > API Level).
  • @Andreyco no, I'm not able to compile 0.5.0 anymore :/. you could always fork the project and apply this changes.
  • Upgrading is a working solution. However, sometimes unapplicable.
  • Only project(':react-native-fbsdk') { configurations.all { resolutionStrategy { force 'com.facebook.android:facebook-android-sdk:4.22.1' } } } needed
  • @paynd That may work for some users, however in my application it was still attempting to use the newer SDK as a dependency and as a result I needed to force it in both the react-native-fbsdk project and in my own application's configuration.