I develop one application into Android Studio and when close and open Android Studio.
When open android studio I see red lines with of android studio and not found SDK and I can't write any code!
My Android studio error image :
How can I fix it? please help me
Delete this all four folder's and rebuild againand also check your local.properties file "sdk.dir=/Users/macbookpro/Library/Android/sdk"
Try to clean your project:
Tab Build -> Clean Project
Related
Android Studio 3.4.2 can't open project on macOS 10.15 Beta (19A526h)
Open Android Studio -> press Open an existing Android Studio project -> select folder with project -> NOTHING happens
I can create new project though, but can't open existing one.
Is there anything i missing here? Any help is appreciated.
I have met the same problem. It works by dragging folder onto AndroidStudio directly.
I made it easier to open projects with Finder by associating all settings.gradle files with Android Studio and then launching that file to open a project. (I'm on Android Studio 4.2.2)
I find that Android Studio's behavior with launching project files is inconsistent. If you don't have any project open and you launch a project's gradle.properties file with Android Studio, then it will open the whole project, BUT if you do this when another project is open then it will just open the gradle.properties text file in the already open project! However, for some reason this issue is avoided with settings.gradle -- it always opens the whole project even if another project is already open.
This problem occurs with macbook M1 macOS monterey. I solved this by,
Open Settings in Android Studio
Select Edit Custom VM options..
Add this line to it: -Dide.mac.file.chooser.native=false
Restart Android Studio
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.
I recently updated from Android Studio 2.0 to 2.1.2 and now I have a project which doesn't open. Android Studio is stuck at the following screen for more than 10-15min.
I tried solutions from these answers.[ans1] [ans2]
but none of them work.
I can create new projects and also import projects built on eclipse. But cannot open my own project.
Please help.
Delete the gradle folder in the project folder. It will work.
For many problems such as stuck with opening or downloading something while starting
I use this sequence as an ultimate guide and on one of the steps always works out.
Recently I used it after updating to 3.2
Try File -> Invalidate caches / Restart
Shutdown Android Studio
Remove .gradle folder in the user home directory
Start Android Studio (Studio will download gradle data)
After Gradle build is done, rebuild project
According to Android Studio's Known Issues https://developer.android.com/studio/known-issues under "Configuration on demand with Gradle 4.6 and above:", if you are using Android Gradle Plugin 3.0.x or 3.1.x with Gradle 4.6 and above you should add the following line to gradle.properties:
org.gradle.configureondemand = false
This seemed to solve my issue with Android Studio getting stuck at "Project setup: reading from cache".
I have Error on create Project in Android Studio
Error:Execution failed for task ':app:prepareComAndroidSupportAnimatedVectorDrawable2320Library'.
Could not expand ZIP 'D:\program\android_sdk\extras\android\m2repository\com\android\support\animated-vector-drawable\23.2.0\animated-vector-drawable-23.2.0.aar'.
How to fix it? Thanks
Try ,
Check whether you have write access on both the android sdk and
Android Studio directories.
if you are on Windows OS, also try to run Android Studio as
Administrator by right clicking on the Studio's icon.
run Android Studio as Administrator and check if your project setting is properly set ~~this error occurred for me, it was because i directed to wrong sdk folder
I'm using the latest version on Intellij for programing and developing Android. After installing and tring to create project for first time, Intellij doesn't create a main files/folders and manifest and I don't have them in the project. Please see screen shot:
I tried to do file - invalidate caches/restart and tried to define the Android SDK again, but my problem doesn't resolve.
Be sure that you follow all this steps:
https://www.jetbrains.com/idea/help/creating-a-gradle-android-project.html