Gradle daneom starting again and again in android gradle sync - android

i cloned a project from git and it is starting gradle daneom again and again
It gradle sync should be successful because it is a google codelabs project.

You can try to delete the .gradle directory. It is located in your "user" home directory. This will force Gradle to re-download all dependencies.
Also it might be smart to invalidate caches and restart. Go to File -> Invalidate Caches / Restart.

Related

Cannot obtain the application id some one know how to fix it?

the app is not working in the emulator
when i try i got this message
Run configuration app is not supported
in the current projet.
Cannot obtain the application id
I reinstalled android
Clean Project - Build -> Clean project
Rebuild project - Build -> Rebuild project
Invalidate Cache - File -> Invalidate Caches / Restart -> Invalidate and restart

Android Studio shows error for every line

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

Android Studio 3.3.2 Stuck at Project Setup:reading from cache

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

Android Studio 3.3 Stuck at Project Setup:reading from cache

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

Re download dependencies and sync Project in Android studio

After updating Android Studio 2.3.3 all this happing.
I am creating a new Android Project after indexing and Gradle synchronization it shows an error Re-download dependencies and sync project(required network)
when I click on click on Re-download dependencies and sync project nothing would happen it again shows error.
I have also tried invalidate cache and Restart and also sync the Gradle but nothing happens
I have also good connectivity of the internet.
It seems to be a gradle dependency cache problem. Unfortunately File | Invalidate Caches/Restart only cleans system cache as described here
To clean the gradle cache you need to run command
for Windows gradlew cleanBuildCache
for *nix ./gradlew cleanBuildCache
It will only clean cache related to your project. More details here
Another option is to delete gralde cache directory contents manually:
Windows: %USER_HOME%.gradle/caches
*nix: $HOME/.gradle/caches/
You can try this:
distributionUrl=https://services.gradle.org/distributions/gradle-3.3-all.zip
Replace the url in your project with this URL and then rebuild your project.
Hope that works
You can just delete the gradle 2.3.3 in the ./gradle/dists/wrapper directory and close the project and open it again .. This will allow it to download it again
try to invalidate the cache and restart in android studio.
for Windows gradlew cleanBuildCache.
for Linux ./gradlew cleanBuildCache.
or try to delete cache using some cleaner like C cleaner.
If you're on linux like me, starting studio with sudo from terminal does it.
sudo ./{path to studio}/bin/studio.sh
I have the same problem when I updated my Java SDK
I solve the issue by doing the following
...
Close your android studio
Delete the .gradle folder from home folder
Start Android Studio and it will forced to download the new .gradle

Categories

Resources