What went wrong: Execution failed for task ':app:packageRelease'

Hello everyone,

I am trying to build my android release at the moment with this command:

ionic cordova build android --release --prod

I am getting this error:

* What went wrong: Execution failed for task ':app:packageRelease'.
> value (66186) > 0x0000ffff

Everything was working just fine last week. I am not quite sure what has changed that is making it so this no longer builds.

The build hangs for four minutes on:

UP-TO-DATE

:app:packageRelease

And then it fails:

FAILED

45 actionable tasks: 1 executed, 44 up-to-date

Anyone run into this before?

I am at a loss on what to do.

Thanks!

What is your ionic info output?

The Ionic CLI has an update available (3.20.0 => 4.1.2)!

[WARN] No write permissions for global node_modules--automatic CLI updates are 

       disabled.
       To fix, see https://docs.npmjs.com/getting-started/fixing-npm-permissions
       
       Or, install the CLI update manually:
       
       npm i -g ionic@latest
       


cli packages: (/usr/local/lib/node_modules)

    @ionic/cli-utils  : 1.19.2
    ionic (Ionic CLI) : 3.20.0

global packages:

    cordova (Cordova CLI) : 8.0.0 

local packages:

    @ionic/app-scripts : 3.1.8
    Cordova Platforms  : android 7.0.0 browser 5.0.3 ios 4.5.4
    Ionic Framework    : ionic-angular 3.9.2

System:

    Android SDK Tools : 26.1.1
    ios-deploy        : 1.9.2 
    Node              : v6.9.1
    npm               : 3.10.8 
    OS                : macOS High Sierra
    Xcode             : Xcode 9.4.1 Build version 9F2000 

Environment Variables:

    ANDROID_HOME : /Users/aabdolla/Library/Android/sdk

Misc:

    backend : pro

So actually I have figured out what has started giving me this error but I am not sure on the solution to it.

So my app is a leaflet map, and the map is comprised of a bunch of images for each tile on each layer. I did make the map higher fidelity so there are way more files now. The app builds with the old amount of images and gives me this error with the new amount of images which is a lot more.

The building of the ios version builds just fine. It’s only the android version that seems to freak out about the amount of files.

Does that help trigger any thoughts on a solution for anyone?

Thanks again!

Your Cordova tooling seems to be out of date, which might be causing all kinds of problems.
You can read about how to figure out the current Cordova versions and how to update CLI, platforms and plugins here: https://ionic.zone/cordova/update

Share the complete build output - maybe there is something else useful.

Thank you for the replies :slight_smile:

This is the output after a cordova build android --verbose:

No scripts found for hook "before_build".
No scripts found for hook "before_prepare".
Checking config.xml and package.json for saved platforms that haven't been added to the project
Config.xml and package.json platforms are the same. No pkg.json modification.
Package.json and config.xml platforms are different. Updating config.xml with most current list of platforms.
PlatformApi successfully found for platform android
Android Studio project detected
Checking config.xml for saved plugins that haven't been added to the project
Checking for any plugins added to the project that have not been installed in android platform
No differences found between plugins added to project and installed in android platform. Continuing...
Generating platform-specific config.xml from defaults for android at /Users/aabdolla/Documents/rarethief_sot_map_app/IonicSoTCompanion_Android/platforms/android/app/src/main/res/xml/config.xml
Merging project's config.xml into platform-specific android config.xml
Merging and updating files from [www, platforms/android/platform_www] to platforms/android/app/src/main/assets/www
Wrote out android application name "SoT Companion" to /Users/aabdolla/Documents/rarethief_sot_map_app/IonicSoTCompanion_Android/platforms/android/app/src/main/res/values/strings.xml
Wrote out Android package name "com.rarethief.sotcompanion" to /Users/aabdolla/Documents/rarethief_sot_map_app/IonicSoTCompanion_Android/platforms/android/app/src/main/java/com/rarethief/sotcompanion/MainActivity.java
Updating icons at platforms/android/app/src/main/res
Updating splash screens at platforms/android/app/src/main/res
This app does not have additional resource files defined
Prepared android project successfully
No scripts found for hook "after_prepare".
No scripts found for hook "before_compile".
ANDROID_HOME=/Users/aabdolla/Library/Android/sdk
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home
studio
Subproject Path: CordovaLib
Subproject Path: app
Running command: /Users/aabdolla/Documents/rarethief_sot_map_app/IonicSoTCompanion_Android/platforms/android/gradlew cdvBuildDebug -b /Users/aabdolla/Documents/rarethief_sot_map_app/IonicSoTCompanion_Android/platforms/android/build.gradle -Dorg.gradle.daemon=true -Dorg.gradle.jvmargs=-Xmx2048m -Pandroid.useDeprecatedNdk=true
Starting a Gradle Daemon (subsequent builds will be faster)
publishNonDefault is deprecated and has no effect anymore. All variants are now published.
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_cfmc1lssw3fv77gexjziphz26.run(/Users/aabdolla/Documents/rarethief_sot_map_app/IonicSoTCompanion_Android/platforms/android/app/build.gradle:143)
Configuration 'compile' in project ':app' is deprecated. Use 'implementation' instead.
:CordovaLib:preBuild UP-TO-DATE
:CordovaLib:preDebugBuild UP-TO-DATE
:CordovaLib:compileDebugAidl UP-TO-DATE
:CordovaLib:compileDebugRenderscript UP-TO-DATE
:CordovaLib:checkDebugManifest UP-TO-DATE
:CordovaLib:generateDebugBuildConfig UP-TO-DATE
:CordovaLib:prepareLintJar UP-TO-DATE
:CordovaLib:generateDebugResValues UP-TO-DATE
:CordovaLib:generateDebugResources UP-TO-DATE
:CordovaLib:packageDebugResources UP-TO-DATE
:CordovaLib:platformAttrExtractor UP-TO-DATE
:CordovaLib:processDebugManifest UP-TO-DATE
:CordovaLib:processDebugResources UP-TO-DATE
:CordovaLib:generateDebugSources UP-TO-DATE
:CordovaLib:javaPreCompileDebug UP-TO-DATE
:CordovaLib:compileDebugJavaWithJavac UP-TO-DATE
:CordovaLib:processDebugJavaRes NO-SOURCE
:CordovaLib:transformClassesAndResourcesWithPrepareIntermediateJarsForDebug UP-TO-DATE
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:compileDebugAidl UP-TO-DATE
:CordovaLib:packageDebugRenderscript NO-SOURCE
:app:compileDebugRenderscript UP-TO-DATE
:app:checkDebugManifest UP-TO-DATE
:app:generateDebugBuildConfig
:app:prepareLintJar UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources
:app:createDebugCompatibleScreenManifests
:app:processDebugManifest
:app:splitsDiscoveryTaskDebug UP-TO-DATE
:app:processDebugResources
:app:generateDebugSources
:app:javaPreCompileDebug UP-TO-DATE
:app:compileDebugJavaWithJavacNote: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /Users/aabdolla/Documents/rarethief_sot_map_app/IonicSoTCompanion_Android/platforms/android/app/src/main/java/org/apache/cordova/file/AssetFilesystem.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

:app:compileDebugNdk NO-SOURCE
:app:compileDebugSources
:CordovaLib:mergeDebugShaders UP-TO-DATE
:CordovaLib:compileDebugShaders UP-TO-DATE
:CordovaLib:generateDebugAssets UP-TO-DATE
:CordovaLib:mergeDebugAssets UP-TO-DATE
:app:mergeDebugShaders UP-TO-DATE
:app:compileDebugShaders UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets
:app:extractTryWithResourcesSupportJarDebug UP-TO-DATE
:app:transformClassesWithStackFramesFixerForDebug
:app:transformClassesWithDesugarForDebug
:app:transformClassesWithDexBuilderForDebug
:app:transformDexArchiveWithExternalLibsDexMergerForDebug
:app:transformDexArchiveWithDexMergerForDebug
:CordovaLib:compileDebugNdk NO-SOURCE
:CordovaLib:mergeDebugJniLibFolders UP-TO-DATE
:CordovaLib:transformNativeLibsWithMergeJniLibsForDebug UP-TO-DATE
:CordovaLib:transformNativeLibsWithIntermediateJniLibsForDebug UP-TO-DATE
:app:mergeDebugJniLibFolders UP-TO-DATE
:app:transformNativeLibsWithMergeJniLibsForDebug UP-TO-DATE
:app:processDebugJavaRes NO-SOURCE
:app:transformResourcesWithMergeJavaResForDebug UP-TO-DATE
:app:validateSigningDebug
:app:packageDebug FAILED
47 actionable tasks: 14 executed, 33 up-to-date

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:packageDebug'.
> value (66135) > 0x0000ffff

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

* Get more help at https://help.gradle.org

BUILD FAILED in 2m 39s
Command finished with error code 1: /Users/aabdolla/Documents/rarethief_sot_map_app/IonicSoTCompanion_Android/platforms/android/gradlew cdvBuildDebug,-b,/Users/aabdolla/Documents/rarethief_sot_map_app/IonicSoTCompanion_Android/platforms/android/build.gradle,-Dorg.gradle.daemon=true,-Dorg.gradle.jvmargs=-Xmx2048m,-Pandroid.useDeprecatedNdk=true
(node:9208) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: /Users/aabdolla/Documents/rarethief_sot_map_app/IonicSoTCompanion_Android/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: /Users/aabdolla/Documents/rarethief_sot_map_app/IonicSoTCompanion_Android/platforms/android/app/src/main/java/org/apache/cordova/file/AssetFilesystem.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:packageDebug'.
> value (66135) > 0x0000ffff

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

* Get more help at https://help.gradle.org

BUILD FAILED in 2m 39s

I will try updating my cordova in the meantime but I feel like that won’t fix the problem since it can build without all the new images I added. Who knows!

No idea what that means :confused:

1 Like

Darn, that isn’t reassuring. I just removed the android platform, re-adding it now and we will see what happens. Going from 7.0.0 to 7.1.0.

Alright, well I updated to 7.1.0 and still got the same error. Any advice on where to look into that error code/message? I can’t find it referenced anywhere.

No idea either. Two options: Look into app:packageDebug and understand what it does and where it might throw that error. Or see if your data is somehow related to the error message. Relace with different files, file sizes, one big file, etc.

Hmm, alright. When you say look into app:packageDebug, where would that be? Like is that ionic or gradle?

It definitely has something to do with the amount of files. I started back from scratch and was adding in folder by folder of images (tiles) for the map. Once I got to a certain amount I got the build error.

Is there some kind of timeout for ionic or gradle? Or maybe it is running out of memory? Very odd.

Another interesting thing. The error is:

value (66135) > 0x0000ffff

Which is:

value (66135) > 65535

So again, makes me think it has something to do with size. Hmm…

Ionic is fully out of the picture here. This is cordova executing a Gradle build, so you probably start by looking into what code there is in platforms/android.