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


#1

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?

#2

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


#3

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.


#4

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


#5

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


#6

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


#7

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.


#8

Oups, sorry it’s a bit hard for me to find what happens here but i will try to read ur code…thx


#9

If you have questions, don’t be shy about asking.


#10

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


#11

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 ?


#12

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;

#13

im a bit lost here i don’t know where to change those version number in fact…


#14

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.


#15

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


#16

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.