No resource found that matches the given name: attr 'android:keyboardNavigationCluster'. when updating to Support Library 26.0.0

AndroidAndroid Gradle-PluginAndroid Support-LibraryAndroid Appcompat

Android Problem Overview


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?

Android Solutions


Solution 1 - Android

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

Solution 2 - Android

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.

Solution 3 - Android

I had to change compileSdkVersion = 26 and buildToolsVersion = '26.0.1' in all my dependencies build.gradle files

Solution 4 - Android

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"

Solution 5 - Android

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.

Solution 6 - Android

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

Solution 7 - Android

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"
            }
        }
    }
}

Solution 8 - Android

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'
}

Solution 9 - Android

I had the same issue with my Ionic 2 project, all I did to resolved the issues was

  • Open "ionic_project_folder/platforms/android/project.properties"
  • Change target=android-25 to target=android-26
  • Run ionic build --release android

Hope this helps someone!

Solution 10 - Android

//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'
                }
            }
        }
    }

Solution 11 - Android

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'

Solution 12 - Android

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.

Solution 13 - Android

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),

  1. Select Open Module Settings
  2. In the Project Structure modal that pops up select the project in the modules section in the side panel (again android in my case)
  3. Click on the Dependencies tab
  4. Click on the green plus button in the top right corner
  5. Select Library Dependency
  6. Select app-compat-v7 from the dropdown
  7. Clean project and rebuild

Solution 14 - Android

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

Solution 15 - Android

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:

  • Android 7.1 - Nougat
  • Android SDK Platform 25
  • Google APIs Intel x86 Atom System Image

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:

  • Android 8.0 - Oreo
  • Android SDK Platform 26
  • Google APIs Intel x86 Atom System Image

Solution 16 - Android

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'
            }
        }
    }
}

Solution 17 - Android

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')

Solution 18 - Android

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.

Solution 19 - Android

update these in gradle

compileSdkVersion 27 buildToolsVersion '27.0.1'

Solution 20 - Android

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'
}

Solution 21 - Android

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.

Solution 22 - Android

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.

Solution 23 - Android

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+

Solution 24 - Android

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.

Solution 25 - Android

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'

Solution 26 - Android

Just clear your project and build again.

./gradlew  app:clean app:assembleDebug

But it not works when targetSdkVersion or compileSdkVersion is 25.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionAl&#233;cio CarvalhoView Question on Stackoverflow
Solution 1 - AndroidXH6 userView Answer on Stackoverflow
Solution 2 - AndroidAmar GoreView Answer on Stackoverflow
Solution 3 - AndroidErik DuistersView Answer on Stackoverflow
Solution 4 - AndroidpeteroidView Answer on Stackoverflow
Solution 5 - AndroidSamView Answer on Stackoverflow
Solution 6 - AndroidJunaid AzizView Answer on Stackoverflow
Solution 7 - AndroidsutherView Answer on Stackoverflow
Solution 8 - AndroidRevansiddhView Answer on Stackoverflow
Solution 9 - AndroidAwedaView Answer on Stackoverflow
Solution 10 - AndroidPablo RendónView Answer on Stackoverflow
Solution 11 - AndroidAjayacharyaView Answer on Stackoverflow
Solution 12 - AndroidKarl TaylorView Answer on Stackoverflow
Solution 13 - AndroidJacView Answer on Stackoverflow
Solution 14 - AndroidChirag PurohitView Answer on Stackoverflow
Solution 15 - AndroiddskowView Answer on Stackoverflow
Solution 16 - AndroidSanjay HadiyaView Answer on Stackoverflow
Solution 17 - AndroidTuan NguyenView Answer on Stackoverflow
Solution 18 - AndroidMohammed IbrahimView Answer on Stackoverflow
Solution 19 - AndroidArtist404View Answer on Stackoverflow
Solution 20 - AndroidPalak JainView Answer on Stackoverflow
Solution 21 - Androidpalia5View Answer on Stackoverflow
Solution 22 - AndroidPh0b0xView Answer on Stackoverflow
Solution 23 - AndroidAmr.AyoubView Answer on Stackoverflow
Solution 24 - AndroidS HemaNandhiniView Answer on Stackoverflow
Solution 25 - AndroidAldemir GomesView Answer on Stackoverflow
Solution 26 - AndroidEsdrasView Answer on Stackoverflow