First, I really dont know wth goin on with android studio ver 3.2.1. I got too much bullshit errors after update this version. Funny thing is i do nothing. After update, everything is fine, but when i restart IDE. everything go wrong.
I tried clear caches, re-install Android Studio, Invalidate Caches, Re-sync project with Gradle, clean project, re-build project. But, nothing change. So, i hope someone can help me. Thanks so much!
Try these:
Method 1:
Delete the .idea folder that is in the project location
Build > Clean Project
Then change something in the app level gradle
Then android studio will ask you to sync the project. Go ahead and sync, the problem will be gone
Credits: https://stackoverflow.com/a/47825463/10471480
Method 2:
Try cleaning up of the following folders:
c:\Users\<user>\.gradle\caches\
c:\Users\<user>\.AndroidStudio3.2\system\caches\
100% Working
Do this two steps:
1.Go to folder where you android studio caches are located. I have android studio 3.6.3 For me it's "C:\Users\Lenovo.AndroidStudio3.6\system\caches"
2.Go to the folder where you android studio projects are located. Open the project >then .idea folder and delete the caches. For me its "C:\Users\Lenovo\AndroidStudioProjects\MyDictionary.idea\caches"
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
For this particular project, Android studio just shows analyzing files, doesn't show any errors and the IntelliSense is also not auto-suggesting. I have tried to invalidate cache/ restart, checked that android studio is not in power mode, and also deleted the project locally and cloned it again, what can be the issue?
It was working fine till 2 days ago but today when I opened the app and tried to build it and make some changes to a few files, it just wont work.
I am on Android Studio 4.2.1 on macOS Big Sur 11.2.1
If I create a new project the studio is working fine but just for this project its not working
Here are the screenshots
Any help is much appreciated! Thanks!!
I have posted the same answer in another post, you can take the reference from the below link.
https://stackoverflow.com/a/67984260/11414681
You just need to Upgrade the latest kotlin version.
Upgrade the dependency in the project's build.gradle file.
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.10"
Upgrade the dependency in the app's build.gradle file.
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.5.10"
Delete .idea , .gradle andr buid folder from your project path.
After delete your project from Android Studio and re-open and its work.
Sometimes android studio has been not working properly so ignore this bugs its nothing.
Just make File -> Invalidate caches and restart
Check my answer here, stackoverflow.com/a/68755611/2281717
In my case, I just update all dependencies on my Android App Project. And it's working
I just updated my android studio and ran into the following error.
Error:java.lang.RuntimeException: Unexpected scopes found in folder 'D:\****\****\****\app\build\intermediates\transforms\dexMerger\dev_demo\debug'. Required: EXTERNAL_LIBRARIES. Found: EXTERNAL_LIBRARIES, PROJECT, SUB_PROJECTS
I tried closing, cleaning and building but it won't work.
Anybody encountered the same problem ?
Deleting the .gradle folder from the project folder fixed this for me.
Try This:
Delete the .gradle folder from the project folder
In Android Studio go to File>Project Structure>Project and change the Gradle Version to the latest version (4.4).
It goes away if you downgrade the gradle plugin from 3.0.+ to 2.3.3. But still not the solution we need.
I found a solution which works in my case.
I deleted the .gradle and .idea folder from the application source directory and then re-run the app.
It works fine for me.
I am not sure about the cause (might be related with studio cache), it works in my case.
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 am using android studio 0.9.2. I copied project folder(all folders projectname->.gradle,.idea,app,build,gradle and all files placed in this level) and renamed it and then in android studio i goto FILE-> CLOSE which close current opened project. Now i open again the project which i have copied. When i make some changes in code its not effecting compiler or debugger. I have debugged my code and found that my change in code does not take affect.
I have tried FILE->INVALIDATE CACHE AND RESTART and then check again but no luck. I have also closed my android studio and run it again but still i am facing same issue
I think its compiling old project which is last opened project.
Any help will be highly appreciated?
Try cleaning the project. There are three ways to achieve that:
via Menu: Build -> Clean Project
via gradle run gradlew clean
delete all the build directories in your project/modules
After that compile your project again (e.g. with the green play button) and you should be done.
I have a question. Is your gradle setting is in offline mode? Try turning it to online mode.
Also, just to add to above answer, Do you have any gradle dependencies with other project?
If so, also try cleaning those archives from your project folder within .m2 (maven) folder.