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

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.

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 Execution failed for task ':app:mergeDebugResources' with special chars in username

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.

Error com.google.android.gms/play-services/8.4.0/ gradle:2.0.0-alpha5

After updating the SDK AndroidStudio told me to update to gradle:2.0.0-alpha5.
When I build/run the app gradle fails and says:
Error:Execution failed for task ':app:compileReleaseJavaWithJavac'.
java.io.FileNotFoundException: /home/pepperonas/IdeaProjects/Android/M104/app/build/intermediates/exploded-aar/com.google.android.gms/play-services/8.4.0/jars/classes.jar (No such file or directory)
Downgrading to gradle:2.0.0-alpha3 will solve it, but I want to use the newest version.
Does any body know how to fix it?
(Note: I use AndroidStudio 2.0 Preview 5)
As always, thanks in advance.
Found the solution:
Updating will do the trick.
'com.android.tools.build:gradle:2.0.0-alpha9'
UPDATE (2015-02-28)
alpha9 is available now
NOTE
Bookmark this page <- seems to be a MUST for every android-dev. :)
Unfortunately, you are the not the only one with this issue. There seems to be some bug on the alpha5 build for the Gradle build tools. There is already a ticket created on the Android Bug Tracker.
More info:
https://code.google.com/p/android/issues/detail?id=198937
In the meantime alpha3 build tool is the way to go about. I am doing the same thing as of now until the issue is resolved in the next release.
Hope this helps.
As per today (9.Mar.2016) com.android.tools.build:gradle:2.0.0-beta6 is available. Update your project/gradle.build. Also update gradle distribution to 2.11-all
Anyone interested in getting latest build updates view email for com.android.tools.build:gradle can go to bintray site and subscribe for it.
Update (9.Mar.2016)
com.android.tools.build.gradle 2.1.0-alpha1 has just been released.

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.

How do I see Gradle Warnings on Android Studio?

I recently updated to Android Studio 0.5.9. Before updating it, the Event Log would just say "Gradle completed with 0 errors or warnings" after compiling the project, but now it says "Gradle build finished with 2 warnings(s) in x sec". How can I find what is causing these warnings?
EDIT: If anyone is having these warnings after 0.5.9 update, I reinstalled Android Studio and the Gradle warnings are gone.
Look at the Messages view (default key shortcut: Alt+0)
On a Mac, it's ⌘+0
(The accepted answer is for windows)
Try go to indicate directory(....gradle\2.2.1\taskArtifacts) and rename file cache.properties.lock to cache.properties

Categories

Resources