Ionic package build Error: Execution failed for task ':processDebugResources'


#1

Hello,

I’ve recently tried to build via ionic package for android and I’m getting the error below.
I’ve been trying for a few days now, if anyone has come across this before or know where I should look any help would be much appreciated. Thanks in advance!

ANDROID_HOME=/opt/android-sdk
JAVA_HOME=/usr/lib/jvm/java-8-oracle
:wrapper

BUILD SUCCESSFUL

Total time: 0.786 secs
Subproject Path: CordovaLib
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
	at build_cmmjfxj7s279swol7xqn0fj8l.run(/home/package/workspace/apps-ad904e3a-92/cordova/platforms/android/build.gradle:139)
The JavaCompile.setDependencyCacheDir() method has been deprecated and is scheduled to be removed in Gradle 4.0.
Incremental java compilation is an incubating feature.
The TaskInputs.source(Object) method has been deprecated and is scheduled to be removed in Gradle 4.0. Please use TaskInputs.file(Object).skipWhenEmpty() instead.
:preBuild UP-TO-DATE
:preDebugBuild UP-TO-DATE
:checkDebugManifest
:preReleaseBuild UP-TO-DATE
:CordovaLib:preBuild UP-TO-DATE
:CordovaLib:preDebugBuild UP-TO-DATE
:CordovaLib:checkDebugManifest
:CordovaLib:prepareDebugDependencies
:CordovaLib:compileDebugAidl
:CordovaLib:compileDebugNdk UP-TO-DATE
:CordovaLib:compileLint
:CordovaLib:copyDebugLint UP-TO-DATE
:CordovaLib:mergeDebugShaders
:CordovaLib:compileDebugShaders
:CordovaLib:generateDebugAssets
:CordovaLib:mergeDebugAssets
:CordovaLib:mergeDebugProguardFiles
:CordovaLib:packageDebugRenderscript UP-TO-DATE
:CordovaLib:compileDebugRenderscript
:CordovaLib:generateDebugResValues
:CordovaLib:generateDebugResources
:CordovaLib:packageDebugResources
:CordovaLib:processDebugManifest
:CordovaLib:generateDebugBuildConfig
:CordovaLib:processDebugResources
:CordovaLib:generateDebugSources
:CordovaLib:incrementalDebugJavaCompilationSafeguard
:CordovaLib:compileDebugJavaWithJavac
:CordovaLib:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
:CordovaLib:processDebugJavaRes UP-TO-DATE
:CordovaLib:transformResourcesWithMergeJavaResForDebug
:CordovaLib:transformClassesAndResourcesWithSyncLibJarsForDebug
:CordovaLib:mergeDebugJniLibFolders
:CordovaLib:transformNative_libsWithMergeJniLibsForDebug
:CordovaLib:transformNative_libsWithSyncJniLibsForDebug
:CordovaLib:bundleDebug
:CordovaLib:preReleaseBuild UP-TO-DATE
:CordovaLib:checkReleaseManifest
:CordovaLib:prepareReleaseDependencies
:CordovaLib:compileReleaseAidl
:CordovaLib:compileReleaseNdk UP-TO-DATE
:CordovaLib:copyReleaseLint UP-TO-DATE
:CordovaLib:mergeReleaseShaders
:CordovaLib:compileReleaseShaders
:CordovaLib:generateReleaseAssets
:CordovaLib:mergeReleaseAssets
:CordovaLib:mergeReleaseProguardFiles
:CordovaLib:packageReleaseRenderscript UP-TO-DATE
:CordovaLib:compileReleaseRenderscript
:CordovaLib:generateReleaseResValues
:CordovaLib:generateReleaseResources
:CordovaLib:packageReleaseResources
:CordovaLib:processReleaseManifest
:CordovaLib:generateReleaseBuildConfig
:CordovaLib:processReleaseResources
:CordovaLib:generateReleaseSources
:CordovaLib:incrementalReleaseJavaCompilationSafeguard
:CordovaLib:compileReleaseJavaWithJavac
:CordovaLib:compileReleaseJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
:CordovaLib:processReleaseJavaRes UP-TO-DATE
:CordovaLib:transformResourcesWithMergeJavaResForRelease
:CordovaLib:transformClassesAndResourcesWithSyncLibJarsForRelease
:CordovaLib:mergeReleaseJniLibFolders
:CordovaLib:transformNative_libsWithMergeJniLibsForRelease
:CordovaLib:transformNative_libsWithSyncJniLibsForRelease
:CordovaLib:bundleRelease
:prepareAndroidArchLifecycleRuntime100Library
:prepareComAndroidSupportAnimatedVectorDrawable2610Library
:prepareComAndroidSupportAppcompatV72610Library
:prepareComAndroidSupportSupportCompat2610Library
:prepareComAndroidSupportSupportCoreUi2610Library
:prepareComAndroidSupportSupportCoreUtils2610Library
:prepareComAndroidSupportSupportFragment2610Library
:prepareComAndroidSupportSupportMediaCompat2610Library
:prepareComAndroidSupportSupportV132340Library
:prepareComAndroidSupportSupportV42610Library
:prepareComAndroidSupportSupportVectorDrawable2610Library
:prepareComGoogleAndroidGmsPlayServicesBase1142Library
:prepareComGoogleAndroidGmsPlayServicesBaseLicense1142Library
:prepareComGoogleAndroidGmsPlayServicesBasement1142Library
:prepareComGoogleAndroidGmsPlayServicesBasementLicense1142Library
:prepareComGoogleAndroidGmsPlayServicesGcm1142Library
:prepareComGoogleAndroidGmsPlayServicesGcmLicense1142Library
:prepareComGoogleAndroidGmsPlayServicesIid1142Library
:prepareComGoogleAndroidGmsPlayServicesIidLicense1142Library
:prepareComGoogleAndroidGmsPlayServicesLocation1142Library
:prepareComGoogleAndroidGmsPlayServicesLocationLicense1142Library
:prepareComGoogleAndroidGmsPlayServicesTasks1142Library
:prepareComGoogleAndroidGmsPlayServicesTasksLicense1142Library
:prepareMeLeolinShortcutBadger1114Library
:prepareOrgApacheCordovaCordovaLib623DebugLibrary
:prepareTslocationmanagerLibrary
:prepareDebugDependencies
:compileDebugAidl
:compileDebugRenderscript
:generateDebugBuildConfig
:generateDebugResValues
:generateDebugResources
:mergeDebugResources
:processDebugManifest
:processDebugResources/home/package/workspace/apps-ad904e3a-92/cordova/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'.
    
/home/package/workspace/apps-ad904e3a-92/cordova/platforms/android/build/intermediates/res/merged/debug/values-v26/values-v26.xml:15: error: Error: No resource found that matches the given name: attr 'android:keyboardNavigationCluster'.


 FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':processDebugResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 5.367 secs
Error: /home/package/workspace/apps-ad904e3a-92/cordova/platforms/android/gradlew: Command failed with exit code 1 Error output:
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
/home/package/workspace/apps-ad904e3a-92/cordova/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'.
    
/home/package/workspace/apps-ad904e3a-92/cordova/platforms/android/build/intermediates/res/merged/debug/values-v26/values-v26.xml:15: error: Error: No resource found that matches the given name: attr 'android:keyboardNavigationCluster'.



FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':processDebugResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

No resource found that matches the given name: attr 'android:keyboardNavigationCluster'
#2

What is your ionic info output?
Does

mena anything to you?


#3

Hi, Thanks for the quick response!

android:keyboardNavigationCluster doesn’t ring a bell to me… but that’s definitely a good hint for me that I didn’t catch earlier, thanks!

My Ionic Info is:

cli packages: (/Users/donwong15/Documents/00-projects/hauul-driver-production/myApp/node_modules)

    @ionic/cli-utils  : 1.12.0
    ionic (Ionic CLI) : 3.12.0

global packages:

    cordova (Cordova CLI) : 7.0.1 
    Gulp CLI              : CLI version 3.9.1 Local version 3.9.1

local packages:

    Cordova Platforms : android 6.2.3 ios 4.4.0
    Ionic Framework   : ionic1 1.3.0-nightly-3127

System:

    ios-deploy : 1.9.1 
    ios-sim    : 5.0.13 
    Node       : v8.1.0
    npm        : 5.3.0 
    OS         : macOS Sierra
    Xcode      : Xcode 9.0 Build version 9A235 

Misc:

    backend : legacy


#4

Hi @Sujan12,

So I looked into “android:keyboardNavigationCluster” and I found a post written Today Oct 4, 2017 that talked about how to solve the issue:

http://priyank.rocks/androidkeyboardnavigationcluster/

The post talks about upgrading android platform to 6.3.0.

And step 1 involves: Making sure Android Studio & tools are up to date.

I tried to build with android 6.3.0 and I got the following error:

(Does ionic package build android support android 6.3.0?)

ANDROID_HOME=/opt/android-sdk
JAVA_HOME=/usr/lib/jvm/java-8-oracle
:wrapper

BUILD SUCCESSFUL

Total time: 0.774 secs
Subproject Path: CordovaLib
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
	at build_bu0fevafxgysos1ffymketd5n.run(/home/package/workspace/apps-ad904e3a-99/cordova/platforms/android/build.gradle:143)
Checking the license for package Android SDK Platform 26 in /opt/android-sdk/licenses
License for package Android SDK Platform 26 accepted.
Preparing "Install Android SDK Platform 26".
Warning: Failed to read or create install properties file.

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'android'.
> Failed to install the following SDK components:
  [Android SDK Platform 26]
  The SDK directory (/opt/android-sdk) is not writeable,
  please update the directory permissions.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 6.584 secs
Error: /home/package/workspace/apps-ad904e3a-99/cordova/platforms/android/gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'android'.
> Failed to install the following SDK components:
  [Android SDK Platform 26]
  The SDK directory (/opt/android-sdk) is not writeable,
  please update the directory permissions.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

#5

Did something with sudo? Permissions seems to be messed up somehow. Fix that.

Is ionic cordova requirements happy?


#6

Hey Sujan,

This is using ionic package build… I don’t think I have the ability to
run sudo on ionic cloud services. Do I?


#7

Oh, good point. Sorry.

No, probably not. Definitely something support has to look into then.


#8

Any luck with this error ? I’m now facing it too
Can you help me please ??


#9

Hey I now build android locally on my mac.

You need android 6.3.0 in order to use the Background Geolocation Plugin (Or whatever plugin is causing you the error mentioned above) and cordova v7+

Build Steps on a Mac:

1. in the mac terminal type:  cordova build android --release

2. Copy Keystore/Keytool for production to build apk folder (You can read about how to create keystore on ionic documentation)

(Edit: cd into the platforms/android/build/outputs/apk directory via the terminal then... )

3. in the terminal type:  jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore NAME.keystore android-release-unsigned.apk ALIAS

> jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore RELEASE.keystore android-release-unsigned.apk RELEASE

4. zipalign -v 4 android-release-unsigned.apk signed-01-release.apk
> /Users/donwong15/Library/Android/sdk/build-tools/26.0.2/zipalign -v 4 android-release-unsigned.apk signed-01-release.apk

You may need to install jarsigner and zipalign if you don’t have it.