Ionic

Ionic Error

By October 4, 2017 No Comments

The problem: platforms/android/build/intermediates/res/merged/debug/values-v26/values-v26.xml:15:21-54: AAPT: No resource found that matches the given name: attr ‘android:keyboardNavigationCluster’.

Platform: Android

Step 1: Make sure Android Studio & tools are up to date.

Android SDK build tools, Android SDK tools, Google Repository, Android SDK platform-tools and google play services need to be at at their latest version. May be you don’t need all of the mentioned items, some are optional but it’s not going to hurt to have it.

Step 2: Update cordova-android to 6.3.0

1
cordova platform update android@6.3.0

Or

1
cordova platform rm android
1
cordova platform add android@6.3.0

Step 3:

Try running

1
ionic run android

It’s going to download some stuff first. You may see this error: Execution failed for task ‘:transformClassesWithDexForDebug’.

In the file build.gradle located under platforms/android. Add this under android block -> default config block

multiDexEnabled true

Example: https://developer.android.com/studio/build/multidex.html#mdex-gradle 

Step 4:

Let’s try running one more time.

1
ionic run android
I got an error again. Error: Execution failed for task ':transformClassesWithJarMergingForDebug'.

Solution:

1
cordova plugin add cordova-google-api-version --variable GOOGLE_API_VERSION=11.4.0

The 11.4.0 from the above command can of course be some other version as well. Read more about what the above command does here: https://github.com/transistorsoft/cordova-google-api-version

Step 5:

Let’s try running one more time.

1
ionic run android

If it runs, awesome! However, on a different laptop I received another error: Error: Cannot find module ‘xml2js’.

Solution:

1
npm install xml2js

Step 6:

Let’s try running one more time.

1
ionic run android