I have create module library with NDK. After updating Android Studio 3.3, open project on studio stuck on build project
Project Setup:reading from cache...
Every time needs to "Invalidate and Restart" android studio then after studio working.
I have try to delete .gradle folder but still facing this issue.
How can I solved this misbehavior of studio 3.3?
I don't have enough reputation to comment so I'll post this as an answer.
After you Invalidate and Restart have you tried Build->Clean Project and rebuilding then syncing again?
Have you tried restarting your computer to turn of any processes that may keep caches from clearing?
Have you tried upgrading your gradle version as well (inside your gradle-wrapper.properties)?
Have you checked if your gradle path is correct at File -> Settings -> Build, Execution, Deployment -> Gradle?
Have you tried locating your gradlew and doing a gradlew cleanBuildCache?
Have you tried removing the C:\Users\{Your Username}\.gradle\caches folder?
Have you tried disabling cache building altogether (will slow down your build and is not recommended)? To do this you have to go to your gradle.properties file and set android.enableBuildCache=false
Gradle caches are at
On macOS/Linux: $HOME/.gradle/caches/
On Windows: %USER_HOME%\.gradle/caches/
Try to delete those directories.
More about build caches is here: Android Studio Build Cache
Also, Disable configuration on demand in your gradle.properties file as shown below:
org.gradle.configureondemand=false
See: Known issues with the Android Gradle Plugin
Try Below approach:
Go to "
File -> Settings -> Build, Execution, Deployment -> Instant Run"
and just disable it.
With this Android Studio builds from scratch each time but it's better than not building it right.
open your project's gradle.perperties file and add settings:
org.gradle.configureondemand=false
restart your projects
Related
Android studio showing error for all lines in the project. I am able to run the app in the device. I tried invalidate cache and restart, that didn't help. Please check the screenshot below.
I believe, it is something related gradle or android studio!! But not sure where to make changes.
Android Studio version 4.1.2
Try this:
Make sure, gradle isn't in offline mode
Clean project
Remove .idea and .gradle folders from your project
Invalidate caches and restart
Sync gradle and rebuild project
I recently installed the new version of android studio, but every time I reopen a project, the gradle configuration automatically tries syncing to the project, which is perfectly normal.
However, the sync never completes and is stuck at
Project Setup: reading from cache.
Someone know how can I fix this?
I have also found AS to be pretty slow, it just stops/hangs and then resumes. This might not solve the problem completely but can be tried. Destroy the .gradle folder and .idea folder (extreme case destroy the main .gradle folder on you computer home directory). Once that is done, re-import the project in AS. These directories maintain local cache data, which might be causing these issues.
According to known_issues_with_the_android_gradle_plugin:
Configuration on demand with Gradle 4.6 and above: If you're using Android Gradle Plugin 3.0.x or 3.1.x with Gradle 4.6 and above, you should disable configuration on demand to avoid some unpredictable build errors. (If you are using Android Gradle Plugin 3.2.0 or higher, you do not need to take any action to disable configuration on demand.)
Disable configuration on demand in your gradle.properties file as shown below:
org.gradle.configureondemand=false
Also, note that Gradle caches directories
On macOS/Linux: $HOME/.gradle/caches/
On Windows: %USER_HOME%\.gradle/caches/
Try to close your Android Studio and delete those directories then restart Android Studio.
More about build caches is here: Android Studio Build Cache
It is my first time to use android studio V 3.1.3
when i finished installation and trying to build this error is shown
it said that "Basic functioality not working correctly such as building and debugging "
i do not known how to solve it
i use a local gradle distribution like this
Then press on sync project with gradles files
but this error is still shown.
It works well but after that this error is happened
any help
Thanks in advance.
I also have the same problems as you,Now I have solved it.
The following are the steps to be solved
Exit Android Studio.
Delete the .gradle folder eg: C:\Users{userName}}.gradle
Restart androidStudio and wait a moment.
Have you tried
Android studio -> File -> Invalidate Caches/Restart -> Invalidate and Restart
Deleting the .gradle folder was unsuccessfull for me.
Still waiting for another solution.
you should go to settings > build,execution,Deployment > build tool > gradle
and the change the user gradle home that to path of environment variable of JAVA-HOME Address
Like this
and then change gradle JDK to Embedded JDK it will solve your problem
When I started up my project this morning it randomly gave me a message saying Gradle project sync failed. Basic Functionality(eg. editing, debugging) will not work properly. in Android Studio. I looked at other answers that people had put up for this problem but they haven't been working. I invalidated my chaches/restarted my project but no luck. I also deleted my .gradle folder from my project folder and still no luck. If any of you guys could help me that would be awesome! This didn't happen yesterday when I was working on the project or anything, I wonder why its happening now. Oh yea it also says this as a gradle message: Error:C:\Users\Dave\.gradle\caches\2.2.1\scripts\settings_ad4t0wp5ikihzl1y1o83b5sbw\SettingsScript\buildscript\cache.properties (The system cannot find the file specified) :
Thanks again for anyone who reads this/ can help!
There is a file - "cache.properties" that gradle creates for you, upon first time inception of any project. The path for this file is "~Home_Directory\.gradle\2.2.1\taskArtifacts". You may find this path in your home directory. So basically, this file - "cache.properties" is missing from the "taskArtifacts" folder.
One of the solution that worked for me is to copy file - "cache.properties" from any test project of yours to this project that's currently experiencing an issue.
Regards
I had to choose using the Default Gradle Wrapper instead of local.
<< SETTINGS -->/ BUILD TOOLS --> Gradle --> radio button switch... >>
It has helped me to fix the same problem.
I had experience similar sync failed problem with gradle based android project (in Android Studio 1.1.0). I solved this problem without deleting .gradle from my user directory,
steps I followed was
Go to File -> Settings -> Compiler(Gradle Based Android Project)
Change VM options to -Xmx512m -XX:MaxPermSize=512m.
Click Apply -> OK and then tap on Try Again option in sync failed message to clean build the project.
Works like charm!!
UPDATE - 1 : For Android Studio 1.3, Compiler option mentioned in above Step-1 is present inside tab Build, Execution, Deployment.
I had faced similar kind of problem earlier!
But don`t know after rebuild the project and cleaning it, it worked normally.
Invalidate dependency cache by running
gradle clean build --refresh-dependencies
from project root and then re-import your project. Worked for me once.
May be you have put Android Studio into offline mode. To fix it, go to Preferences -> Gradle and ensure that the "Offline work" checkbox is not checked.
Than do
File -> Invalidate caches / Restart
Shutdown Android Studio
Rename/remove .gradle folder in the user home directory
Restart Android Studio let it download all the Gradle stuff it needs
android studio 0.4.2: Gradle project sync failed error
Delete the folder C:\Users\.gradle and reopening the android studio solved my problem
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