react native - Error de react-native-fbsdk: no se encontró ningún recurso que coincida con el nombre dado: attr ''android: keyboardNavigationCluster''
android-gradle (2)
En mi proyecto react-native en android / app / build.gradle tengo
...
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;
}
}
...
pero siempre consigo
<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
Vaya a
React-Native Project
: archivo
android/build.gradle
y restrinja la versión
fbsdk
a
4.28.0
.
allprojects {
repositories {
...
configurations.all {
resolutionStrategy {
force ''com.facebook.android:facebook-android-sdk:4.28.0''
}
}
}
}
Si tiene otro error como el siguiente:
Error al recuperar el elemento primario para el elemento: no se encontró ningún recurso que coincida con el nombre dado ''android: TextAppearance.Material.Widget.Button.Colored'' ''.
Puedes probar:
allprojects {
repositories {
...
configurations.all {
resolutionStrategy {
force ''com.facebook.android:facebook-android-sdk:4.22.1''
}
}
}
}
Fuente: rafaesc
vas a YOUR_PROJECT / node_modules / react-native-fbsdk / android / build.gradle
buscando la línea 19:
dependencies {
compile ''com.android.support:appcompat-v7:25.0.0''
compile ''com.facebook.react:react-native:+'' // support react-native-v0.22-rc+
compile(''com.facebook.android:facebook-android-sdk:4.+'')
}
cambie la compilación (''com.facebook.android:facebook-android-sdk:4+'') para compilar (''com.facebook.android:facebook-android-sdk:4.28.0'')
Funciona para mi