Cordova build failed - 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.

Related

Error when version upgrade in pubspec.yaml

Flutter,android
I can't understand.
Error has occured, when I upgrading version in 'pubspec.yaml'
version: 1.0.1+2 was no problem. build done!
but, 1.0.2+3, 1.0.3+4, .. ERROR!!!! build failed!!
even though 1.0.0+1.. error too..
What should I do?
no problem
error screenshot
error info is
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> java.lang.NullPointerException (no error message)
* 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
BUILD FAILED in 13s
Finished with error: Gradle task assembleDebug failed with exit code 1

What is the real fix for this issue while building apk release in ionic?

I've got an issue while building apk --release in ionic. Gradle daemon is installed.What is the real fix for this issue while building apk release in ionic ?
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processReleaseResources'.
> Android resource linking failed
23 actionable tasks: 1 executed, 22 up-to-date
C:\ES.eWarrant\eWarrant\platforms\android\app\src\main\res\xml\authenticator.xml:2: AAPT: error: resource mipmap/icon (aka io.ionic.starter:mipmap/icon) not found.
error: failed linking file resources.
* 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
BUILD FAILED in 10s
C:\ES.eWarrant\eWarrant\platforms\android\gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processReleaseResources'.
> Android resource linking failed
C:\ES.eWarrant\eWarrant\platforms\android\app\src\main\res\xml\authenticator.xml:2: AAPT: error: resource mipmap/icon (aka io.ionic.starter:mipmap/icon) not found.
error: failed linking file resources.
* 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
BUILD FAILED in 10s
[ERROR] An error occurred while running subprocess cordova.
cordova build android --release exited with exit code 1.

Ionic Build Android

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).

Ionic Cordova Android build error

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

Ionic build failed

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?

Categories

Resources