Error: java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: AAPT2 error - android-studio

Executing tasks: [clean, :app:assembleDebug]
Configure project :app
Could not find google-services.json while looking in [src/nullnull/debug, src/debug/nullnull, src/nullnull, src/debug, src/nullnullDebug]
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
Could not find google-services.json while looking in [src/nullnull/release, src/release/nullnull, src/nullnull, src/release, src/nullnullRelease]
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
Task :clean UP-TO-DATE
Task :app:clean
Task :app:preBuild UP-TO-DATE
Task :app:preDebugBuild
Task :app:compileDebugAidl
Task :app:compileDebugRenderscript
Task :app:checkDebugManifest
Task :app:generateDebugBuildConfig
Task :app:prepareLintJar UP-TO-DATE
Task :app:mainApkListPersistenceDebug
Task :app:generateDebugResValues
Task :app:generateDebugResources
Task :app:processDebugGoogleServices
Parsing json file: D:\ANDROID APP SOURCE CODE\HD WALLPAPERS\codecanyon-7054658-hd-wallpaper-with-material-design\HD Wallpaper Package\Source Code\HDWallpaperNew\app\google-services.json
D:\ANDROID APP SOURCE CODE\HD WALLPAPERS\codecanyon-7054658-hd-wallpaper-with-material-design\HD Wallpaper Package\Source Code\HDWallpaperNew\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-sw600dp-v13\values-sw600dp-v13.xml: error: file not found.
Task :app:mergeDebugResources FAILED
Error: java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: AAPT2 error: check logs for details
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 8s
12 actionable tasks: 10 executed, 2 up-to-date
I did not find Exact issue I already try previous answer of others but non of any solve my issue !

make sure that you have google-services.json in your android\app folder.

Related

I'm trying to run a flutter app but this happens when running gradle task 'assemblyDebug'. How can I get past this

FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring root project 'android'.
Could not resolve all artifacts for configuration ':classpath'.
Could not download kotlin-compiler-embeddable.jar (org.jetbrains.kotlin:kotlin-compiler-embeddable:1.3.50)
> Could not get resource 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-compiler-embeddable/1.3.50/kotlin-compiler-embeddable-1.3.50.jar'.
> Connection reset
Could not download fastutil.jar (it.unimi.dsi:fastutil:7.2.0)
> Could not get resource 'https://jcenter.bintray.com/it/unimi/dsi/fastutil/7.2.0/fastutil-7.2.0.jar'.
> Connection reset
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 22m 42s
Exception: Gradle task assembleDebug failed with exit code 1

Error while building : Task :app:processDebugResources FAILED

Everything was woing Great, getting ready to test APK on diferent devices, but now, when i try to build, gave me this error:
Executing tasks: [:app:assembleDebug] in project C:\Users\Diego\Desktop\Kaiser
> Task :app:preBuild UP-TO-DATE
> Task :app:preDebugBuild UP-TO-DATE
> Task :app:compileDebugAidl NO-SOURCE
> Task :app:generateDebugBuildConfig UP-TO-DATE
> Task :app:compileDebugRenderscript NO-SOURCE
> Task :app:generateDebugResValues UP-TO-DATE
> Task :app:generateDebugResources UP-TO-DATE
> Task :app:processDebugGoogleServices UP-TO-DATE
> Task :app:mergeDebugResources UP-TO-DATE
> Task :app:createDebugCompatibleScreenManifests UP-TO-DATE
> Task :app:extractDeepLinksDebug UP-TO-DATE
> Task :app:processDebugManifest UP-TO-DATE
> Task :app:processDebugResources
AGPBI: {"kind":"error","text":"Android resource linking failed","sources":[{"file":"C:\\Users\\Diego\\.gradle\\caches\\transforms-2\\files-2.1\\42c451172659b686dff6601c1a023c68\\jetified-ui_legacy-8.12.0\\res\\layout\\list_preference_layout.xml","position":{"startLine":11}}],"original":"C:\\Users\\Diego\\.gradle\\caches\\transforms-2\\files-2.1\\42c451172659b686dff6601c1a023c68\\jetified-ui_legacy-8.12.0\\res\\layout\\list_preference_layout.xml:12: AAPT: warn: generated id 'android:id/icon' for external package 'android'.\n ","tool":"AAPT"}
AGPBI: {"kind":"error","text":"Android resource linking failed","sources":[{"file":"C:\\Users\\Diego\\.gradle\\caches\\transforms-2\\files-2.1\\42c451172659b686dff6601c1a023c68\\jetified-ui_legacy-8.12.0\\res\\layout\\list_preference_layout.xml","position":{"startLine":31}}],"original":"C:\\Users\\Diego\\.gradle\\caches\\transforms-2\\files-2.1\\42c451172659b686dff6601c1a023c68\\jetified-ui_legacy-8.12.0\\res\\layout\\list_preference_layout.xml:32: AAPT: warn: generated id 'android:id/summary' for external package 'android'.\n ","tool":"AAPT"}
AGPBI: {"kind":"error","text":"Android resource linking failed","sources":[{"file":"C:\\Users\\Diego\\.gradle\\caches\\transforms-2\\files-2.1\\42c451172659b686dff6601c1a023c68\\jetified-ui_legacy-8.12.0\\res\\layout\\list_preference_layout.xml","position":{"startLine":25}}],"original":"C:\\Users\\Diego\\.gradle\\caches\\transforms-2\\files-2.1\\42c451172659b686dff6601c1a023c68\\jetified-ui_legacy-8.12.0\\res\\layout\\list_preference_layout.xml:26: AAPT: warn: generated id 'android:id/title' for external package 'android'.\n ","tool":"AAPT"}
AGPBI: {"kind":"error","text":"Android resource linking failed","sources":[{"file":"C:\\Users\\Diego\\.gradle\\caches\\transforms-2\\files-2.1\\42c451172659b686dff6601c1a023c68\\jetified-ui_legacy-8.12.0\\res\\layout\\list_preference_layout.xml","position":{"startLine":42}}],"original":"C:\\Users\\Diego\\.gradle\\caches\\transforms-2\\files-2.1\\42c451172659b686dff6601c1a023c68\\jetified-ui_legacy-8.12.0\\res\\layout\\list_preference_layout.xml:43: AAPT: warn: generated id 'android:id/widget_frame' for external package 'android'.\n ","tool":"AAPT"}
AGPBI: {"kind":"error","text":"Android resource linking failed","sources":[{"file":"C:\\Users\\Diego\\Desktop\\Kaiser\\app\\src\\main\\res\\layout\\activity_main.xml","position":{"startLine":9}}],"original":"C:\\Users\\Diego\\Desktop\\Kaiser\\app\\src\\main\\res\\layout\\activity_main.xml:10: AAPT: error: resource drawable/mas (aka com.kaiser:drawable/mas) not found.\n ","tool":"AAPT"}
> Task :app:processDebugResources FAILED
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
> Android resource linking failed
C:\Users\Diego\.gradle\caches\transforms-2\files-2.1\42c451172659b686dff6601c1a023c68\jetified-ui_legacy-8.12.0\res\layout\list_preference_layout.xml:12: AAPT: warn: generated id 'android:id/icon' for external package 'android'.
C:\Users\Diego\.gradle\caches\transforms-2\files-2.1\42c451172659b686dff6601c1a023c68\jetified-ui_legacy-8.12.0\res\layout\list_preference_layout.xml:32: AAPT: warn: generated id 'android:id/summary' for external package 'android'.
C:\Users\Diego\.gradle\caches\transforms-2\files-2.1\42c451172659b686dff6601c1a023c68\jetified-ui_legacy-8.12.0\res\layout\list_preference_layout.xml:26: AAPT: warn: generated id 'android:id/title' for external package 'android'.
C:\Users\Diego\.gradle\caches\transforms-2\files-2.1\42c451172659b686dff6601c1a023c68\jetified-ui_legacy-8.12.0\res\layout\list_preference_layout.xml:43: AAPT: warn: generated id 'android:id/widget_frame' for external package 'android'.
C:\Users\Diego\Desktop\Kaiser\app\src\main\res\layout\activity_main.xml:10: AAPT: error: resource drawable/mas (aka com.kaiser:drawable/mas) 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 9s
8 actionable tasks: 1 executed, 7 up-to-date
i've allready try "Clean & Rebuild Project", "Invalidate Cache and Restart", "Deleting the cache folder under .gradle" "org.gradle.jvmargs=-Xmx4608m on the Grade.Property", "Advanved profiling is Disable"
I'm out of ideas (Except, maybe to burn the entire building down.. :( )
You have to open all your xml files and see if there are any errors. Fix the errors then run again. It took my hours to figure it out.

On run app in android studio first stuck at Running Gradle task 'assembleDebug'... and after some time gives an exception

Running Gradle task 'assembleDebug'...
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:desugarDebugFileDependencies'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Could not download armeabi_v7a_debug.jar (io.flutter:armeabi_v7a_debug:1.0.0-af51afceb8886cc11e25047523c4e0c7e1f5d408)
> Could not get resource 'http://download.flutter.io/io/flutter/armeabi_v7a_debug/1.0.0-af51afceb8886cc11e25047523c4e0c7e1f5d408/armeabi_v7a_debug-1.0.0-af51afceb8886cc11e25047523c4e0c7e1f5d408.jar'.
> Read timed out
* 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 3m 30s
Finished with error: Gradle task assembleDebug failed with exit code 1

Please assist me to Solve this issue (New Installation + Hello world Project) build failed / Generate APKs Failed

Executing tasks: [clean, :app:assembleDebug]
Configure project :
This version of Gradle requires version 2.0.2 of the build scan plugin or later.
Please see https://gradle.com/scans/help/gradle-incompatible-plugin-version for more information.
Task :clean UP-TO-DATE
Task :app:clean
Task :app:preBuild UP-TO-DATE
Task :app:preDebugBuild
Task :app:compileDebugAidl NO-SOURCE
Task :app:compileDebugRenderscript NO-SOURCE
Task :app:checkDebugManifest
Task :app:generateDebugBuildConfig
Task :app:prepareLintJar UP-TO-DATE
Task :app:generateDebugSources
Task :app:javaPreCompileDebug
Task :app:mainApkListPersistenceDebug
Task :app:generateDebugResValues
Task :app:generateDebugResources
Task :app:mergeDebugResources FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:mergeDebugResources'.
8 exceptions were raised by workers:
com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.0-5326820-windows Daemon #0: Daemon startup failed
This should not happen under normal circumstances, please file an issue if it does.
com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.0-5326820-windows Daemon #1: Daemon startup failed
This should not happen under normal circumstances, please file an issue if it does.
com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.0-5326820-windows Daemon #2: Daemon startup failed
This should not happen under normal circumstances, please file an issue if it does.
com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.0-5326820-windows Daemon #3: Daemon startup failed
This should not happen under normal circumstances, please file an issue if it does.
com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.0-5326820-windows Daemon #4: Daemon startup failed
This should not happen under normal circumstances, please file an issue if it does.
com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.0-5326820-windows Daemon #5: Daemon startup failed
This should not happen under normal circumstances, please file an issue if it does.
com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.0-5326820-windows Daemon #6: Daemon startup failed
This should not happen under normal circumstances, please file an issue if it does.
com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.0-5326820-windows Daemon #7: Daemon startup failed
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 1s
10 actionable tasks: 8 executed, 2 up-to-date
Issue was that I followed tutorial created for non-mobile devices.
Which meant Unitys build options requires special option for mobile builds.
newBuildPlayerOptions.options = BuildOptions.AcceptExternalModificationsToPlayer;

I Installed Android Studio 3.4 on New PC. Default "Hello World" project is not building

Executing tasks: [clean, :app:assembleDebug]
Task :clean UP-TO-DATE
Task :app:clean
Task :app:preBuild UP-TO-DATE
Task :app:preDebugBuild
Task :app:compileDebugAidl NO-SOURCE
Task :app:compileDebugRenderscript NO-SOURCE
Task :app:checkDebugManifest
Task :app:generateDebugBuildConfig
Task :app:prepareLintJar UP-TO-DATE
Task :app:generateDebugSources
Task :app:javaPreCompileDebug
Task :app:mainApkListPersistenceDebug
Task :app:generateDebugResValues
Task :app:generateDebugResources
Task :app:mergeDebugResources FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:mergeDebugResources'.
8 exceptions were raised by workers:
com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.0-5326820-windows Daemon #1: Daemon startup failed
This should not happen under normal circumstances, please file an issue if it does.
com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.0-5326820-windows Daemon #0: Daemon startup failed
This should not happen under normal circumstances, please file an issue if it does.
com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.0-5326820-windows Daemon #2: Daemon startup failed
This should not happen under normal circumstances, please file an issue if it does.
com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.0-5326820-windows Daemon #3: Daemon startup failed
This should not happen under normal circumstances, please file an issue if it does.
com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.0-5326820-windows Daemon #4: Daemon startup failed
This should not happen under normal circumstances, please file an issue if it does.
com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.0-5326820-windows Daemon #5: Daemon startup failed
This should not happen under normal circumstances, please file an issue if it does.
com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.0-5326820-windows Daemon #6: Daemon startup failed
This should not happen under normal circumstances, please file an issue if it does.
com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.0-5326820-windows Daemon #7: Daemon startup failed
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 3s
10 actionable tasks: 8 executed, 2 up-to-date
I could successfully build APKs in old 2.1 version, but I have the same THREE errors in newly installed android studio 3.4.1.
app:compileDebugAidl NO-SOURCE
:app:compileDebugRenderscript NO-SOURCE
app:mergeDebugResources
I tried cleaning project followed by rebuilding then invalidating cache and restarting... Nothing worked. I even uninstalled and reinstalled it, but in vain.
Some how I came to see an error by by clicking a link in error description. The link opened a class file.
import com.google.generate
Here generate is shown in RED.... I think this this may be the reason of errors in building. But I haven't found a solution yet. I should be obliged if someone can help.
Go to Build tool bar then choose clean project, try again to build but make sure you’re on the Internet

Resources