web-dev-qa-db-ja.com

react-native-fbsdkエラー:指定された名前に一致するリソースが見つかりません:attr 'Android:keyboardNavigationCluster'

Android/app/build.gradleの私のreact-nativeプロジェクトで

...
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
10

React-Native ProjectAndroid/build.gradleファイルし、fbsdkバージョンを4.28.0に制限します。

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

以下のような別のエラーがある場合:

アイテムの親の取得エラー:指定された名前「Android:TextAppearance.Material.Widget.Button.Colored」に一致するリソースが見つかりません。

あなたが試すことができます:

allprojects {
    repositories {
        ...
        configurations.all {
            resolutionStrategy {
                force 'com.facebook.Android:facebook-Android-sdk:4.22.1'
            }
        }
    }
}

ソース: rafaesc

38
Syed Zain Ali

yOUR_PROJECT/node_modules/react-native-fbsdk/Android/build.gradleにアクセスします

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.+')
}

compile( 'com.facebook.Android:facebook-Android-sdk:4+')をcompile( 'com.facebook.Android:facebook-Android-sdk:4.28.0')に変更します

それは私のために働く

7
Nam Nguyễn