Reputation: 13657
I've got this issue while updating to the latest Support Library version 26.0.0 (https://developer.android.com/topic/libraries/support-library/revisions.html#26-0-0):
Error:(18, 21) No resource found that matches the given name: 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'.
com.android.ide.common.process.ProcessException: Failed to execute aapt
The file is from the support library:
<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>
We're using the following versions:
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"
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
Any ideas?
Upvotes: 217
Views: 144969
Reputation: 11
I solved this problem by doing the following:
compileSdkVersion 26
buildToolsVersion "26.0.1"
compile 'com.android.support:appcompat-v7:26.0.1'
compile 'com.android.support:design:26.0.1'
compile 'com.android.support:cardview-v7:26.0.1'
compile 'com.android.support:recyclerview-v7:26.0.1'
Upvotes: 0
Reputation: 13628
I've had a similar error for react-native-youtube & react-native-orientation.
Figured out, that the build.gradle of those Project use compileSdkVersion 23
but the Feature: android:keyboardNavigationCluster was added since api 26
(android 8).
So how to fix?
One way to fix this easily is to edit your /android/build.gradle ( !!! NOT /android/app/build.gradle) and add those code at the bottom of the file.
This allow you to force the SDK and BuildTool-Version your submodules use:
subprojects {
afterEvaluate {project ->
if (project.hasProperty("android")) {
android {
compileSdkVersion 27
buildToolsVersion "27.0.2"
}
}
}
}
Upvotes: 8
Reputation: 2607
I got this issue when compile react-native-fbsdk
I resolved this issue by change build.gradle
of react-native-fbsdk
from
compile('com.facebook.android:facebook-android-sdk:4.+')
to
compile('com.facebook.android:facebook-android-sdk:4.28.0')
Upvotes: 2
Reputation: 333
For this you have to do below things 1.right click the project click.
2.open module settings->in properties tab->change the compile sdk and build tool version into 26,26.0.0.
3.click ok.
Its working for me after an hour tried.
Upvotes: 0
Reputation: 945
when you try to change targetSDKVersion 26 to 25 that time occurred i was found solution of No resource found that matches the given name: attr 'android:keyboardNavigationCluster'. when updating to Support Library 26.0.0
Just Chage This code from Your Build.gradle
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == 'com.android.support') {
if (!requested.name.startsWith("multidex")) {
details.useVersion '26.0.1'
}
}
}
}
to
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == 'com.android.support') {
if (!requested.name.startsWith("multidex")) {
details.useVersion '25.2.0'
}
}
}
}
Upvotes: 2
Reputation: 5392
I hit this exact same error and was Googling all over trying to find what I'm doing wrong as that is generated build values-26 code and not styles that I provided. I tried everything from Gradle 4.0 to Android Studio preview 3.0 to canary channel, you name it.
I never found the answer online. In the end, I was able to go back to standard Dev Android Studio and 2.3.3 Gradle as I ended up accidentally fixing it :).
Turned out I was so focused on updating my library project that I was not noticing that the error was caused from an unused sub module (demo app) that is nested in my library project. Once I updated the sub module to match the 26 build tools and 26+ design and support libraries my problem went away.
Not sure if that is what you are seeing as well, but personally I was only updating the lib to release again so wasn't caring about the sample app module, and the error sure appeared to be related to 26 sdk which I only touched in the lib module so wasn't thinking to check the other one. So that was the problem all along for me. Hopefully that fixes you as well. I had this error in 2 library projects and it fixed it in both.
Goodluck either way and if this doesn't resolve your issue, please share what did. BTW 26.0.01 build tools and 26.1.0 design and support is where I ended up going to in the end, although 26.0.1 worked fine as well.
Upvotes: 9
Reputation: 31
In android studio,
right click on the project (since I had a Cordova project, I had CordovaLib and android: I selected android in my case),
Upvotes: 3
Reputation: 919
Change Compile SDK Version:
compileSdkVersion 26
Build Tool Version:
buildToolsVersion "26.0.1"
Target SDK Version:
targetSdkVersion 26
Dependencies:
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+'
Sync Gradle.
Upvotes: 52
Reputation: 5279
I updated my project app/build.gradle
to have
compileSDkVersion 26
buildToolsVersion '26.0.1'
However, the problem was actually with the react-native-fbsdk
package. I had to change the same settings in node_modules/react-native-fbsdk/android/build.gradle
.
Upvotes: 3
Reputation: 741
I was facing the same issue for one of my PhoneGap project (Android studio 3.0.1). To resolve this I have followed, the following step
1) Right click on Project name (In my Case android), select "Open Module Settings"
2) Select modules (android and CordovaLib)
3) Click properties on top
4) Chose Compile SDK version (I have chosen API 26: Android 8.0 )
5) Choose Build Tools Version (I have chosen 26.0.2)
6) Source Compatibility ( 1.6)
7) Target Compatibility ( 1.6)
Click Ok and rebuild project.
The following link shows my setting for step I have followed
https://app.box.com/s/o11xc8dy0c2c7elsaoppa0kwe1d94ogh https://app.box.com/s/ofdcg0a8n0zalumvpyju58he402ag1th
Upvotes: 2
Reputation: 473
I had the same issue with my Ionic 2 project, all I did to resolved the issues was
ionic build --release android
Hope this helps someone!
Upvotes: 7
Reputation: 728
i had the same issue with ionic .
cordova platform remove android
cordova platform add android@6.4.0
And replace in platform/android/projet.properties
cordova.system.library.1=com.android.support:support-v4+
To
cordova.system.library.1=com.android.support:support-v4:26+
Upvotes: 0
Reputation: 26
For anyone using nativescript and facing this issue: you can add
compileSdkVersion 26
buildToolsVersion '26.0.1'
in App_Resources/Android/app.gradle (under android {
)
Then run tns platform remove android
and tns build android
in your project root.
Upvotes: 1
Reputation: 944
I hit this recently and remember where it comes from. It's a mismatch between the Xamarin.Android.* version and the installed Android SDK version.
The current VS2017 15.5.3
new project defaults for nuGet Xamarin.Android.*
are 25.4.0.2
and the default VS install for cross platform development are the following Android SDK packages:
7.1
- Nougat
25
If you upgraded you solution nuGet for Xamarin.Android.*
to 26.1.0.1
then you will need to install the follow in the Android SDK:
8.0
- Oreo
26
Upvotes: 2
Reputation: 683
I resolved this issue by making some changes in build.gradle file
Changes in root build.gradle are as follows:
subprojects {
afterEvaluate {
project -> if (project.hasProperty("android")) {
android {
compileSdkVersion 26
buildToolsVersion '26.0.1'
}
}
}
}
Changes in build.gradle are as follows:
compileSdkVersion 26
buildToolsVersion "26.0.1"
and
dependencies {
compile 'com.android.support:appcompat-v7:26.0.1'
}
Upvotes: 1
Reputation: 3072
I also faced this issue you just need to make 2 changes:
File Name : android/build.gradle mention this below code
subprojects {
afterEvaluate {
project -> if (project.hasProperty("android")) {
android {
compileSdkVersion 26 buildToolsVersion '26.0.2'
}
}
}
}
File Name :android/app/build.gradle change your compliesdk version and buildToolVersion like this:
compileSdkVersion 26 buildToolsVersion "26.0.2"
and in
dependencies {
compile 'com.android.support:appcompat-v7:26.0.2'
}
Upvotes: 7
Reputation: 61
//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'
}
}
}
}
Upvotes: 6
Reputation: 1126
In my react-native project, this error is generated in the react-native-fbsdk
. Updating the react-native-fbsdk/android/build.gradle
as following fixes the issue.
compileSdkVersion 26
buildToolsVersion "26.0.1"
Upvotes: 13
Reputation: 101
After updating your android studio to 3.0, if this error occurs just update the gradle properties, these are the settings which solved my issue:
compileSdkVersion 26
targetSdkVersion 26
buildToolsVersion '26.0.2'
Upvotes: 4
Reputation: 395
update these in gradle
compileSdkVersion 27 buildToolsVersion '27.0.1'
Upvotes: 1
Reputation: 674
Make sure you have Android SDK 8.0 on your development environment. I was having the same issue on my MAC and installing SDK 8.0 and its tools fixed it. I am having the same issue on Windows. I am downloading the SDK now.
Upvotes: 0
Reputation: 11
This issue was caused by one of the libraries for me that needed version 26 for compilation.
Making the targetSdkVersion to 26 will cause other issues and you will have to tweak your app to adapt to the Oreo platform. This is not the correct solution for all.
Just making the compileSdkVersion to 26
and buildToolsVersion to 26.0.2
worked for me.
One should also update all of their support libraries to use 26.1.0 or later.
Upvotes: 1
Reputation: 679
I had this exact error and I realized the my compileSdkVersion
was set at 25
and my buildToolsVersion
was set at "26.0.1"
.
So I just changed the compileSdkVersion
to 26
and synced the Gradle. it fixed the problem for me.
EDIT: my targetSDKVersion
was also set as 26
Upvotes: 8
Reputation: 3460
I was able to resolve it by updating sdk version and tools in gradle
compileSdkVersion 26
buildToolsVersion "26.0.1"
and support library 26.0.1
https://developer.android.com/topic/libraries/support-library/revisions.html#26-0-1
Upvotes: 315
Reputation: 369
I had to change compileSdkVersion = 26
and buildToolsVersion = '26.0.1'
in all my dependencies build.gradle
files
Upvotes: 35
Reputation: 365
Just clear your project and build again.
./gradlew app:clean app:assembleDebug
But it not works when targetSdkVersion or compileSdkVersion is 25.
Upvotes: -1