java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2InternalException - android

Error While running command :
ionic cordova build android --prod --release
It perfectly works when I use ionic cordova run android
But when I tried to create release apk for deployment it gives an error :
What went wrong: FAILED Execution failed for task ':app:mergeReleaseResources'.
java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2
aapt2-3.3.0-5013011-windows Daemon #2: Unexpected error during compile
'E:\Unnati\WorkSpace\gita\platforms\android\app\src\main\res\drawable-land-xxxhdpi\screen.png',
attempting to stop daemon. This should not happen under normal
circumstances, please file an issue if it does.
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 21s 20 actionable tasks: 1 executed, 19 up-to-date
E:\Unnati\WorkSpace\gita\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:mergeReleaseResources'.
java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2
aapt2-3.3.0-5013011-windows Daemon #2: Unexpected error during compile
'E:\Unnati\WorkSpace\gita\platforms\android\app\src\main\res\drawable-land-xxxhdpi\screen.png',
attempting to stop daemon. This should not happen under normal
circumstances, please file an issue if it does.
How to solve this?

It is solved by adding this in build.gradle:
allprojects {
// Workaround for https://issuetracker.google.com/117900475
// Remove when upgrading to AGP 3.4 or higher.
configurations.matching { it.name == '_internal_aapt2_binary' }.all { config ->
config.resolutionStrategy.eachDependency { details ->
details.useVersion("3.5.0-alpha03-5252756")
}
}
}

Related

Failed when running flutter project on Android Emulator ... I need some help to fix this please

FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:validateSigningDebug'.
java.util.concurrent.ExecutionException: com.android.builder.utils.SynchronizedFile$ActionExecutionException: java.io.IOException: com.android.ide.common.signing.KeytoolException: Failed to create keystore.
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 7m 13s
Running Gradle task 'assembleDebug'... 474.1s
Exception: Gradle task assembleDebug failed with exit code 1
I don't know what should I do for this ...
I tried many ways but doesn't work with me until now ...
I hope I find the solution ...
I think this question already exists, your key.properties file is probably the issue.
Execution failed for task ':app:validateSigningDebug'.
java.util.concurrent.ExecutionException:
com.android.builder.utils.SynchronizedFile$ActionExecutionException: java.io.IOException:
com.android.ide.common.signing.KeytoolExcepti
on: Failed to create keystore.
According to this gradle has failed to create the keystore file.this is probably due to your keystore.properties file missing. Have you signed your app? If not u can follow this guide here.

FAILURE: Execution failed for task ':app:processDebugResources'

I am getting this error while I am running app (flutter run)
event sent after app closed: {id: 0, progressId: null, message: Running "flutter pub get" in de_p_city_guide...}
event sent after app closed: {id: 0, progressId: null, finished: true}
Launching lib\main.dart on Nokia 5 3 in debug mode...
Running Gradle task 'assembleDebug'...
Plugin project :firebase_core_web not found. Please update settings.gradle.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Path 'D:\Lets_Go\de_p_city_guide\build\screen\intermediates\compiled_local_resources\debug\out' is not a readable directory.
* 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 53s
Exception: Gradle task assembleDebug failed with exit code 1
Solution I tried but didn't work :
flutter clean
File > Invalidate Caches/Restart...
Adding (org.gradle.jvmargs=-Xmx4608m) to gradle.properties
Adding to android/app/build.gradle:
android {
aaptOptions.cruncherEnabled = false
aaptOptions.useNewCruncher = false
}
I removed my cash data from .../User/.gradle/cashes
I deleted the .gradle and rebuilding the project
Any Help Please here
Error in
Plugin project :firebase_core_web not found. Please update settings.gradle.
Solution here.

Cordova Issue "Execution failed for task ':app:mergeDebugResources'."

I am getting below issue during "cordova build":
My Android version:8.1.0
Cordova Version:Latest
Gradle Version:4.2
Getting it due to onesignal plugin but it gone when I remove plugin
?? actionable tasks: ? executed, ?? up-to-date
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeDebugResources'.
> java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource compilation failed
C:\Users\AJ\Desktop\blogapp\platforms\android\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v२३\values-v२३.xml: error: invalid configuration 'v२३'.
* 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
I abled to fix the issue my reinstalling cordova and android studio, This issue occur because of wrongly configured SDKs

Android Studio Build Error Execution Failure

I'm a student trying to use Android Studio and as shown below, I'm having errors when I try to build why is this happening? Also, how can I fix it?
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeDebugResources'.
> Error: java.util.concurrent.ExecutionException:
com.android.builder.internal.aapt.v2.Aapt2Exception: AAPT2 error: check logs
for
details
* 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 4s
9 actionable tasks: 1 executed, 8 up-to-date
P.S: I'm not sure what the thing that says in the try section means.
Error:com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
see this link, Aapt2 is enabled by default to speed up builds.
Update your gradle version and this error should disappear, alternatively disable aapt2, but prefer to upgrade the gradle version, as just disabeling aapt2 hides the problem, and also slowes down your build.
updating
build.gradle(top level)
buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4
}
}
gradle-wrapper.properties
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
alternatively disable it in gradle.properties
android.enableAapt2=false

Jenkins mergeDebugResources FAILED - no access to files

I would like to run espresso tests on jenkins. I did configuration like here
https://www.perfectomobile.com/solutions/devtunnel/espresso-in-continuous-integration
I got error like below
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-
1.1\design-26.1.0.aar\a1a21cd8aba52bd546711d26a970dfcb\res\drawable-
v21\avd_hide_password.xml: error: file not found.
Error: java.util.concurrent.ExecutionException:
com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
:app:mergeDebugResources FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeDebugResources'.
> Error: java.util.concurrent.ExecutionException:
com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --
debug option to get more log output.
* Get more help at https://help.gradle.org
BUILD FAILED in 9s
10 actionable tasks: 9 executed, 1 up-to-date
Build step 'Invoke Gradle script' changed build result to FAILURE
Build step 'Invoke Gradle script' marked build as failure
Finished: FAILURE
Any sugestions what can be wrong?
This is happening because AAPT2 still has issues with long paths on windows (only supports paths up to 145 characters or so for now, sadly). This file path is around 170, so it's over that limit.
The issue should be fixed soon, in the meantime you can move your cache directory closer to the C: root.
I faced the same issue. The solution proposed here helped.
Simply add enviornmental variable GRADLE_USER_HOME
env GRADLE_USER_HOME= ${WORKSPACE}/gh
Note: Make sure gh is close to the main drive location

Categories

Resources