Android Studio Execution failed for task ':app:mergeDebugResources' with special chars in username - android

i have a strange error with AAPT2 iin Android Studio. I think it has something to do with german special characters in my account name in windows.
If i set my gradle to version 3.0.1 and also set android.enableAapt2 to false everything works fine. But since i researched, setting the option is not a solution to the problem.
Now if i set the gradle version to 3.1.2 and remove android.enableAapt2 from the properties i get the following error message:
And this one:
One way to solve the problem was to create a new account in windows without special chars in the name. It compiled and did run very well. I really tried everything in the web but could not find a solution to the problem.
Maybe you can help me.

First of all check your build log botom of the build section you shared whether any error related to your project showing or not. If error showing then fix those. Build and run again and fix all the error comes up. It will eliminate aapt2 issue without changing android gradle plugin.
Secondly if there is not any project related error showing in the build log but still its showing aapt2 error then you can fix it by following below steps.
Update your android gradle plugin in your project level build.gradle file like below:
classpath 'com.android.tools.build:gradle:3.2.0-alpha13'
Now update android.enableAapt2=true. Then check and build your project.

Related

Upgrading to Gradle 7.1.1 in Android Studio Breaks Build

After upgrading to Gradle 7.1.1, I get the following build error:
Unexpected EOF in prolog
at [row,col {unknown-source}]: [1,0]
I've done as many Google searches as I could but can't find anything on this. I've tried running the build with stacktrace, debug and scan options but there is nothing in the output window that gives a hint as to where this is coming from, except that it's in this task:
app:mergeProductionDebugResources FAILED
I'm assuming there is some file somewhere that's doing this but I don't know how to begin finding it.
I would like to know if there is some place to look that I'm not aware of, or if there is some procedure to help me track this down.
I found my issue. Someone had added an empty xml file to the project. Previous versions of gradle just ignored this, but 7.1.1 doesn't.

Android studio 3.0 Beta4 can't rename a file and build error sometimes

Rename Error :
Build Error :
Error:Execution failed for task
':app:transformDexWithInstantRunSlicesApkForDebug'.
java.io.IOException: Could not delete path 'D:\AndroidStudioWorkSpace\qianfan-android\app\build\intermediates\instant-run-support\debug\package_slice_7\dex-renamer-state.txt'.
This is a known issue, which, per the last comment:
Beta 4 doesn't include the fix. It will be in beta 5.
I've got this same problem happening to a multidex apk using 3.0.1 My project is far from trivial so I have no idea where to go with this beyond just doing a stupid clean whenever it happens.... no rhyme or reason behind it as best as I can tell.

Android - Deprecated NDK warnings in Android Studio

After a long time working fine my project suddenly build failed. The image below is what i get from log.
I already have gradle.properties file with 'android.useDeprecatedNdk=true' in my project but the error keep show up.
Please help. :(
The warning says that useDeprecatedNdk=true will stop working soon. If you plan to keep using the latest Gradle Plugin, you should edit your build.gradle and use externalNativeBuild.
Actually, the change should be pretty easy, and the explanation on developer.android.com is quite straightforward.
The error you see is probably not related to the warning. Something went wrong in your build. The easiest way to find out is to run same ndk-build in the terminal window of your Android Studio, and analyze the results.
Carefully copy all parameters from the log, and add V=1:
/Users/haulx94/Library/Android/sdk/ndk-bundle/ndk-build NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=/Users/haulx94/AndroidProject/hd1-android/HDONE/app/build/intermediates/ndk/stagging/debug/Android.mk APP_PLATFORM=android-25 NDK_OUT=/Users/haulx94/AndroidProject/hd1-android/HDONE/app/build/intermediates/ndk/stagging/debug/obj NDK_LIBS_OUT=/Users/haulx94/AndroidProject/hd1-android/HDONE/app/build/intermediates/ndk/stagging/debug/lib APP_STL=gnustl_shared APP_ABI=armeabi-v7a V=1

Android studio How to resolve Error in png files of library added

I have no Idea what is happening, last time when I finished my app I build its release apk and all was working just fine as expected but now today when I tried to make that pproject again and to make another apk I am getting the following error.
Error:Execution failed for task ':app:mergeDebugResources'.
Crunching Cruncher common_signin_btn_icon_pressed_light.9.png failed, see logs
I have no idea how to resolve it I have serached and found restarting Android studio and clean the project would remove it , doing this many times has no effect on this error. I have even restarted my machine but the condition of error in same.
In the logs I have seen that this png file is from the library I added , so just for testing I removed that library and tried to build then it started to give me same error with different png file name in other library. So how to fix this issue ?
My Questions are :
How can this issue be Solved ?
Have some one faced this problem too ?
Is this problem has been reported to google ?
Why in android we do not have any stable platform for development as IOS have ?
Try to remove "builds" folders and do rebuild. But soon, the whole thing in a long file name. Read this answer. By the way, you looked logs? Maybe this is not the PNG? You have not sent the log and did not specify the version Gradle.
Believe me, iOS developers have own problems.

Gradle 'ProjectName' project refresh failed: failed get query package name for debug error in Android Studio

I am using Android Studio 0.5.2 and everything was ok 2 hours ago. After reopening the project now it gives the following error.
Gradle 'ProjectName' project refresh failed: Failed get query package
name for debug
How can i solve this error?
I got this error and found out it was because I had errors in AndroidManifest.xml. Some errant text ended up in the file and created numerous errors. I reverted to a previous known good version and Gradle refreshed without issue.
I have had problems like this a few times. Usually if you close it and reopen it the problems go away.

Categories

Resources