I updated from Android Studio 2.3 to 3.0 . Now my project is stuck loading symbols for more than 30 mins. Any pointers on how to resolve this?
I tried to reinstall it - the same result.
I tried to relaunch - the same result.
In your project,
Delete {root}/.gradle folder
Delete {root}/app/build folder
Delete {root}/build folder
Run Invalidate Caches / Restart
Sync your project again after Android Studio restarts
SOLUTION FOUND!!!
Android Studio does the most dumb thing: it indexes ALL FILES on your PC.
Straight to the point: I deleted my downloads and DerivedData folder and all went alright.
A short explanation.
. DerivedData became a huge folder with tons of files making Android Studio loop forever on those files
. On my Mac the Downloads folder is shared as hard links with multiple apps. for example, the Skype or Steam apps have hard links to the Download folder, making Android Studio re index the entire Downloads folder multiple times.
What worked for me as a Windows user was to close android studio via Task Manager and navigate to my
C:/ drive -> Users -> My user profile
I then deleted the .android file and re-opened android studio again.
Opened AppData in that same directly which revealed the directories i) Local ii)LocalLow iii)Roaming
Opening Local I deleted the Android Directory in there
Opened the Google Directory i.e. AppData -> Local -> Google and deleted the directory AndroidStudio2021.2
Navigated to AppData -> Roaming and deleted the Google Directory in there.
I then opened Android Studio again.
P.S: I lost all my plugins installed and any other customizations but it worked.
Related
I am a flutter developer and I wanted to clear reinstall the android with the latest version so I deleted android studio from the control panel from my windows os and then when I reinstalled my android studio everything got back as is when I deleted and I don't know why but then I deleted all related files from my storage I deleted filed form program files, the user (.android and .gradle ) then also from app data also from local and roaming and then I tried to reinstall it but the thing was as it is and I have done this several times but I can't seem to understand why it is happening
First of all Uninstall android studio from the Settings.
Go to the location where your SDK is installed. In my case, I found it here C:\Users\ACER\AppData\Local\Android. Delete the android folder.
Now in your user files, delete the .android, .gradle, such folders.
Now go to AppData and delete the folder named Google.
Restart your PC once.
Note: You can also delete the project files if you want.
If this doesn't help try reinstalling Flutter.
Search android studio in the Start window and delete all files.
On the user directory C:\Users\USERNAME, you also need to delete all directories starting by '.AndroidStudio'.
Android Studio create those directories after each update, as backup. And will restore the backup after reinstall if present.
I was cleaning my system from unused application then I found that c:\user\mysystem\AndroidStudio2.3 , c:\user\mysystem\AndroidStudio3.0 files are in my system while I updated the Android Studio two months ago to 3.0 version. So can I delete c:\user\mysystem\AndroidStudio2.3 this file?
Other then that there are two another folders are also available occupying the system memory c:\user\mysystem\.android and c:\Android.
This c:\Android folder have the SDK and this folder c:\user\mysystem\.android is for what? Can I delete it also?
I have deleted the older version's folder of android studio c:\user\mysystem\AndroidStudio2.3 and nothing goes wrong.
While in the c:\user\mysystem\.android contain all cache data and all the emulator data in this folder while deleting this folder. This deletes all your cache and the emulator data. But when you running Android Studio it regenerates this folder automatically and contains all the cache data. And if you have to use the emulator you have to download it again manually.
I updated my android studio into 2.3 then upon connecting my app to Firebase, it gave me an error:
Error:Unexpected lock protocol found in lock file. Expected 3, found 0.
Do I need to go back to 2.2.3 or is there any way to fix this? I tried deleting .gradle file in my project but it still gave me an error.
Delete the .gradle folder from user directory, not from the project.
C:\users\username\.gradle in windows
/home/username/.gradle in Linux
/users/username/.gradle in Mac
Before you go deleting your entire general .gradle folder for android studio, please note the following implications and consequences.
It will cost as much as 3 -4 GB to re-download its content
The download could take days if you are not careful and the network is not super fast
For every old project you reopen, chances are some items are missing, therefore, the android studio will have to redownload missing content, god help you if you chose to take out your laptop at a random eatery without free internet and quickly get some work done.
The deletion process involves thousands of file, up to 119k, the operating system finding them will take forever and deletion will take even longer.
Here is a much better solution;
Close android studio completely
Using the file explorer of the operating system, in your app's project folder open the .gradle folder
Note the number(name) of the folder in it, such as (2.3 or 4.4 or 4.6 or 4.8)
Go to your general .gradle folder as described by #Gabriele Mariotti
open it and open the "caches" folder
Delete the folder with the same number as the second step
If you are paranoid like me you could also delete your project's .gradle file too (not necessary)
The file is not larger than 4 MB and it will not be re-downloaded but regenerated by android studio automatically, therefore the whole process should not take you 5 mins, costs no data, and all previous projects function as normal.
For linux users, Press ctrl+H to show hidden files inside home directory because .gradle directory is usually hidden and delete .gradle directory.
After that you might receive an error as "cannot lock build output"
then remove the lock files in the gradle cache by executing something like this:
find ~/.gradle -type f -name "*.lock" -delete
Delete the .gradle folder from the project's root folder.
For example if your project root folder is MyApp.
Close your project in Android studio
Remove your project from project list.
Exit from android studio.
Go to the MyApp Folder.
Find the .gradle folder.
Delete it.
Restart Android Studio.
Import your Project again.
Android Studio will download again all necessary Gradle files automatically (Internet Required).
All Done.
So here's the problem android studio works perfect earlier for me
but now whenever i open project it android studio would start normally up to the point where background task tell its's indexing file then my computer would stop
my log file is here github link
here's things i already did:
reinstall android studio with diffrent drive
reinstall windows 10
update sdk components
please help..
Maybe the problem is in the configuration folder. There is a hiden folder with all the configuration options. I had the same problem in Ubuntu, and I just delete this folder, and start again to configurate the IDE, but it doesn't shutdown nothing anymore
I was working on app and it was opened in Android Studio. It was all perfect but when after some browsing i clicked on android studio window. it says there are no files opened.
and when I checked in file explorer, all of my project files are removed except .idea folder.I did spend a lot of days on it. I cannot let this happen to me. what possible solutions of this problem?
I tried windows folder recovery, no benefit.
File > Invalidate Caches & Restart seems to be the solution for most oddities.
Before trying any thing. Back-up the project you have.
You can look through local history in Android Studio. In Android Studio -> VCS(Menu) -> Local History -> show History
Select an early restore point that includes your sources-> right mouse -> Revet
strongly I'd recommend you to use git to avoid such as situation. The code is Our Precious👽 Don't lose it.🙂
Just make a copy of the project and save it to another location and open it from the new location. Build it again and it will work.