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

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.

Related

[SOLVED]After „Android Gradle Plugin Update Recommended“ I got this error: Could not resolve com.android.support.constraint:constraint-layout:2.0.4

** I updated to Androidx as #androidkiller in the comments wrote**
I had an example app of a Navigation Drawer from a long time ago, incase I would need it someday. The day was today. After opening it today I got a message telling me I had to update the gradle plugin.
So I updated it and unfortunately I got an error: I got this error: Could not resolve com.android.support.constraint:constraint-layout:2.0.4.
Unfortunately I don't know where to go to fix the error. I did try clean and rebuild the project but it didn't helped. Also I tried some solutions from other post having the same problem but another Gradle version but it didn't help. Like going to Android SDK and the to the Android Tools and click the missing constraint layout versions.
Any thoughts?

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.

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 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.

Android Studio: "Found item Style/AppBaseTheme more than one time"

I am attempting to import a project into Android Studio 0.8.9 - at first I get an error saying that the gradle level in the project (.11) is not supported. Clicked the link to fix. Now getting the following two errors:
Error: Found item Style/AppBaseTheme more than one time
Error:Execution failed for task ':mergeDebugResources'.
> C:\Users\mrshickadance9\AndroidStudioProjects\testapp\res\values\styles.xml: Error: Found item Style/AppBaseTheme more than one time
How can I fix this?
Hmm. Fixed it. For some reason appbasetheme was duplicated in Android Studio, but not when i open the same exact project in Eclipse. Very weird.

Categories

Resources