I am getting this error when i build for android -
ionic build android
error -
`AAPT err(Facade for 259068547): libpng error: Read Error
AAPT err(Facade for 1123857185): libpng error: Read Error
AAPT err(Facade for 594029608): libpng error: Read Error
FAILED
FAILURE:
Build failed with an exception.
What went wrong:
Execution failed for task ':mergeArmv7DebugResources'.
>
Some file crunching failed, see logs for details
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: 6.193 secs
Error: Error code 1 for command: cmd with args: /s,/c,"f:\D\srcc\proj\platforms\
android\gradlew cdvBuildDebug -b f:\D\srcc\proj\platforms\android\build.gradle -
Dorg.gradle.daemon=true -Pandroid.useDeprecatedNdk=true"`
How can i find the exact error or solve this issue? Anyone please?
I also meet this build fail problem due to I run ionic resources, at this time my ionic version is 2.1.1, I find there is something wrong with one image in the path resources\android\splash incomplete image
after I run npm uninstall ionic -g and reinstall it, now version is 2.1.14, then delete the folder resources\android run ionic resources android --force and ionic build android , the problem is solved.
Related
I am getting below exception when i build my flutter project on jenkins
C:\ProgramData\Jenkins\.jenkins\workspace\automated test app>flutter build apk
Building with sound null safety
Running Gradle task 'assembleRelease'...
Parameter format not correct -
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeReleaseResources'.
> Multiple task action failures occurred:
> A failure occurred while executing
com.android.build.gradle.internal.res.Aapt2CompileRunnable
> Android resource compilation failed
ERROR:C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-3\846e5094a0f0114af067375a609d094e\transformed\core-1.6.0\res\drawable-mdpi-v4\notification_bg_normal.9.png: AAPT: error: file not found.
> A failure occurred while executing com.android.build.gradle.internal.res.Aapt2CompileRunnable
> Android resource compilation failed
ERROR:C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-3\846e5094a0f0114af067375a609d094e\transformed\core-1.6.0\res\drawable-mdpi-v4\notification_bg_low_normal.9.png: AAPT: error: file not found.
> A failure occurred while executing com.android.build.gradle.internal.res.Aapt2CompileRunnable
> Android resource compilation failed
ERROR:C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-3\846e5094a0f0114af067375a609d094e\transformed\core-1.6.0\res\drawable-mdpi-v4\notification_bg_low_pressed.9.png: AAPT: error: file not found.
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 25s
Running Gradle task 'assembleRelease'... 86.2s
Gradle task assembleRelease failed with exit code 1
Build step 'Execute Windows batch command' marked build as failure
Finished: FAILURE
I am faced with this problem with Gitlab ci/Runner on Windows 10 and i stucked with all day.
The problem is that I have not installed Gitlab-Runner with privileges windows with my user account before :
cd C:\GitLab-Runner
.\gitlab-runner.exe install
.\gitlab-runner.exe start
But after, I installed Gitlab-Runner using my user account. The problems no longer occurs.
cd C:\GitLab-Runner
.\gitlab-runner.exe install --user ".\USERR" --password "MYPASSWORD"
.\gitlab-runner.exe start
So, I think maybe your problem is that you are not running the script with a privileges.
The fact that I saw this because when I tried to access the image file.
For example : C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-3\846e5094a0f0114af067375a609d094e\transformed\core-1.6.0\res\drawable-mdpi-v4\notification_bg_normal.9.png
I'm not able to reach the "C:\Windows\System32" without accepting the privileges administrator windows.
But if I accept as administrator, I can find the image file.
I'm trying to build an Android app with android target: android-22
I also tried with android-17
but this error message appear.
:CordovaLib:compileDebugJavaWithJavacC:\Users\Luis Araujo\Desktop\myApp2\platfor
ms\android\CordovaLib\src\org\apache\cordova\CordovaInterfaceImpl.java:222:erro
r: cannot find symbol
getActivity().requestPermissions(permissions, requestCode);
^
^
* What went wrong:
Execution failed for task ':CordovaLib:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug
option to get more log output.
BUIL D FAILED
Total time: 24.973 secs
Error: Error code 1 for command: cmd with args: /s,/c,""C:\Users\Luis Araujo\Des
ktop\myApp2\platforms\android\gradlew" cdvBuildDebug -b "C:\Users\Luis Araujo\De
sktop\myApp2\platforms\android\build.gradle" -Dorg.gradle.daemon=true -Pandroid.
useDeprecatedNdk=true"
Can you help me?
I have solved this problem.
I installed API 23 of the Android SDK, and I let in the AndroidManifest.xml and the property.properties the target android-23
Then, type ionic build android and ionic run android
Hello I'm using latest version of Cordova 6.1.0 and Android SDK Tools.
when I add any admob plugins. the following error message returned after using build command.
A problem occurred configuring root project 'android'
how can I fix this?
BTW please don't send workarounds for Android Studio. I just need to be able to build APK files via cordova and I don't use Android Studio.
Full error details as following:
JAVA_HOME=C:\Program Files (x86)\java\jdk1.7.0_71
FAILURE: Build failed with an exception.
What went wrong: A problem occurred configuring root project 'android'.
Could not resolve all dependencies for configuration ':_debugCompile'.
Could not find any version that matches com.google.android.gms:play-services:+.
Searched in the following locations:
https://repo1.maven.org/maven2/com/google/android/gms/play-services/maven-metadata.xml
https://repo1.maven.org/maven2/com/google/android/gms/play-services/
Required by:
:android:unspecified
BUILD FAILED
Total time: 11.78 secs
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Error: Error code 1 for command: cmd with args:
/s,/c,"C:\nm\tests\platforms\android\gradlew cdvBuildDebug -b
C:\nm\tests\platforms\android\build.gradle -Dorg.gradle.daemon=true
-Pandroid.useDeprecatedNdk=true"
While importing a project I got the following error :
AAPT err(Facade for 3882930): libpng error: Read Error
FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':ProjectName:mergeDebugResources'.
> Some file crunching failed, see logs for details
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
I tried to clean, rebuild and also restart studio as well as my PC but no luck. Can anyone help me?
Finally i got an answer,
I took all the images an pasted them on https://tinypng.com/ and downloaded the optimized images. put them in their respective positions and Voila the error was gone.
I guess the images had corrupted as it was a 1 year old project which i was trying to import.
All the things happened after I made several commands for the ionic App with ngCordova
- ionic start "App Project Name"
- ionic platform add android
- ionic build android
:processDebugResources Unable to add '/Users/desmondlai/Desktop/hairCorner/HairProject/platforms/android/build/intermediates/assets/debug/www/node_modules/try-thread-sleep/node_modules/thread-sleep/node_modules/node-pre-gyp/node_modules/tar-pack/test/fixtures/packed.tar.gz': file already in archive (try '-u'?)
ERROR: unable to process assets while packaging '/Users/desmondlai/Desktop/hairCorner/HairProject/platforms/android/build/intermediates/res/resources-debug.ap_'
ERROR: packaging of '/Users/desmondlai/Desktop/hairCorner/HairProject/platforms/android/build/intermediates/res/resources-debug.ap_' failed
FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':processDebugResources'.
com.android.ide.common.internal.LoggedErrorException: Failed to run command:
/Users/desmondlai/Library/Android/sdk/build-tools/23.0.2/aapt package -f --no-crunch -I /Users/desmondlai/Library/Android/sdk/platforms/android-22/android.jar -M /Users/desmondlai/Desktop/hairCorner/HairProject/platforms/android/build/intermediates/manifests/full/debug/AndroidManifest.xml -S /Users/desmondlai/Desktop/hairCorner/HairProject/platforms/android/build/intermediates/res/debug -A /Users/desmondlai/Desktop/hairCorner/HairProject/platforms/android/build/intermediates/assets/debug -m -J /Users/desmondlai/Desktop/hairCorner/HairProject/platforms/android/build/generated/source/r/debug -F /Users/desmondlai/Desktop/hairCorner/HairProject/platforms/android/build/intermediates/res/resources-debug.ap_ --debug-mode --custom-package com.ionicframework.starter -0 apk --output-text-symbols /Users/desmondlai/Desktop/hairCorner/HairProject/platforms/android/build/intermediates/symbols/debug
Error Code:
1
Output:
Unable to add '/Users/desmondlai/Desktop/hairCorner/HairProject/platforms/android/build/intermediates/assets/debug/www/node_modules/try-thread-sleep/node_modules/thread-sleep/node_modules/node-pre-gyp/node_modules/tar-pack/test/fixtures/packed.tar.gz': file already in archive (try '-u'?)
ERROR: unable to process assets while packaging '/Users/desmondlai/Desktop/hairCorner/HairProject/platforms/android/build/intermediates/res/resources-debug.ap_'
ERROR: packaging of '/Users/desmondlai/Desktop/hairCorner/HairProject/platforms/android/build/intermediates/res/resources-debug.ap_' failed
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: 45.169 secs
/Users/desmondlai/Desktop/hairCorner/HairProject/platforms/android/cordova/node_modules/q/q.js:126
throw e;
^
Error code 1 for command: /Users/desmondlai/Desktop/hairCorner/HairProject/platforms/android/gradlew with args: cdvBuildDebug,-b,/Users/desmondlai/Desktop/hairCorner/HairProject/platforms/android/build.gradle,-Dorg.gradle.daemon=true
ERROR building one of the platforms: Error: /Users/desmondlai/Desktop/hairCorner/HairProject/platforms/android/cordova/build: Command failed with exit code 1
You may not have the required environment or OS to build this project
Error: /Users/desmondlai/Desktop/hairCorner/HairProject/platforms/android/cordova/build: Command failed with exit code 1
Add/remove android didn't fix the problem for me either.
Generating the project resources fixed the issue for me.
ionic resources
Add xml namespace xmlns:gap="http://phonegap.com/ns/1.0" to your config.xml
also, if you are using linux you must do "sudo chmod 755 gradlew" before you do the "./gradlew clean" to make sure it is executable
delete your icon folder splashscreen folder
then follow these commands
sudo npm install ionic-resources -g
ionic resources android