After update to Android Studio 4.0.1, my total Android Studio stop working! The display cannot resolve symbol ‘AppCompatActivity’
and when click on AppCompatActivity display
When I click on Setup JDK open Select Project SDK Select any Android API and click the OK button nothing happens. If I click on the Configure button Configure SDK cannot be changed here.
If I want to open SDK Manager from Tools menu nothing opens. Also, the Settings option can’t be opened from the File menu.
But my previous version Android Studio works properly. But after I've updated all of my projects, the same problem persists. What can I do now? Please help me?
Somehow Invalidate caches and restart did not fix it for me. I had to manually delete everything from .idea/caches/ folder in the project's root folder. That did the trick.
Steps that worked for me:
[Windows+R] -> %USERPROFILE%
Delete folders .android and .AndroidStudio4.0
Open Android Studio, don't import settings, setup SDK anew (you can target it to where it already resides, so you wouldn't have to download it again), create a new basic project, check if it builds correctly. If it does, then your project will build fine as well.
I've resolved the issues while facing issues in some plugin not supported for android studio 4.0.1. Could you please check it and disable the plugin.
I hope it's working fine.
I faced same problem , delete file called ".android 4.0" from appdata and reopen android studio without load any configuration and start as new
I faced the same problem, but invalidating cache and deleting the .iml file and .idea directory (watch out for code styles, dictionary, etc) didn't help.
The problem was solved when I downgraded the Gradle plugin to classpath 'com.android.tools.build:gradle:4.0.0' (from 4.0.1) and then again set the project SDK as shown in OP's screenshot.
Related
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
from a week I was updated my Android Studio version to stable version 4.0.0 then I am started getting this errors in my studio and unable to build the app.
Unable to save plugin settings: The plugin org.jetbrains.android failed to save settings and has been disabled. Please restart Android Studio
But I forcefully enabled all plugins in my Studio by going to File-->Settings-->Plugins --> All are enabled.
Select Embedded JDK in Android Studio
Try that:
delete the .idea folder in the android project folder where you faced this problem.
Close Android Studio. Now navigate to your projects .idea folder and rename the workspace.xml file to workspace-o.xml and delete a workspace.xml~ if it exists (i.e., AS has a corrupt workspace layout file).
This should fix the problem. Restart AS and configure the workspace back they way you like it (i.e., it will start with a simple view: View/Tools Windows/Project etc.).
I started my first project in Android Studio and my answer may not be the correct one. I ran into this problem during building the My Activity project. It always came back with this error asking me to restart. Finally I thought that the controlled folder file access is preventing me. I temporarily switched-off the protection(against Ransomware in Windows 10) and tried the Build. I stopped getting these messages. But, I have other problems I am looking into.
I deleted the .idea folder and then I invalidated the cache (file-> invalidate Cache/Restart)
This fixed my issue.
I am getting this error:
Please configure Android SDK
Onclick of configure i getting one popup
After changing Build Tool Version on the pop screen
26.0.1 changed into 26.0.3 // else selected the highest available version
then click OK started working for me...
(or)
Simply Restart Andoid Studio File->Invalidate Caches and restart
FIX FOR 3.1.2 OR NEWER VERSIONS
I faced the same issue on Android studio 3.1.2, but a simple Sync didn't work for me.The solution was a bit different:
I go to
File -> Invalidate Caches -> Invalidate
File -> Close Project.
Remove the project from the Android Studio project selector window.
Quit from Android Studio(X)
Start Android studio and open project again
I consumed a few hours to fix this issue:
First Click 'Sync' gradle
Then clean and rebuild the application
And invalidate and restart
You can close this project first.
Then DELETE ALL temp file and generated file,
including .gradle, .idea, build in your project's root directory and also build in app path.
Finally, restart your project, problem should be solved. Good Luck !
After executing these two adb commands, it also works fine for me.
(1) adb kill-server
(2) adb start-server
I had the same issue and tried all of the above and it did not help.
I ended up closing everything and rebooting my Mac.
Reopened Android Studio and it was back to normal :)
In build.gradle (Module: app) I changed "compileSdkVersion 23" to 26
Then it works.
Maybe also work for you.
For me solution was to sync project with gradle files.
Please Help, Android studio is not working and this error is comes.
I also reinstall the android studio but same error is comes.
I got the solution of the my problem.
Uninstall Android studio totally from the system.
Restart the system.
Go to C:\Users\
Delete .android, .AndroidStudio2.3, .gradle folders. If folder not deleted then change the name of this folder.
Now, Reinstall the android studio.
And then you problem will solved. This is work for me.
I got the solution there no need to Uninstall Android studio simply We need to do only one thing :
go to "file" and click on "Invalid caches\ Restart" option.
Don't uninstall your Android studio.
Rather try Like #Anjali has suggested.
go to "file" and click on "Invalid caches\ Restart" option.
If it doesn't work, close your Android studio and
Delete .android, .AndroidStudio2.3, .gradle folders. If any folder is not deleted then change the name of that folder.
And simply restart your Android studio. It has worked for me.
There is no need to uninstall Android Studio and maybe an issue occurs during the Gradle build time and Gradle cannot load data in the metadata folder or you have multiple data folder in the Gradle file.
Follow the below steps
Go to "C:\Users\PC\.gradle\caches\modules-2"
Close the Android Studio
Delete any metadata folder available from that listing or you can delete or rename the metadata folder as per your project given the error.
Start the android studio and ensuring that you have internet connections
Wait for Gradle to download some files and sync then
Everything should work well after doing that
I have followed the above steps and got success.
In my case this issue solved by just restarting my machine. My project was on 'D:' drive and this drive was getting corrupted and showing a message like 'unable to read files system'.
You can delete this file manually from Linux if you have it installed alongside windows
In my case this issue solved by just:
1- Open This PC, right-click the partition you want to scan, and choose Properties from the menu.
2- Navigate to Tools tab and click the Check button.
3- Check Automatically fix system errors and click Start.
Today I've installed Android Studio Canary 1
Now I cannot run my app. This following dialog appears.
I've already set the right SDK location through File-> Project Structure-> Android SDK location.
Expecting your help to solve this problem.
Warning Dialog image:
Go to project structure settings and set Source Compatibility and Target Compatibility to your current java development kit version:
Just you need to sync your project file with your gradle file.
File -> Sync Project with Gradle Files
I tried every answer in this post but my problem only got resolved when I made these steps:
File -> Close project -> Remove project -> Open existing project (same
project)
Maybe this will save a morning to another person with the same bug.
EDIT
This happened to me a lot on a MacBook. After I posted this answer it just kept happening so what I did was:
uninstall the Android Studio version I had from the App Store;
download the desktop stable version from Android Studio website;
start using the desktop version of Android Studio.
Never happened again.
Sometimes the SDK path will be incorrectly configured. You would need to fix it.
To Settings/Preferences( command + , on mac).
Search for SDK
Under Android SDK, click on edit and point it the root of sdk directory on your file system. (If ther is no SDk installed then install in from the below list).
i suggest you go to build.gradle and sync again.
Or Tools -> Android -> Sync Project with Gradle Files (Android 3+)
You need to insall SDK api 19 check this out.
https://developer.android.com/studio/releases/platforms
Go to sdk manager and install sdk according to your device and check your device api. Example if your device is jellybean then install api 19 sdk.
Go to Tools> Android > SDK Manager and make sure you have selected default Setting under System Setting. In this image I have selected Android 7.1.1 as default SDK
Just click on the button ..."Sync Project with gradle file"
Error will be remove
I had the same problem and what it worked for me was just sync with gradle.
I just did what I've found in this similar question:
How do I "select Android SDK" in Android Studio?
The original answer:
go to build.gradle and click sync now. Then it worked.
Update :
File -> Sync Project with Gradle Files (Android Studio 3.1.1)
Tools -> Android -> Sync Project with Gradle Files (Android Studio
3.0.1) Or You can click on the icon from the toolbar.
Sync Project Icon
This answer may not help works for later version as Android studio Team work on making the tool more better, the way to sync may be
different in the next version of Android Studio.
COMMON WAY that may helps is try to sync project and then Invalidate
Caches and Restart Android Studio.
Solution for Android Studio 3.1.2
Before that, by the way, I had invalidated cache and restarted too, but it didn't work.
Please, try and let us know.
P.S.
I had this problem after I imported a project from Git, just in case someone would like to replicate.