web-dev-qa-db-fra.com

Erreur react-native-fbsdk: Aucune ressource trouvée correspondant au nom donné: attr 'Android: keyboardNavigationCluster'

Dans mon projet natif réactif en Android/app/build.gradle j'ai

...
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;
    }
}
...

mais je reçois toujours

<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
Alessandro Annini

Allez dans Projet React-Native : Android/build.gradle fichier et restreindre fbsdk Version à 4.28.0 .

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

Si vous avez une autre erreur comme ci-dessous:

Erreur lors de la récupération du parent de l'élément: Aucune ressource trouvée correspondant au nom donné 'Android: TextAppearance.Material.Widget.Button.Colored'`.

Tu peux essayer:

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

Source: rafaesc

38
Syed Zain Ali

vous accédez à YOUR_PROJECT/node_modules/react-native-fbsdk/Android/build.gradle

à la recherche de la ligne 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.+')
}

changer la compilation ('com.facebook.Android:facebook-Android-sdk:4+') en compilation ('com.facebook.Android:facebook-Android-sdk:4.28.0')

Ça marche pour moi

7
Nam Nguyễn