Alé*_*lho 213 android android-appcompat android-support-library android-gradle-plugin
我在更新到最新的支持库版本26.0.0时遇到此问题(https://developer.android.com/topic/libraries/support-library/revisions.html#26-0-0):
错误:(18,21)找不到与给定名称匹配的资源:attr'android:keyboardNavigationCluster'.
/.../app/build/intermediates/res/merged/beta/debug/values-v26/values-v26.xml
Error:(15, 21) No resource found that matches the given name: attr 'android:keyboardNavigationCluster'.
Error:(18, 21) No resource found that matches the given name: attr 'android:keyboardNavigationCluster'.
Error:(15, 21) No resource found that matches the given name: attr 'android:keyboardNavigationCluster'.
Error:(18, 21) No resource found that matches the given name: attr 'android:keyboardNavigationCluster'.
Error:Execution failed for task ':app:processBetaDebugResources'.
Run Code Online (Sandbox Code Playgroud)
com.android.ide.common.process.ProcessException:无法执行aapt
该文件来自支持库:
<style name="Base.V26.Widget.AppCompat.Toolbar" parent="Base.V7.Widget.AppCompat.Toolbar">
<item name="android:touchscreenBlocksFocus">true</item>
<item name="android:keyboardNavigationCluster">true</item>
</style>
Run Code Online (Sandbox Code Playgroud)
我们使用以下版本:
ext.COMPILE_SDK_VERSION = 26
ext.BUILD_TOOLS_VERSION = "26.0.1"
ext.MIN_SDK_VERSION = 17
ext.TARGET_SDK_VERSION = 26
ext.ANDROID_SUPPORT_LIBRARY_VERSION = "26.0.0"
ext.GOOGLE_PLAY_SERVICES_LIBRARY_VERSION = "11.0.2"
Run Code Online (Sandbox Code Playgroud)
compile 'com.android.support:appcompat-v7:' + ANDROID_SUPPORT_LIBRARY_VERSION
compile 'com.android.support:design:' + ANDROID_SUPPORT_LIBRARY_VERSION
compile 'com.android.support:recyclerview-v7:' + ANDROID_SUPPORT_LIBRARY_VERSION
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?
XH6*_*ser 310
我能够通过更新gradle中的sdk版本和工具来解决它
compileSdkVersion 26
buildToolsVersion "26.0.1"
和support library 26.0.1 https://developer.android.com/topic/libraries/support-library/revisions.html#26-0-1
小智 53
更改编译SDK版本:
compileSdkVersion 26
Run Code Online (Sandbox Code Playgroud)
构建工具版本:
buildToolsVersion "26.0.1"
Run Code Online (Sandbox Code Playgroud)
目标SDK版本:
targetSdkVersion 26
Run Code Online (Sandbox Code Playgroud)
依赖关系:
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+'
Run Code Online (Sandbox Code Playgroud)
同步Gradle.
小智 35
我不得不改变compileSdkVersion = 26和buildToolsVersion = '26.0.1'我的所有依赖build.gradle文件
pet*_*oid 13
在我的react-native项目中,此错误在react-native-fbsdk.更新react-native-fbsdk/android/build.gradle以下内容可解决此问题.
compileSdkVersion 26
buildToolsVersion "26.0.1"
Run Code Online (Sandbox Code Playgroud)
我点击了这个完全相同的错误,并且谷歌搜索到我试图找到我做错了什么,因为这是生成构建值-26代码而不是我提供的样式.我尝试了从Gradle 4.0到Android Studio预览3.0到金丝雀频道的所有内容.
我从未在网上找到答案.最后,我能够回到标准的Dev Android Studio和2.3.3 Gradle,因为我不小心修了它:).
原来我非常专注于更新我的库项目,我没有注意到错误是由嵌套在我的库项目中的未使用的子模块(演示应用程序)引起的.一旦我更新了子模块以匹配26个构建工具和26个以上的设计和支持库,我的问题就消失了.
不确定这是否也是你所看到的,但我个人只是更新了lib再次发布,所以不关心示例应用程序模块,错误肯定与26 sdk有关,我只触及了lib模块因此没有考虑检查另一个.所以这对我来说一直是个问题.希望这也能解决你的问题.我在2个库项目中遇到此错误,并将其修复为两个.
Goodluck无论哪种方式,如果这不能解决您的问题,请分享做了什么.BTW 26.0.01构建工具和26.1.0设计和支持是我最终的目标,尽管26.0.1也运行良好.
我有这个确切的错误,我意识到了我的compileSdkVersion设置为25我buildToolsVersion设置为"26.0.1".
所以,我只是改变了compileSdkVersion对26和同步的摇篮.它解决了我的问题.
编辑:我targetSDKVersion也被设置为26
我对react-native-youtube和react-native-orientation有类似的错误.
想通了,那些Project的build.gradle使用compileSdkVersion 23但是功能:android:keyboardNavigationCluster自api 26(android 8)起添加.
那怎么解决?
解决这个问题的一种方法是编辑/android/build.gradle(!!! NOT /android/app/build.gradle)并在文件底部添加这些代码.
这允许您强制子模块使用的SDK和BuildTool-Version:
subprojects {
afterEvaluate {project ->
if (project.hasProperty("android")) {
android {
compileSdkVersion 27
buildToolsVersion "27.0.2"
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
我也遇到过这个问题你需要进行2次更改:
文件名:android/build.gradle提到下面这段代码
subprojects {
afterEvaluate {
project -> if (project.hasProperty("android")) {
android {
compileSdkVersion 26 buildToolsVersion '26.0.2'
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
文件名:android/app/build.gradle 改变你的compliesdk版本和buildToolVersion如下:
compileSdkVersion 26 buildToolsVersion "26.0.2"
Run Code Online (Sandbox Code Playgroud)
并在
dependencies {
compile 'com.android.support:appcompat-v7:26.0.2'
}
Run Code Online (Sandbox Code Playgroud)
我的Ionic 2项目遇到了同样的问题,我所做的就是解决问题
ionic build --release android希望这有助于某人!
小智 6
//Adding this to the root build.gradle solved my problem, thanks @Yalamber
subprojects {
afterEvaluate { project ->
if (project.hasProperty("android")) {
android {
compileSdkVersion 26
buildToolsVersion '26.0.2'
}
}
}
}
Run Code Online (Sandbox Code Playgroud)