I am trying to build an APK for android, and it keeps giving me the following error. I tried everything out there online and never worked. Please help.
BUILD FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ‘:transformClassesWithJarMergingForDebug’.
com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: org/apache/cordova/PermissionHelper.class
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Total time: 1 mins 51.939 secs
Error: cmd: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ‘:transformClassesWithJarMergingForDebug’.
com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: org/apache/cordova/PermissionHelper.class
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
[ERROR] An error occurred while running cordova build android (exit code 1).
Related
I'm trying to build an Android version of a "blank" project with IONIC, now i'm stuck with this error. Has anyone experienced this before, and what would your answer be?
FAILED
BUILD FAILED
Total time: 2.179 secs
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':CordovaLib: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.
Error: cmd: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':CordovaLib: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.
[ERROR] An error occurred while running cordova build android (exit code 1).
The way i solved this problem is as below:
npm uninstall cordova ionic
npm install -g cordova#7.0.0 ionic#3.19.0
cordova platform rm android
cordova platform add android
I have installed Cordova but when I run $ cordova build in the terminal, it shows the following error. Please help me out.
BUILD FAILED
Total time: 8.645 secs
Error: /home/borsha/hello/platforms/android/gradlew: Command failed with exit code 1 Error output:
/home/borsha/hello/android-sdk-linux/build-tools/26.0.1/aapt: 1: /home/borsha/hello/android-sdk-linux/build-tools/26.0.1/aapt: Syntax error: ")" unexpected
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':CordovaLib: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.
UPDATE
BUILD FAILED
Total time: 2.799 secs
Error: /home/borsha/hello/platforms/android/gradlew: Command failed with exit code 1 Error output:
/home/borsha/hello/android-sdk-linux/build-tools/25.0.0/aapt: 3: /home/borsha/hello/android-sdk-linux/build-tools/25.0.0/aapt: Syntax error: Unterminated quoted string
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':CordovaLib: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.
Try downgrading API level to 23.0.3. You can do that using Android SDK Manager and Android Studio or you can follow the instructions here.
Versions newer than 23.0.3 still have bugs.
Can anyone helep me on this while running below command build fails
gradle assembleRelease crashlyticsUploadDistributionRelease
FAILURE: Build failed with an exception.
Where:
Build file '/home/ubuntu/clarks-select-android/app/build.gradle' line: 10
What went wrong:
A problem occurred evaluating project ':app'.
org/gradle/initialization/BuildCompletionListener
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: 10.322 secs
I have been having this problem for a while now and i tried all the solutions on the internet but none of them helped.
I have this error whenever I run : Ionic run android:
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':processDebugResources'.
com.android.ide.common.process.ProcessException: org.gradle.process.internal.E
xecException: Process 'command 'C:\Users\hamiri\AppData\Local\Android\sdk\build-
tools\23.0.3\aapt.exe'' 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.
When running gradlew.bat --info build clean:
FAILURE: Build failed with an exception.
Where:
Script 'D:\HomeTest\platforms\android\CordovaLib\cordova.gradle' line: 117
What went wrong:
A problem occurred evaluating root project 'android'.
Unable to determine Android SDK directory.
I made sure to verify tools\23.0.3\aapt.exe is there.
Anybody can help me fix this?
I need to load html file in webview, but this html contains a lot of scripts and other resourses. So i put my index.html and two folders with resourses to my assets folder. Now when i'm trying to build my project i got this error:
:app:packageDebug FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:packageDebug'.
> Failed to add E:\Projects\PressurIce\app\build\intermediates\resources\resources-debug.ap_
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
The first question is: anybody know what does it mean ?
The second question is: how can i do this thing:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
to see more logs ? Thx.
UPDATE 1
Run with --stacktrace give more info:
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:packageDebug'.
Caused by: com.android.builder.packaging.PackagerException: Failed to add E:\Projects\PressurIce\app\build\intermediates\resources\resources-debug.ap_
at com.android.builder.internal.packaging.Packager.addZipFile(Packager.java:422)
at com.android.builder.internal.packaging.Packager.<init>(Packager.java:307)
at com.android.builder.core.AndroidBuilder.packageApk(AndroidBuilder.java:1474)
at com.android.builder.core.AndroidBuilder$packageApk$4.call(Unknown Source)
at com.android.build.gradle.tasks.PackageApplication.doFullTaskAction(PackageApplication.groovy:97)
... 63 more
Caused by: java.util.zip.ZipException: invalid code lengths set
at com.android.builder.signing.SignedJarBuilder.writeEntry(SignedJarBuilder.java:343)
at com.android.builder.signing.SignedJarBuilder.writeZip(SignedJarBuilder.java:274)
at com.android.builder.internal.packaging.Packager.addZipFile(Packager.java:416)
... 67 more