没有解决方案:找不到与给定名称匹配的资源:attr'android:keyboardNavigationCluster'

时间:2017-12-14 09:02:46

标签: android react-native android-studio-3.0 gradle-dependencies

获取此:错误:(15,21)找不到与给定名称匹配的资源:attr'android:keyboardNavigationCluster'

使用Android Studio 3.0.1,react-native 0.48.2。

我当前的build.gradle(app):

android {
    compileSdkVersion 26
    buildToolsVersion "26.0.2"

    defaultConfig {
        applicationId "com.awesome"
        minSdkVersion 16
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        ndk {
            abiFilters "armeabi-v7a", "x86"
        }
    }
    ...
}

依赖项:

dependencies {
    compile(project(":react-native-google-signin")){
        exclude group: "com.google.android.gms" // very important
    }
    compile project(':react-native-splash-screen')
    compile(project(':react-native-fbsdk')){
        exclude(group: 'com.facebook.android', module: 'facebook-android-sdk')
    }
    compile "com.facebook.android:facebook-android-sdk:4.29.0"
    compile fileTree(dir: "libs", include: ["*.jar"])
    compile("com.android.support:appcompat-v7:26.0.2"){
        force = true
    }
    compile "com.facebook.react:react-native:+"  // From node_modules
    compile project(':react-native-splash-screen')
    compile 'com.google.android.gms:play-services-auth:11.6.2'
    compile project(':react-native-spinkit')
    compile project(':react-native-push-notification')
    compile ('com.google.android.gms:play-services-gcm:11.6.2') {
        force = true;
    }
    compile project(':react-native-google-places')
    compile "com.google.android.gms:play-services-places:11.6.2"
    compile "com.google.android.gms:play-services-location:11.6.2"
    compile "com.google.android.gms:play-services-maps:11.6.2"
    compile project(':react-native-android-location-services-dialog-box')
    compile project(':react-native-svg')
    compile (project(':react-native-mauron85-background-geolocation')){
        exclude(group: 'com.google.android', module: 'android')
    }
}

gradlew应用程序:依赖项

+--- project :react-native-google-signin
|    +--- com.android.support:appcompat-v7:23.0.1 -> 26.0.2
|    |    +--- com.android.support:support-annotations:26.0.2 -> 27.0.2
|    |    +--- com.android.support:support-v4:26.0.2 -> 27.0.2
|    |    |    +--- com.android.support:support-compat:27.0.2
|    |    |    |    +--- com.android.support:support-annotations:27.0.2
|    |    |    |    \--- android.arch.lifecycle:runtime:1.0.3
|    |    |    |         +--- android.arch.lifecycle:common:1.0.3
|    |    |    |         \--- android.arch.core:common:1.0.0
|    |    |    +--- com.android.support:support-media-compat:27.0.2
|    |    |    |    +--- com.android.support:support-annotations:27.0.2
|    |    |    |    \--- com.android.support:support-compat:27.0.2 (*)
|    |    |    +--- com.android.support:support-core-utils:27.0.2
|    |    |    |    +--- com.android.support:support-annotations:27.0.2
|    |    |    |    \--- com.android.support:support-compat:27.0.2 (*)
|    |    |    +--- com.android.support:support-core-ui:27.0.2
|    |    |    |    +--- com.android.support:support-annotations:27.0.2
|    |    |    |    \--- com.android.support:support-compat:27.0.2 (*)
|    |    |    \--- com.android.support:support-fragment:27.0.2
|    |    |         +--- com.android.support:support-compat:27.0.2 (*)
|    |    |         +--- com.android.support:support-core-ui:27.0.2 (*)
|    |    |         +--- com.android.support:support-core-utils:27.0.2 (*)
|    |    |         \--- com.android.support:support-annotations:27.0.2
|    |    +--- com.android.support:support-vector-drawable:26.0.2
|    |    |    +--- com.android.support:support-annotations:26.0.2 -> 27.0.2
|    |    |    \--- com.android.support:support-compat:26.0.2 -> 27.0.2 (*)
|    |    \--- com.android.support:animated-vector-drawable:26.0.2
|    |         +--- com.android.support:support-vector-drawable:26.0.2 (*)
|    |         \--- com.android.support:support-core-ui:26.0.2 -> 27.0.2 (*)
|    \--- com.facebook.react:react-native:+ -> 0.51.0
|         +--- javax.inject:javax.inject:1
|         +--- com.android.support:appcompat-v7:23.0.1 -> 26.0.2 (*)
|         +--- com.facebook.fbui.textlayoutbuilder:textlayoutbuilder:1.0.0
|         |    \--- com.facebook.fbui.textlayoutbuilder:staticlayout-proxy:1.0
|         +--- com.facebook.fresco:fresco:1.3.0
|         |    +--- com.facebook.fresco:drawee:1.3.0
|         |    |    \--- com.facebook.fresco:fbcore:1.3.0
|         |    +--- com.facebook.fresco:fbcore:1.3.0
|         |    \--- com.facebook.fresco:imagepipeline:1.3.0
|         |         +--- com.parse.bolts:bolts-tasks:1.4.0
|         |         +--- com.facebook.fresco:fbcore:1.3.0
|         |         \--- com.facebook.fresco:imagepipeline-base:1.3.0
|         |              +--- com.parse.bolts:bolts-tasks:1.4.0
|         |              \--- com.facebook.fresco:fbcore:1.3.0
|         +--- com.facebook.fresco:imagepipeline-okhttp3:1.3.0
|         |    +--- com.squareup.okhttp3:okhttp:3.6.0
|         |    |    \--- com.squareup.okio:okio:1.11.0 -> 1.13.0
|         |    +--- com.facebook.fresco:fbcore:1.3.0
|         |    \--- com.facebook.fresco:imagepipeline:1.3.0 (*)
|         +--- com.facebook.soloader:soloader:0.1.0
|         +--- com.google.code.findbugs:jsr305:3.0.0
|         +--- com.squareup.okhttp3:okhttp:3.6.0 (*)
|         +--- com.squareup.okhttp3:okhttp-urlconnection:3.6.0
|         |    \--- com.squareup.okhttp3:okhttp:3.6.0 (*)
|         +--- com.squareup.okio:okio:1.13.0
|         \--- org.webkit:android-jsc:r174650
+--- project :react-native-splash-screen
|    +--- com.android.support:appcompat-v7:23.4.0 -> 26.0.2 (*)
|    \--- com.facebook.react:react-native:+ -> 0.51.0 (*)
+--- project :react-native-fbsdk
|    +--- com.android.support:appcompat-v7:25.0.0 -> 26.0.2 (*)
|    \--- com.facebook.react:react-native:+ -> 0.51.0 (*)
+--- com.facebook.android:facebook-android-sdk:4.29.0
|    +--- com.facebook.android:facebook-core:4.29.0
|    |    +--- com.parse.bolts:bolts-android:1.4.0
|    |    |    +--- com.parse.bolts:bolts-tasks:1.4.0
|    |    |    \--- com.parse.bolts:bolts-applinks:1.4.0
|    |    |         \--- com.parse.bolts:bolts-tasks:1.4.0
|    |    +--- com.android.support:support-annotations:27.0.1 -> 27.0.2
|    |    \--- com.android.support:support-core-utils:27.0.1 -> 27.0.2 (*)
|    +--- com.facebook.android:facebook-common:4.29.0
|    |    +--- com.facebook.android:facebook-core:4.29.0 (*)
|    |    +--- com.android.support:appcompat-v7:27.0.1 -> 26.0.2 (*)
|    |    +--- com.android.support:cardview-v7:27.0.1
|    |    |    \--- com.android.support:support-annotations:27.0.1 -> 27.0.2
|    |    +--- com.android.support:customtabs:27.0.1
|    |    |    +--- com.android.support:support-compat:27.0.1 -> 27.0.2 (*)
|    |    |    \--- com.android.support:support-annotations:27.0.1 -> 27.0.2
|    |    +--- com.android.support:support-v4:27.0.1 -> 27.0.2 (*)
|    |    \--- com.google.zxing:core:3.3.0
|    +--- com.facebook.android:facebook-login:4.29.0
|    |    +--- com.facebook.android:facebook-core:4.29.0 (*)
|    |    \--- com.facebook.android:facebook-common:4.29.0 (*)
|    +--- com.facebook.android:facebook-share:4.29.0
|    |    +--- com.facebook.android:facebook-core:4.29.0 (*)
|    |    \--- com.facebook.android:facebook-common:4.29.0 (*)
|    +--- com.facebook.android:facebook-places:4.29.0
|    |    \--- com.facebook.android:facebook-core:4.29.0 (*)
|    +--- com.facebook.android:facebook-applinks:4.29.0
|    |    \--- com.facebook.android:facebook-core:4.29.0 (*)
|    \--- com.facebook.android:facebook-messenger:4.29.0
|         \--- com.facebook.android:facebook-core:4.29.0 (*)
+--- com.android.support:appcompat-v7:26.0.2 (*)
+--- com.facebook.react:react-native:+ -> 0.51.0 (*)
+--- com.google.android.gms:play-services-auth:11.6.2
|    +--- com.google.android.gms:play-services-auth-api-phone:11.6.2
|    |    +--- com.google.android.gms:play-services-base:11.6.2
|    |    |    +--- com.google.android.gms:play-services-basement:11.6.2
|    |    |    |    +--- com.android.support:support-v4:25.2.0 -> 27.0.2 (*)
|    |    |    |    \--- com.google.android.gms:play-services-basement-license:11.6.2
|    |    |    +--- com.google.android.gms:play-services-tasks:11.6.2
|    |    |    |    +--- com.google.android.gms:play-services-basement:11.6.2 (*)
|    |    |    |    \--- com.google.android.gms:play-services-tasks-license:11.6.2
|    |    |    \--- com.google.android.gms:play-services-base-license:11.6.2
|    |    +--- com.google.android.gms:play-services-basement:11.6.2 (*)
|    |    +--- com.google.android.gms:play-services-tasks:11.6.2 (*)
|    |    \--- com.google.android.gms:play-services-auth-api-phone-license:11.6.2
|    +--- com.google.android.gms:play-services-auth-base:11.6.2
|    |    +--- com.google.android.gms:play-services-base:11.6.2 (*)
|    |    +--- com.google.android.gms:play-services-basement:11.6.2 (*)
|    |    +--- com.google.android.gms:play-services-tasks:11.6.2 (*)
|    |    \--- com.google.android.gms:play-services-auth-base-license:11.6.2
|    +--- com.google.android.gms:play-services-base:11.6.2 (*)
|    +--- com.google.android.gms:play-services-basement:11.6.2 (*)
|    \--- com.google.android.gms:play-services-tasks:11.6.2 (*)
+--- project :react-native-spinkit
|    +--- com.facebook.react:react-native:+ -> 0.51.0 (*)
|    \--- com.github.ybq:Android-SpinKit:1.1.0
+--- project :react-native-push-notification
|    +--- com.android.support:appcompat-v7:23.1.1 -> 26.0.2 (*)
|    +--- com.facebook.react:react-native:+ -> 0.51.0 (*)
|    +--- com.google.android.gms:play-services-gcm:+ -> 11.6.2
|    |    +--- com.google.android.gms:play-services-base:11.6.2 (*)
|    |    +--- com.google.android.gms:play-services-basement:11.6.2 (*)
|    |    +--- com.google.android.gms:play-services-iid:11.6.2
|    |    |    +--- com.google.android.gms:play-services-base:11.6.2 (*)
|    |    |    +--- com.google.android.gms:play-services-basement:11.6.2 (*)
|    |    |    \--- com.google.android.gms:play-services-iid-license:11.6.2
|    |    \--- com.google.android.gms:play-services-gcm-license:11.6.2
|    \--- me.leolin:ShortcutBadger:1.1.8
+--- com.google.android.gms:play-services-gcm:11.6.2 (*)
+--- project :react-native-google-places
|    +--- com.facebook.react:react-native:+ -> 0.51.0 (*)
|    +--- com.google.android.gms:play-services-base:10.2.4 -> 11.6.2 (*)
|    +--- com.google.android.gms:play-services-places:10.2.4 -> 11.6.2
|    |    +--- com.google.android.gms:play-services-base:11.6.2 (*)
|    |    +--- com.google.android.gms:play-services-basement:11.6.2 (*)
|    |    +--- com.google.android.gms:play-services-maps:11.6.2
|    |    |    +--- com.google.android.gms:play-services-base:11.6.2 (*)
|    |    |    +--- com.google.android.gms:play-services-basement:11.6.2 (*)
|    |    |    \--- com.google.android.gms:play-services-maps-license:11.6.2
|    |    +--- com.google.android.gms:play-services-tasks:11.6.2 (*)
|    |    \--- com.google.android.gms:play-services-places-license:11.6.2
|    +--- com.google.android.gms:play-services-location:10.2.4 -> 11.6.2
|    |    +--- com.google.android.gms:play-services-base:11.6.2 (*)
|    |    +--- com.google.android.gms:play-services-basement:11.6.2 (*)
|    |    +--- com.google.android.gms:play-services-tasks:11.6.2 (*)
|    |    \--- com.google.android.gms:play-services-location-license:11.6.2
|    \--- com.google.maps.android:android-maps-utils:0.3.4
+--- com.google.android.gms:play-services-places:11.6.2 (*)
+--- com.google.android.gms:play-services-location:11.6.2 (*)
+--- com.google.android.gms:play-services-maps:11.6.2 (*)
+--- project :react-native-android-location-services-dialog-box
|    \--- com.facebook.react:react-native:+ -> 0.51.0 (*)
+--- project :react-native-svg
|    +--- com.android.support:appcompat-v7:25.3.1 -> 26.0.2 (*)
|    \--- com.facebook.react:react-native:+ -> 0.51.0 (*)
+--- project :react-native-mauron85-background-geolocation
|    +--- com.facebook.react:react-native:+ -> 0.51.0 (*)
|    +--- com.android.support:support-v4:+ -> 27.0.2 (*)
|    +--- com.google.android.gms:play-services-location:+ -> 11.6.2 (*)
|    +--- com.github.tony19:logback-android-core:1.1.1-6
|    +--- com.github.tony19:logback-android-classic:1.1.1-6
|    |    +--- com.github.tony19:logback-android-core:1.1.1-6
|    |    \--- com.github.tony19:apktool-lib:1.4.4-3
|    \--- org.slf4j:slf4j-api:1.7.21
\--- com.google.firebase:firebase-core:11.6.2
     \--- com.google.firebase:firebase-analytics:11.6.2
          +--- com.google.android.gms:play-services-basement:11.6.2 (*)
          +--- com.google.firebase:firebase-common:11.6.2
          |    +--- com.google.android.gms:play-services-basement:11.6.2 (*)
          |    +--- com.google.android.gms:play-services-tasks:11.6.2 (*)
          |    \--- com.google.firebase:firebase-common-license:11.6.2
          +--- com.google.firebase:firebase-analytics-impl:11.6.2
          |    +--- com.google.android.gms:play-services-basement:11.6.2 (*)
          |    +--- com.google.firebase:firebase-iid:11.6.2
          |    |    +--- com.google.android.gms:play-services-basement:11.6.2 (*)
          |    |    +--- com.google.firebase:firebase-common:11.6.2 (*)
          |    |    +--- com.google.android.gms:play-services-tasks:11.6.2 (*)
          |    |    \--- com.google.firebase:firebase-iid-license:11.6.2
          |    +--- com.google.firebase:firebase-common:11.6.2 (*)
          |    +--- com.google.android.gms:play-services-tasks:11.6.2 (*)
          |    \--- com.google.firebase:firebase-analytics-impl-license:11.6.2
          \--- com.google.firebase:firebase-analytics-license:11.6.2

尝试了许多解决方案,如: No resource found that matches the given name: attr 'android:keyboardNavigationCluster'. when updating to Support Library 26.0.0

没有任何效果!

依赖项中没有红色下划线。

对此案件有何具体建议?非常感谢!

修改 有关错误的更多信息: (Fotgot提到它,似乎是包反应中的问题 - native-fbsdk)

The error screenshot

1 个答案:

答案 0 :(得分:0)

Google Play服务11.6.2取决于支持库27.0.2。但仅限于其中一些。

然后您强制appcompat-v7支持库到版本26.0.2。这会导致冲突。

所有导入的支持库都需要具有相同的版本,否则它们将在其他支持库中引用不存在的代码和资源(例如样式属性)。 GMS + Firebase也是如此。

现在将appcompat-v7版本提升至27.0.2并在将来保持一致。

<a class="btn btn-primary pull-right" press-enter="" ng-click="validate()" tabindex="4">Login</a>

正如支持库版本26需要编译SDK版本26一样,支持库版本27要求您的项目针对SDK版本27进行编译。

compile("com.android.support:appcompat-v7:27.0.2") {
    force = true
}

反过来可能需要构建工具27 +。

compileSdkVersion 27

“可能需要”意味着

  • 我没有检查
  • Android Gradle插件3.0.0自动选择至少所需的最低要求(因此您可以完全删除该行)