I recently updated from Android Studio 2.0 to 2.1.2 and now I have a project which doesn't open. Android Studio is stuck at the following screen for more than 10-15min.
I tried solutions from these answers.[ans1] [ans2]
but none of them work.
I can create new projects and also import projects built on eclipse. But cannot open my own project.
Please help.
Delete the gradle folder in the project folder. It will work.
For many problems such as stuck with opening or downloading something while starting
I use this sequence as an ultimate guide and on one of the steps always works out.
Recently I used it after updating to 3.2
Try File -> Invalidate caches / Restart
Shutdown Android Studio
Remove .gradle folder in the user home directory
Start Android Studio (Studio will download gradle data)
After Gradle build is done, rebuild project
According to Android Studio's Known Issues https://developer.android.com/studio/known-issues under "Configuration on demand with Gradle 4.6 and above:", if you are using Android Gradle Plugin 3.0.x or 3.1.x with Gradle 4.6 and above you should add the following line to gradle.properties:
org.gradle.configureondemand = false
This seemed to solve my issue with Android Studio getting stuck at "Project setup: reading from cache".
Related
My laptop crashed while android studio was running (probably due to some corrupted files). I reinstalled the windows and installed android studio again , but when I tried to load my previous project , it only says Gradle project sync in progress and remains in the same state. I have
tried to open a new project but same goes for it.
This problem could be related to build.gradle file. Please, try this solution by #vijay_t. Also try to disable android studio plugins.
After upgrading Android Studio to 4.0 version and in "gradle-wrapper.properties" :
distributionUrl=https://services.gradle.org/distributions/gradle-6.1.1-all.zip
I am getting the following error in Android Studio while syncing:
No builders are available to build a model of type 'org.jetbrains.plugins.gradle.model.internal.DummyModel'.
and unable to create or run the app build.
This can be one solution. I tried Copy and Cut everything in the setting.gradle file located in the project directory then SYNC project after Gradle is complete. Later paste the content back to the file and SYNC again. This not worked for me but for others, it worked.
Another solution is to downgrade the android studio to v 3.6.3 download by clicking here. You can follow these steps to downgrade the android studio. This solution worked for me and now I can build and run the application successfully.
I solved it by navigating to the Project settings in the settings.gradle file and COPY and CUT everything then SYNC the project after gradle is complete PASTE back the content you had copied and SYNC again.
This worked for me
Still not worked
Please use different gradle version.
ie case gradle-wrapper.properties. Instead of your version
distributionUrl=https://services.gradle.org/distributions/gradle-*.*.*-all.zip
update with
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
Thanks
I tried all the solutions above but I didn't succeed so I uninstall android studio and then installed it again and saw all the problems solved and I have no problem . so I recommend you reinstall the program as a last step .
REINSTALL
while re-importing my project android studio show's plenty of errors
after cleaning and re-importing my project i have got an red circle with āJā on my java files and i'am enable to run my project
Make sure that your gradle version is defined properly.
It seems that this project was on another PC and you imported it on your computer. I think that probably a gradle version conflict occurred and you have two options:
one is to let android studio download gradle version specified in TlaProject (gradle 2.4)
another solution is to edit app level 'build.gradle' file and change its version to a version which is available on your machine (to see which version is available on your system, please check 'gradle' folder inside installation folder of android studio)
My problem was solved by updating the version of android studio .
I'm using android studio as my android development. I installed android studio - 0.8.2, gradle - 1.12 to my Mac mini. When I try to open a gradle project or when I create new android project from android studio, always give the above error. Please help me to fix this.
Thanks ...
I tried with gradle 2.0 & 2.1 (issue is happening).
I found the issue on this. Issue is partially installation on .gradle directory. So I delete the current .gradle directory and rebuild the project with new gradle installation.
I was working on a project, and then I got a prompt to update Android Studio. After I did that, I started getting this error when trying to run my app
It says
The project may need to be synced with Gradle files
How do I solve this?
EDIT
Starting with Android Studio 3.1, you should go to:
File -> Sync Project with Gradle Files
OLD
Clicking the button 'Sync Project With Gradle Files' should do the trick:
Tools -> Android -> Sync Project with Gradle Files
If that fails, try running 'Rebuild project':
Build -> Rebuild Project
Old Answer
When trying to run the application, instead of selecting the directory highlighted here in blue
I selected the subdirectory instead
and clicked "run".All the issues with Gradle are automatically resolved and the missing apk directory is automatically created.
New Solution
The Sync project with gradle files button disappeared from Android Studio for a while.Its back and you can find it here:
hit the button and wait for the task to complete
I've had this problem after installing the genymotion (another android amulator) plugin.
A closer inspection reveled that gradle needs SDK tools version 19.1.0 in order to run (I had 19.0.3 previously).
To fix it, I had to edit build.gradle and under android I changed to: buildToolsVersion 19.1.0
Then I had to rebuild again, and the error was gone.
Keys combination:
Ctrl + F5
Syncs the project with Gradle files.
The gradle versions in android studio and your code is not the same. This is why even after you update the gradle version on android studio, the error still persist.
So, edit the Gradle distribution reference in the gradle/wrapper/gradle-wrapper.properties file:
distributionUrl = https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
Ref: https://developer.android.com/studio/releases/gradle-plugin.html#updating-gradle
I am using Android Studio 4 developing a Fluter/Dart application. There does not seem to be a Sync project with gradle button or file menu item, there is no clean or rebuild either.
I fixed the problem by removing the .idea folder. The suggestion included removing .gradle as well, but it did not exist.
i had this problem yesterday. can you folow the local path in windows explorer?
(C:\users\..\AndroidStudioProjects\SharedPreferencesDemoProject\SharedPreferencesDemo\build\apk\)
i had to manually create the 'apk' directory in '\build', then the problem was fixed