I used to build and run my project with no problems. But, now I have this error eevry time 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.2\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.
My Android SDK is updated, and so is ionic.
Any suggestions?
Set environment variable like this in Environment variable
ANDROID_HOME= E:\sdk
JAVA_HOME= C:\Program Files\Java\ jdk
PATH = %PATH%;%ANDROID_HOME%\build-tools\23.0.1;%ANDROID_HOME%\platform-tools;%ANDROID_HOME%\tools;C:\Users\userXYZ\AppData\Roaming\npm
Related
I am trying to build an android apk, when I run the app or flutter build apk the following error occurs, i'm using flutter 3.0.5.
💪 Building with sound null safety 💪
FAILURE: Build failed with an exception.
* Where:
Script '/Users/edgar/Documents/tools/flutter-35/packages/flutter_tools/gradle/flutter.gradle' line: 1156
* What went wrong:
Execution failed for task ':app:compileFlutterBuildRelease'.
> Process 'command '/Users/edgar/Documents/tools/flutter-35/bin/flutter'' 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. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 45s
Running Gradle task 'assembleRelease'... 47,0s
Gradle task assembleRelease failed with exit code 1
Building with sound null safety
Codepoint 984652 not found in font, aborting.
FAILURE: Build failed with an exception.
Where:
Script 'C:\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1102
What went wrong:
Execution failed for task ':app:compileFlutterBuildRelease'.
Process 'command 'C:\flutter\bin\flutter.bat'' 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. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 41s
Running Gradle task 'assembleRelease'... 46.1s
Gradle task assembleRelease failed with exit code 1
try building your application with this flutter build apk --no-tree-shake-icons
There is an issue with icons in Flutter 2.10.0 which causes this error. I am assuming that you are using 2.10.0 version of Flutter.
This issue is resolved in Flutter 2.10.2. So, run Flutter upgrade in the terminal to solve the problem.
> Task :app:bundleReleaseJsAndAssets FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:bundleReleaseJsAndAssets'.
> Process 'command 'npx.cmd'' 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. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 1m 33s
1 actionable task: 1 executed
It seems it's a problem with your build.gradle version at root :
1-Open Android Studio
2-Open the android folder of you project
3-android studio will upgrade the gradle version automatically (make sure it does)
4-try again to generate apk
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 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?