YES
YES
OS: macOS Sierra 10.12.6
Node: 8.9.3
Yarn: 1.3.2
npm: 5.6.0
Watchman: 4.9.0
Xcode: 9.1 (9B55)
Android Studio: 3.0 AI-171.4443003
Packages: (wanted => installed)
"react": "^16.0.0-beta.5"
"react-native": "^0.49.5"
create-react-native-app my-test-app
cd my-test-app
npm run eject
yarn add react-native-fbsdk
The app is built and runs on android without any problem
I have this error during the build of the project:
➜ my-test-app react-native run-android
Scanning folders for symlinks in /Users/sunrising/Documents/work/sitrap/my-test-app/node_modules (7ms)
JS server already running.
Building and installing the app on the device (cd android && ./gradlew installDebug)...
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugApk'.
> A problem occurred configuring project ':react-native-fbsdk'.
> Could not resolve all dependencies for configuration ':react-native-fbsdk:_debugPublishCopy'.
> Could not find com.android.support:appcompat-v7:27.0.1.
Searched in the following locations:
file:/Users/sunrising/Library/Android/sdk/extras/android/m2repository/com/android/support/appcompat-v7/27.0.1/appcompat-v7-27.0.1.pom
file:/Users/sunrising/Library/Android/sdk/extras/android/m2repository/com/android/support/appcompat-v7/27.0.1/appcompat-v7-27.0.1.jar
file:/Users/sunrising/Documents/work/sitrap/my-test-app/android/sdk-manager/com/android/support/appcompat-v7/27.0.1/appcompat-v7-27.0.1.jar
Required by:
mytestapp:react-native-fbsdk:unspecified
> Could not find com.android.support:appcompat-v7:27.0.1.
Searched in the following locations:
file:/Users/sunrising/Library/Android/sdk/extras/android/m2repository/com/android/support/appcompat-v7/27.0.1/appcompat-v7-27.0.1.pom
file:/Users/sunrising/Library/Android/sdk/extras/android/m2repository/com/android/support/appcompat-v7/27.0.1/appcompat-v7-27.0.1.jar
file:/Users/sunrising/Documents/work/sitrap/my-test-app/android/sdk-manager/com/android/support/appcompat-v7/27.0.1/appcompat-v7-27.0.1.jar
Required by:
mytestapp:react-native-fbsdk:unspecified > com.facebook.react:react-native:0.50.3
> Could not find com.android.support:support-annotations:27.0.1.
Searched in the following locations:
file:/Users/sunrising/Library/Android/sdk/extras/android/m2repository/com/android/support/support-annotations/27.0.1/support-annotations-27.0.1.pom
file:/Users/sunrising/Library/Android/sdk/extras/android/m2repository/com/android/support/support-annotations/27.0.1/support-annotations-27.0.1.jar
file:/Users/sunrising/Documents/work/sitrap/my-test-app/android/sdk-manager/com/android/support/support-annotations/27.0.1/support-annotations-27.0.1.jar
Required by:
mytestapp:react-native-fbsdk:unspecified > com.facebook.android:facebook-android-sdk:4.29.0 > com.facebook.android:facebook-core:4.29.0
> Could not find com.android.support:support-core-utils:27.0.1.
Searched in the following locations:
file:/Users/sunrising/Library/Android/sdk/extras/android/m2repository/com/android/support/support-core-utils/27.0.1/support-core-utils-27.0.1.pom
file:/Users/sunrising/Library/Android/sdk/extras/android/m2repository/com/android/support/support-core-utils/27.0.1/support-core-utils-27.0.1.jar
file:/Users/sunrising/Documents/work/sitrap/my-test-app/android/sdk-manager/com/android/support/support-core-utils/27.0.1/support-core-utils-27.0.1.jar
Required by:
mytestapp:react-native-fbsdk:unspecified > com.facebook.android:facebook-android-sdk:4.29.0 > com.facebook.android:facebook-core:4.29.0
> Could not find com.android.support:appcompat-v7:27.0.1.
Searched in the following locations:
file:/Users/sunrising/Library/Android/sdk/extras/android/m2repository/com/android/support/appcompat-v7/27.0.1/appcompat-v7-27.0.1.pom
file:/Users/sunrising/Library/Android/sdk/extras/android/m2repository/com/android/support/appcompat-v7/27.0.1/appcompat-v7-27.0.1.jar
file:/Users/sunrising/Documents/work/sitrap/my-test-app/android/sdk-manager/com/android/support/appcompat-v7/27.0.1/appcompat-v7-27.0.1.jar
Required by:
mytestapp:react-native-fbsdk:unspecified > com.facebook.android:facebook-android-sdk:4.29.0 > com.facebook.android:facebook-common:4.29.0
> Could not find com.android.support:cardview-v7:27.0.1.
Searched in the following locations:
file:/Users/sunrising/Library/Android/sdk/extras/android/m2repository/com/android/support/cardview-v7/27.0.1/cardview-v7-27.0.1.pom
file:/Users/sunrising/Library/Android/sdk/extras/android/m2repository/com/android/support/cardview-v7/27.0.1/cardview-v7-27.0.1.jar
file:/Users/sunrising/Documents/work/sitrap/my-test-app/android/sdk-manager/com/android/support/cardview-v7/27.0.1/cardview-v7-27.0.1.jar
Required by:
mytestapp:react-native-fbsdk:unspecified > com.facebook.android:facebook-android-sdk:4.29.0 > com.facebook.android:facebook-common:4.29.0
> Could not find com.android.support:customtabs:27.0.1.
Searched in the following locations:
file:/Users/sunrising/Library/Android/sdk/extras/android/m2repository/com/android/support/customtabs/27.0.1/customtabs-27.0.1.pom
file:/Users/sunrising/Library/Android/sdk/extras/android/m2repository/com/android/support/customtabs/27.0.1/customtabs-27.0.1.jar
file:/Users/sunrising/Documents/work/sitrap/my-test-app/android/sdk-manager/com/android/support/customtabs/27.0.1/customtabs-27.0.1.jar
Required by:
mytestapp:react-native-fbsdk:unspecified > com.facebook.android:facebook-android-sdk:4.29.0 > com.facebook.android:facebook-common:4.29.0
> Could not find com.android.support:support-v4:27.0.1.
Searched in the following locations:
file:/Users/sunrising/Library/Android/sdk/extras/android/m2repository/com/android/support/support-v4/27.0.1/support-v4-27.0.1.pom
file:/Users/sunrising/Library/Android/sdk/extras/android/m2repository/com/android/support/support-v4/27.0.1/support-v4-27.0.1.jar
file:/Users/sunrising/Documents/work/sitrap/my-test-app/android/sdk-manager/com/android/support/support-v4/27.0.1/support-v4-27.0.1.jar
Required by:
mytestapp:react-native-fbsdk:unspecified > com.facebook.android:facebook-android-sdk:4.29.0 > com.facebook.android:facebook-common:4.29.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: 11.653 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
Take a look at Steps to Reproduce
I have the same issue.
now i have in my android/app/build.gradle
...
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "..."
minSdkVersion 16
targetSdkVersion 26
versionCode 1
versionName "1.0"
ndk {
abiFilters "armeabi-v7a", "x86"
}
}
...
dependencies {
compile project(':react-native-fbsdk')
compile project(':react-native-vector-icons')
compile project(':react-native-splash-screen')
compile project(':react-native-spinkit')
compile project(':react-native-orientation')
compile project(':react-native-maps')
compile project(':react-native-android-sms-listener')
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:26+"
compile "com.android.support:design:26+"
compile "com.android.support:recyclerview-v7:26+"
compile "com.android.support:cardview-v7:26+"
compile "com.facebook.react:react-native:+" // From node_modules
compile("com.crashlytics.sdk.android:crashlytics:2.8.0@aar") {
transitive = true;
}
}
but i always get
<mypath> .../node_modules/react-native-fbsdk/android/build/intermediates/res/merged/release/values-v26/values-v26.xml:15:21-54: AAPT: No resource found that matches the given name: attr 'android:keyboardNavigationCluster'.
<mypath> .../node_modules/react-native-fbsdk/android/build/intermediates/res/merged/release/values-v26/values-v26.xml:15: error: Error: No resource found that matches the given name: attr 'android:keyboardNavigationCluster'.
:react-native-fbsdk:processReleaseResources FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-fbsdk:processReleaseResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt
This might be a problem in react-native-fbsdk or your app setup. I suggest asking this on the react-native-fbsdk or stackoverflow.
android:keyboardNavigationCluster
seems like you are missing some configuration in your manifest or some strings xml.
@facebook-github-bot stack-overflow
@chirag04 it seems that react-native-fbsdk has the issue section disabled, I will try in stackoverflow anyway... have you ever seen something like this?
Hey @sun2rise, thanks for posting this! @chirag04 tells me this issue looks like a question that would be best asked on Stack Overflow. Stack Overflow is amazing for Q&A: it has a reputation system, voting, the ability to mark a question as answered. Because of the reputation system it is likely the community will see and answer your question there. This also helps us use the GitHub bug tracker for bugs only.
How to Contribute • What to Expect from Maintainers
For me this was the simplest solution.
Way better than fiddling with node_modules. But be aware of updating the SDK dependency manually from time to time.. :)
I had to define the facebook sdk version on android/build.gradle
:
allprojects {
repositories {
...
configurations.all {
resolutionStrategy {
force 'com.facebook.android:facebook-android-sdk:4.28.0'
}
}
}
}
I tried it @yannickschuchmann @crysfel
But returns to me another error:
Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Colored'
It works to me, with
configurations.all {
resolutionStrategy {
force 'com.facebook.android:facebook-android-sdk:4.22.1'
}
}
Thanks!
@rafaesc You might be using a lower compileSdkVersion and buildToolsVersion under android/app/build.gradle. I had used 23 and 23.0.1 respectively, and had the same problem as you. When I used 26 and 26.0.1, I could use the solution by @yannickschuchmann
compileSdkVersion 26
buildToolsVersion "26.0.1"
Error reappeared in [email protected]
and the resolutionStrategy with fiex facebook-sdk version doesn't help in 0.7.0
. Anyone has a solution for the new version?
@nenti, yes, I had to change to 0.6.3 version, I need a new solution for 0.7.0
@ujwal-setlur, I didn't want to change the compileSdkVersion, because I wanted to maintain the default settings of react-native, but that solution would work.
0.70.0 works for as long as I stick to older sdk libraries. When I use latest sdk library, app crashes on launching.
I try all the solution which have been provided but it didn't work.
My issue is in fbsdk build.gradles, it use com.android.support:appcompat-v7:27.0.2
but the newest version i can see in my folder C:\Users\ComputerName\AppData\Local\Android\sdk\extras\android\m2repository\com\android\support\appcompat-v7 is 26.0.0-alpha1
I try to update in Android Studio but still the same.
Adding a maven repository url to google solved this for me:
allprojects {
repositories {
mavenLocal()
jcenter()
maven {
url "https://maven.google.com"
}
configurations.all {
resolutionStrategy {
force 'com.facebook.android:facebook-android-sdk:4.28.0'
}
}
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
}
}
for react-native-fbsdk 0.7.0, as explain https://github.com/facebook/react-native/issues/17147#issuecomment-352722825 @rafaesc, you need to upgrade your settings:
compileSdkVersion 27
buildToolsVersion "27.0.1"
and there is an error in facebook docs:
use
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
instead of
implementation 'com.facebook.android:facebook-android-sdk:[4,5)'
@heralight
As you mentioned the error in facebook docs
use
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
<-- this is the same as facebook doc right?
I just tested in a new blank app with:
RN 0.54.1
react-native-fbsdk 0.7.0
My app BUILD SUCCESSFUL but app crashed.
what a idiot SDK, cant get success build
Yeah, given that this is a Facebook module meant to work with their own react-native framework, I must say this should have been much more robust
@chuckcwh there is an error in https://developers.facebook.com/docs/android/getting-started/
they write "implementation" in step 5 instead of "compile"...
Have you any log on crash, rn or android ?
@heralight
Thanks for reply.
I was following this: so I used "compile".
What I did
blank app with only
react-native 0.54.2 (I tried from 0.52, 54.0, 54.1, 54.2)
react-native-fbsdk 0.7.0
after following the tutorial the errors were
Could not find com.android.support:appcompat-v7:27.0.2.
...
then I added this to build.gradle
allprojects {
repositories {
...
maven {
url "https://maven.google.com"
}
configurations.all {
resolutionStrategy {
force 'com.facebook.android:facebook-android-sdk:4.28.0'
}
}
}
}
the error became this:
/Users/chuck/Code/fblogin/android/app/build/intermediates/res/merged/debug/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'.
...
then in app/build.gradle I changed to
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
...
targetSdkVersion 26
}
And then It works on android now :)
Guys please give it a try
@chuckcwh if you upgrade compileSdkVersion and buildToolsVersion, you don't need to
force 'com.facebook.android:facebook-android-sdk:4.28.0' ...
Just changing compileSdkVersion, buildToolsVersion and targetSdkVersion to 26, "26.0.1" and 26 respectively in app/build.gradle solved it for me. Thanks @heralight and @chuckcwh !
Just a comment. Using API 26 is breaking the Dev Menu in Android 8, because of a change in permissions with the overlay. Just blindily putting a greater compileVersion is not that good idea.
I followed all the steps by @chuckcwh but still my app is crashing in debug
So to get FB-login working in react-native you have to up target and compile sdk to 26? Which isnt supported by react native?
Or, not to risk breaking anything, I have to use a old version of fbsdk targeting sdk 23?
Most helpful comment
I had to define the facebook sdk version on
android/build.gradle
: