How can I find the cause of this Cordova build error?

This is my build command :

meteor build /tmp/buildMeteor/mmks --debug    --server=yourhost.yourpublic.work >  /tmp/log/build.log 

The --debug switch does not seem to have any effect.

My build log stdout looks like this :

ANDROID_HOME=/home/you/.android/android-sdk-linux
JAVA_HOME=/usr/lib/jvm/java-7-oracle
:cdvCreateAssetManifest UP-TO-DATE
:preBuild UP-TO-DATE
:preReleaseBuild UP-TO-DATE
:checkReleaseManifest
:CordovaLib:preBuild UP-TO-DATE
:CordovaLib:preReleaseBuild UP-TO-DATE
:CordovaLib:compileReleaseNdk UP-TO-DATE
:CordovaLib:compileLint
:CordovaLib:copyReleaseLint UP-TO-DATE
:CordovaLib:mergeReleaseProguardFiles UP-TO-DATE
:CordovaLib:packageReleaseRenderscript UP-TO-DATE
:CordovaLib:checkReleaseManifest
:CordovaLib:prepareReleaseDependencies
:CordovaLib:compileReleaseRenderscript UP-TO-DATE
:CordovaLib:generateReleaseResValues UP-TO-DATE
:CordovaLib:generateReleaseResources UP-TO-DATE
:CordovaLib:packageReleaseResources UP-TO-DATE
:CordovaLib:compileReleaseAidl UP-TO-DATE
:CordovaLib:generateReleaseBuildConfig UP-TO-DATE
:CordovaLib:generateReleaseAssets UP-TO-DATE
:CordovaLib:mergeReleaseAssets UP-TO-DATE
:CordovaLib:processReleaseManifest UP-TO-DATE
:CordovaLib:processReleaseResources FAILED

BUILD FAILED

Total time: 4.949 secs

. . . while the stderr of the build looks like this . . .

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':CordovaLib:processReleaseResources'.
> A problem occurred starting process 'command '/home/you/.android/android-sdk-linux/build-tools/23.0.1/aapt''

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
=> Errors executing Cordova commands:

   While building Cordova app for platform Android:
   Error code 1 for command:
   /home/you/projects/mmks/.meteor/local/cordova-build/platforms/android/gradlew
   with args:
   cdvBuildRelease,-b,/home/you/projects/mmks/.meteor/local/cordova-build/platforms/android/build.gradle,-Dorg.gradle.daemon=true,-Pandroid.useDeprecatedNdk=true

My questions :

  1. Is this a known bug?
  2. Is the error emitted by Meteor or Gradle or Cordova or android-sdk or something else?
  3. How do I set the option --info or --debug so that it gets through to the execution arguments of the tool that emitted it?
1 Like

running into similar error , did you find a fix for the problem ?

Yeah I did! :slight_smile:
You wonā€™t like it, much! :unamused:

If you pick through this code, you might find an answer.

It worked a month ago. The problem was incompatibility between versions of Googleā€™s build tools (they donā€™t make it easy).

If you are comfy with bash, you should be able to figure out what I was doing.

I have exactly the same error but i donā€™t understand how to correct it, does anyone find a solution ?

Did the Linux shell script I mention above specifically not work for you?

If you have not tried it, I expect youā€™ll find what you need in the three functions :

  1. PrepareAndroidSDK,
  2. PrepareToBuildAndroidAPK
  3. BuildAndroidAPK

ā€¦in the file Automated Deployment Functions

Hello thanks for ur answer, i tried to download the script and makes it executables but nothing start. So im stuck with same problem :

meteor build android --server localhost
                                              
WARNING: The output directory is under your source tree.
         Your generated files may get interpreted as source code!
         Consider building into a different directory instead
         meteor build ../output
                                              
ANDROID_HOME=/home/yoann/Android/Sdk         \
JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
   Building Cordova app for Android          -                       
:preBuild
:preReleaseBuild
:checkReleaseManifest
:CordovaLib:preBuild UP-TO-DATE
:CordovaLib:preReleaseBuild UP-TO-DATE
 UP-TO-DATE Cordova app for Android          -                             
:CordovaLib:compileLint
:CordovaLib:copyReleaseLint UP-TO-DATE
:CordovaLib:mergeReleaseProguardFiles UP-TO-DATE
:CordovaLib:packageReleaseRenderscript UP-TO-DATE
:CordovaLib:checkReleaseManifest
:CordovaLib:prepareReleaseDependencies
:CordovaLib:compileReleaseRenderscript UP-TO-DATE
:CordovaLib:generateReleaseResValues UP-TO-DATE
:CordovaLib:generateReleaseResources UP-TO-DATE
:CordovaLib:packageReleaseResources UP-TO-DATE
:CordovaLib:compileReleaseAidl UP-TO-DATE
:CordovaLib:generateReleaseBuildConfig UP-TO-DATE
:CordovaLib:generateReleaseAssets UP-TO-DATE
:CordovaLib:mergeReleaseAssets UP-TO-DATE
:CordovaLib:processReleaseManifest UP-TO-DATE
:CordovaLib:processReleaseResources UP-TO-DATE
:CordovaLib:generateReleaseSources UP-TO-DATE
:CordovaLib:compileReleaseJavaWithJavac UP-TO-DATE
:CordovaLib:processReleaseJavaRes UP-TO-DATE
:CordovaLib:transformResourcesWithMergeJavaResForRelease UP-TO-DATE
:CordovaLib:transformClassesAndResourcesWithSyncLibJarsForRelease UP-TO-DATE
:CordovaLib:mergeReleaseJniLibFolders UP-TO-DATE
:CordovaLib:transformNative_libsWithMergeJniLibsForRelease UP-TO-DATE
:CordovaLib:transformNative_libsWithSyncJniLibsForRelease UP-TO-DATE
:CordovaLib:bundleRelease UP-TO-DATE
:prepareAndroidCordovaLibUnspecifiedReleaseLibrary UP-TO-DATE
:prepareReleaseDependencies
:compileReleaseAidl UP-TO-DATE
:compileReleaseRenderscript UP-TO-DATE
:generateReleaseBuildConfig UP-TO-DATE
:generateReleaseAssets UP-TO-DATE
:mergeReleaseAssets
:generateReleaseResValues UP-TO-DATE
:generateReleaseResources UP-TO-DATE
:mergeReleaseResources UP-TO-DATE
:processReleaseManifest UP-TO-DATE
 FAILEDding Cordova app for Android          -                        

FAILURE: Build failed with an exception.
   Building Cordova app for Android          \
* What went wrong:
Execution failed for task ':processReleaseResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/home/yoann/Android/Sdk/build-tools/24.0.3/aapt'' finished with non-zero exit value 1

* 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: 1.879 secs
=> Errors executing Cordova commands:         
                                              
   While building Cordova app for platform Android:
   Error code 1 for command: /home/yoann/webdev/legoutdessaisons/.meteor/local/cordova-build/platforms/android/gradlew with
   args:
   cdvBuildRelease,-b,/home/yoann/webdev/legoutdessaisons/.meteor/local/cordova-build/platforms/android/build.gradle,-Dorg.gradle.daemon=true,-Pandroid.useDeprecatedNdk=true

Yeah, I was not suggesting you try to run the scripts as is. Rather that you read through them to see the steps required.

Iā€™m fairly sure your problem is versions incompatibilities. That script worked for me, so Iā€™m confident the versions used are correct.

Oups, sorry itā€™s a bit hard for me to find what happens here but i will try to read ur codeā€¦thx

If you have questions, donā€™t be shy about asking.

The problem is that i donā€™t even know what to look forā€¦iā€™m stuck with this problem seems itā€™s related with gradle but im not sure. My app is working well when i launch it by just typing ā€œmeteorā€, i was also able to deploy it on a server with mup, but now itā€™s impossible to make an apk, there are not much tutos about this part of the process, so i have still this for now

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':processReleaseResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/home/yoann/Android/Sdk/build-tools/24.0.3/aapt'' finished with non-zero exit value 1

* 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: 2.457 secs
=> Errors executing Cordova commands:         
                                              
   While building Cordova app for platform Android:
   Error code 1 for command:                  
   /home/yoann/webdev/legoutdessaisons/.meteor/local/cordova-build/platforms/android/gradlew
   with args:
   cdvBuildRelease,-b,/home/yoann/webdev/legoutdessaisons/.meteor/local/cordova-build/platforms/android/build.gradle,-Dorg.gradle.daemon=true,-Pandroid.useDeprecatedNdk=true

In some posts i can read that it could be a mismatch in sdk version in the build.graddle file, any idea where i can edit this file ?

From what I can see you have not yet tried changing your version numbers . In this line I see you are still using ā€˜24.0.3ā€™, as you were two days ago ::

    com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/home/yoann/Android/Sdk/build-tools/24.0.3/aapt'' finished with non-zero exit value 1

I do not use 24.0.3 in my script. What makes you think it will work for you?

My script has :

export SDK_TOOLS_ZIP="tools_r24.4.1-linux.zip";
export BUILD_TOOLS_VERSION=23.0.3;
export PLATFORM_TOOLS_VERSION=24.0.2;

echo -e "getPlugin \"Android SDK Platform-tools, revision ${PLATFORM_TOOLS_VERSION}\" ${ANDROID_HOME}/platform-tools/adb;";
getPlugin "Android SDK Platform-tools, revision ${PLATFORM_TOOLS_VERSION}" ${ANDROID_HOME}/platform-tools/adb;

# 4
echo -e "getPlugin \"Android SDK Build-tools, revision ${BUILD_TOOLS_VERSION}\" ${ZIPALIGN_PATH}/zipalign;";
getPlugin "Android SDK Build-tools, revision ${BUILD_TOOLS_VERSION}" ${ZIPALIGN_PATH}/zipalign;

# 25
getPlugin "SDK Platform Android 6.0, API 23, revision 3" ${ANDROID_HOME}/platforms/android-23/android.jar;

# 26
getPlugin "SDK Platform Android 5.1.1, API 22, revision 2" ${ANDROID_HOME}/platforms/android-22/android.jar;

im a bit lost here i donā€™t know where to change those version number in factā€¦

Part of the issue may be that I am not following Meteorā€™s ( skimpy ! ) explanations. They say to install the whole SDK, but I wanted a pure command line solution.

If you are not comfortable with Linux command line and bash in particular, I have pretty much reached the limit of being able to help you. On the other hand, if you are willing to pick through my function : PrepareAndroidSDK() I am sure you will find all you need.

Some hints :

  • Download a file

    wget

  • Extract compressed contents of a file

    unzip

  • Generate a list of all plugins in the SDK

    ${ANDROID_HOME}/tools/android list sdk -u -a;

  • Add a plugin to your development environment

    ${ANDROID_HOME}/tools/android update sdk -u -a --filter ${PLUGIN_NUM};

1 Like

i thought it would need less battle to get an apk working with meteor, i opened a topic for my problem or i will soon change frameworkā€¦ Need help for building my apk with meteor 1.4 (resolved) thx for ur help anyway.

1 Like

I am seeing something like the below error-

BUILD SUCCESSFUL in 21s
1 actionable task: 1 executed
Subproject Path: CordovaLib Android
Subproject Path: app
Starting a Gradle Daemon, 3 incompatible Daemons could not be reused, use --status for details

Task :CordovaLib:compileReleaseRenderscript FAILED

FAILURE: Build failed with an exception.
Building Cordova app for Android |

  • What went wrong:
    Execution failed for task ā€˜:CordovaLib:compileReleaseRenderscriptā€™.

Could not resolve all files for configuration ā€˜:CordovaLib:releaseCompileClasspathā€™.
Could not resolve androidx.appcompat:appcompat:1.3.1.
Required by:
project :CordovaLib
Could not resolve androidx.appcompat:appcompat:1.3.1.
Could not get resource ā€˜https://dl.google.com/dl/android/maven2/androidx/appcompat/appcompat/1.3.1/appcompat-1.3.1.pomā€™.
Could not GET ā€˜https://dl.google.com/dl/android/maven2/androidx/appcompat/appcompat/1.3.1/appcompat-1.3.1.pomā€™.
Connection reset
Could not resolve androidx.appcompat:appcompat:1.3.1.
Could not get resource ā€˜https://dl.google.com/dl/android/maven2/androidx/appcompat/appcompat/1.3.1/appcompat-1.3.1.pomā€™.
Could not GET ā€˜https://dl.google.com/dl/android/maven2/androidx/appcompat/appcompat/1.3.1/appcompat-1.3.1.pomā€™.
Connection reset
Could not resolve androidx.webkit:webkit:1.4.0.
Required by:
project :CordovaLib
Could not resolve androidx.webkit:webkit:1.4.0.
Could not get resource ā€˜https://dl.google.com/dl/android/maven2/androidx/webkit/webkit/1.4.0/webkit-1.4.0.pomā€™.
Could not GET ā€˜https://dl.google.com/dl/android/maven2/androidx/webkit/webkit/1.4.0/webkit-1.4.0.pomā€™.
Connection reset
Could not resolve androidx.webkit:webkit:1.4.0.
Could not get resource ā€˜https://dl.google.com/dl/android/maven2/androidx/webkit/webkit/1.4.0/webkit-1.4.0.pomā€™.
Could not GET ā€˜https://dl.google.com/dl/android/maven2/androidx/webkit/webkit/1.4.0/webkit-1.4.0.pomā€™.
Connection reset

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

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

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use ā€˜ā€“warning-mode allā€™ to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See Command-Line Interface

BUILD FAILED in 34s
5 actionable tasks: 5 executed
=> Errors executing Cordova commands:

While building Cordova app for platform Android:
Error: Command failed with exit code 1: D:\Projects\meteor\logic.meteor\local\cordova-build\platforms\android\gradlew
:app:bundleRelease -b D:\Projects\meteor\logic.meteor\local\cordova-build\platforms\android\build.gradle
at makeError
(C:\Users\User\AppData\Local.meteor\packages\meteor-tool\2.12.0\mt-os.windows.x86_64\dev_bundle\lib\node_modules\cordova-android\node_modules\execa\lib\error.js:60:11)
at handlePromise
(C:\Users\User\AppData\Local.meteor\packages\meteor-tool\2.12.0\mt-os.windows.x86_64\dev_bundle\lib\node_modules\cordova-android\node_modules\execa\index.js:118:26)
at runMicrotasks ()
at processTicksAndRejections (internal/process/task_queues.js:95:5)
=> awaited here:
at Function.Promise.await
(C:\Users\User\AppData\Local.meteor\packages\meteor-tool\2.12.0\mt-os.windows.x86_64\dev_bundle\lib\node_modules\meteor-promise\promise_server.js:56:12)
at C:\tools\cordova\project.js:325:7
at
C:\Users\User\AppData\Local.meteor\packages\meteor-tool\2.12.0\mt-os.windows.x86_64\dev_bundle\lib\node_modules\meteor-promise\fiber_pool.js:43:40
=> awaited here:
at Function.Promise.await
(C:\Users\User\AppData\Local.meteor\packages\meteor-tool\2.12.0\mt-os.windows.x86_64\dev_bundle\lib\node_modules\meteor-promise\promise_server.js:56:12)
at CordovaProject.runCommands (C:\tools\cordova\project.js:896:22)
at CordovaProject.buildForPlatform (C:\tools\cordova\project.js:323:10)
at C:\tools\cli\commands.js:1243:30
at Object.enterJob (C:\tools\utils\buildmessage.js:388:12)
at C:\tools\cli\commands.js:1226:22
at Object.capture (C:\tools\utils\buildmessage.js:283:5)
at Object.main.captureAndExit (C:\tools\cli\main.js:281:29)
at buildCommand (C:\tools\cli\commands.js:1201:10)
at C:\tools\cli\commands.js:988:25
at Function.run
(C:\Users\User\AppData\Local.meteor\packages\meteor-tool\2.12.0\mt-os.windows.x86_64\tools\tool-env\tools\tool-env\profile.ts:289:14)
at C:\tools\cli\commands.js:986:18
at
C:\Users\User\AppData\Local.meteor\packages\meteor-tool\2.12.0\mt-os.windows.x86_64\dev_bundle\lib\node_modules\meteor-promise\fiber_pool.js:43:40
PS D:\Projects\meteor\logic> meteor add cordova-plugin-geolocation@2.4.3
=> Errors while parsing arguments:

While adding package cordova-plugin-geolocation@2.4.3:
error: no such package

PS D:\Projects\meteor\logic> meteor add cordova-plugin-geolocation@2.4.3
=> Errors while parsing arguments:

While adding package cordova-plugin-geolocation@2.4.3:
error: no such package