Greetings friends, I have a problem with apache cordova
building my application. I am using ubuntu 16.04 LTS 32 bits
I have been able to investigate the matter and I have found that there are similar problems in this version of ubuntu
, the version of cordova that I use is 6.3.0 the tools necessary to build this type of applications are the following and with their respective version:
nodejs version 4.2.6 apache ant
version 1.9.6 java-8-openjdk-i386 SDK manager rev 25.1.7 Android SDK tools version 25.1.7 Android SDK platform-tools version 24.0.1 Android SDK build-tools 24.0. 1 Android 6.0 (API 23) Extras Google repository and Android support repository
Environment variables from the "SDK" location:~/.bashrc
export PATH=$PATH:/opt/android/sdk/platform-tools
export PATH=$PATH:/opt/android/sdk/tools
When executing the command
:~/cordovaApp$ cordova build android
As a result I get the error
ANDROID_HOME=/opt/android/sdk
JAVA_HOME=/usr/lib/jvm/java-8-openjdk-i386
Incremental java compilation is an incubating feature.
:preBuild UP-TO-DATE
:preDebugBuild UP-TO-DATE
:checkDebugManifest
:CordovaLib:preBuild UP-TO-DATE
:CordovaLib:preDebugBuild UP-TO-DATE
:CordovaLib:compileDebugNdk UP-TO-DATE
:CordovaLib:compileLint
:CordovaLib:copyDebugLint UP-TO-DATE
:CordovaLib:mergeDebugProguardFiles UP-TO-DATE
:CordovaLib:packageDebugRenderscript UP-TO-DATE
:CordovaLib:checkDebugManifest
:CordovaLib:prepareDebugDependencies
:CordovaLib:compileDebugRenderscript UP-TO-DATE
:CordovaLib:generateDebugResValues UP-TO-DATE
:CordovaLib:generateDebugResources UP-TO-DATE
:CordovaLib:packageDebugResources UP-TO-DATE
:CordovaLib:compileDebugAidl UP-TO-DATE
:CordovaLib:generateDebugBuildConfig UP-TO-DATE
:CordovaLib:mergeDebugShaders UP-TO-DATE
:CordovaLib:compileDebugShaders UP-TO-DATE
:CordovaLib:generateDebugAssets UP-TO-DATE
:CordovaLib:mergeDebugAssets UP-TO-DATE
:CordovaLib:processDebugManifest UP-TO-DATE
:CordovaLib:processDebugResources FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':CordovaLib:processDebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/opt/android/sdk/build-tools/24.0.1/aapt'' finished with non-zero exit value 2
* 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: 11.157 secs
Error: /home/ricar1997/cordovaApp/platforms/android/gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
Anyone who has the same problem in ubuntu 16.04
would be very helpful if you could find the solution to this issue.
Your error message is:
Now that I read your question carefully I see that you use
In Android Studio I had the same problem with build-tools 24.0.1 I had to change the configuration in
build.gradle
to version 23.0.3, set a version of Build-tools and platform-tools to a version before 24.0.1 for example 23.0 .1 or 21.0.3 (it seems to me it is the previous one).and try again, comment results.
Update:
As we can deduce, this problem occurs when switching to Android SDK build-tools 24.0+, it is generated because this version requires Java 8.0. If we do not have this version of Java, this problem occurs, without a doubt in the not too distant future we will need to update.
In fact, until today, August 12, 2016, version 24.0+ is not registered on the SDK Build Tools release page , the latest is
Less than a month ago I posted a question that referred to exactly the same as this question, but nobody answered me, thank you very much Elenasys I had the same problem and I was able to solve it thanks to your answer, in my case I also use cordova and I don't know use gradle a lot, so I don't know how to configure it, I looked in the build.gradle file as you said and it's not very clear which is the version of the build-tools that gradle actually uses or at least I couldn't define which was the version in that file, but in that file it does say in the comments that a version of build-tools higher than
19.x.x
, even in the documentation of the cordova website it also says the same thing, so the solution I got was to uninstallsdk-android
the versions24.x.x
and install the23.0.3
which is the immediate lower version of build-tools and that was the solution to the problem, now when I compile withcordova build android
everything it works great. So namesake Ricardo Moreno, try what I did to see if it works for you! Cheers!