本文介绍了react-native-fbsdk错误:找不到与给定名称匹配的资源:attr'android:keyboardNavigationCluster'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在我具有 android/app/build.gradle 的react-native项目中
In my react-native project in android/app/build.gradle i have
...
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;
}
}
...
但我总是得到
<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
推荐答案
转到 React-Native Project :android/build.gradle
文件并将fbsdk
版本限制为 4.28.0 .
Go to React-Native Project : android/build.gradle
file and restrict fbsdk
Version to 4.28.0.
allprojects {
repositories {
...
configurations.all {
resolutionStrategy {
force 'com.facebook.android:facebook-android-sdk:4.28.0'
}
}
}
}
如果您再次遇到如下错误:
If you have another error like below:
您可以尝试:
allprojects {
repositories {
...
configurations.all {
resolutionStrategy {
force 'com.facebook.android:facebook-android-sdk:4.22.1'
}
}
}
}
来源: rafaesc
这篇关于react-native-fbsdk错误:找不到与给定名称匹配的资源:attr'android:keyboardNavigationCluster'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!