Android studio automatically closes after opening - android

My Android studio is closing automatically. I have tried setting up JAVA_HOME in environment variables.But it doesn't work at all.Any problem with my SDK or java version?Currently I have both 32bit and 64bit of java JDK 8..But it doesn't work for both.Can someone resolve it soon..I have been trying it for 2 days..

Just uninstall android studio and download the .exe installer file for it here and try reinstalling it, if it doesn't still fix the issue, tell me again, else mark the answer as correct.

Related

Unknown attribute for known attributes in xml files

I recently installed Android Studio on my Desktop running Ubuntu 17.10. However, when I open any Android Studio Project or even create a new Project, while editing XML files, it wrongly displays an "unknown attribute" error. Normally, I wouldn't care, but this causes Android Studio to not give any suggestions for attributes which I need.
What I've tried:
Invalidating cache
Deleting the .iml file and rebuilding project
Rebuilding and cleaning project several times
Deleting gradle's cache
Updating Android Studio (Current Release is Android Studio 3.1)
Here is a screenshot of what's happening
Try doing a gradle sync. It should resolve the problem
I´ve tryed all the solutions but the only thing that worked for me was 4gus71n's answer.
Deleting the C:\Users.AndroidStudio3.2\system\caches folder solved my problem.
Link to his answer: https://stackoverflow.com/a/53160674/6568421
Use project's SDK not Android's SDK. You can edit SDK Location in local.properties file
I had faced similar issues and all the above also did not worked for me.
If all else failed, do a clean install of android studio. You need to do a clean installation because if you just uninstall and install again, some of the files still remains in your system. It did not work for me when i just uninstall and install android studio. The clean install worked for me and I believe it should solve most of the problems.
I faced this error probably because i installed an entire android project but I am not very sure what is the exact error that caused this problem.
For clean installation, you can look at this links for windows and mac
How to completely uninstall Android Studio from windows(v10)?
How to completely uninstall Android Studio on Mac?

Android studio doesn't start on windows 10

I bought a new laptop and tried to install Android Studio, but It doesn't start.
I set the right path of "JDK_HOME" and "JAVA_Home" in the environment cariables.
Checked if the Java.exe doesn't exist in C:\Windows\System32
When trying to start Android Studio it shows the process in the Task Manager and disappears instantly.
My JDK Version is 1.8.0_121.
You don't need JDK_HOME and JAVA_HOME
delete one of them should solve your problem. android studio might got duplicated configuration.
If problem remains remove android studio and reinstall it.

Error: Please provide a path to the Android SDK

After installing the Android studio and launching it I am getting this error.
I cannot specify the path to the SDK. I have tried giving the path as :C:\Development\Android\android-sdk-windows\platform-tools\" but the path is invalid
Try this:
close this box then
Tools -> Android -> SDK Manager
I encountered this problem when installing Android Studio 3.0.
There was in fact no folder named C:\Users\Your Name\AppData\Local\Android\Sdk after I installed Android Studio. I tried installing the Android command line tools at this location, but android studio did not accept this. (Turns out, the command line tools are not the SDK.)
Managed to fix it by doing a complete uninstall of Android Studio, deleting the C:\Users\Your Name\AppData\Local\Android folder, deleting any Android Studio settings folders (in my case C:\Users\Your Name\.AndroidStudio2.3 and C:\Users\Your Name\.AndroidStudio2.3). After reinstalling and opening Android Studio, it gave me a dialog to download the SDK.
I can think of 2 possible explanations why this worked for me:
Originally, Android Studio was opening a project straight away, which didn't trigger the "download your sdk" dialog. (This no longer occurred since I deleted my Android Studio settings.)
There was some kind of setting that made Android Studio think I already had the SDK downloaded.
Try this - C:\Users\Your Name\AppData\Local\Android\Sdk
Replace Your Name with the name of your PC.
This problem is usual after you update, or reinstall the Android Studio.. Follow these steps-
* Close all the opened project which is opened by default after you started the Android Studio.. and again open the Android Studio, it will direct you towards re-downloading of SDK components from the net (So be sure to have net connectivity at this point)..
* If above step doesn't work, then restart the PC and open Android Studio again..
Hope it will help..
C:\Program Files (x86)\Android\android-sdk
Hope this will work.
I was also stuck with this...i tried everything mentioned above, but could not get through.
Then I was about to uninstall and reinstall the IDE as mentioned above.
When I was about to uninstall, to my surprise, I found Android SDK Tools in control Panel -> Programs and Features, which was the thing I was looking for!
Android SDK Tools in Control Panel -> Programs and features
I didn't know how to find the path of that, because even after searching in my computer, I didn't get it. So, I went on further and clicked on uninstall.
There, I found the path of Android SDK Tools "C:\Program Files (x86)\Android\android-sdk\". I did not uninstall anything.
I linked this path in the dialogue box, the error was gone!
Whoever encounters the same error, should look for the "Android SDK Tools" in the programs and features in control panel, and then go for uninstalling the same.
There you will find the path of the tools folder.
Copy and paste that path, and you shall get through.
When installing Android Studio on my Mac I accidentally cancelled the dialog box that would normally have installed the SDK. To fix this I deleted Android Studio from /Applications, and deleted the following folders:
% cd $HOME
% rm -rf Preferences/AndroidStudio3.4
% rm -rf Logs/AndroidStudio3.4
% rm -rf Caches/AndroidStudio3.4
% rm -rf Application\ Support/AndroidStudio3.4
(Adjust the version number for your version.) I then reinstalled Android Studio and let it guide me through the SDK installation process.
In case anyone get to experience the same weird situation as me:
I had installed Android Studio, had projects saved, but for some reason I had to do reinstall Windows (and during that I deleted my "Android-folder" in ".../local". When you do that, you will encounter the exact same pop up.
No worries, close it and even though it says that it is needed, it's not. You just don't have access to the prior projects. When saving the new one, then everything will be OK.
The problem was solved by downloading the SDK again, in my case I had deleted the SDK folder that was in C:\Users\george\AppData\Local\Android\Sdk, because I deleted it then I had to download the SDK
I just reinstalled Android Studio (everything) C:/user/yourName/.androidStudio.4 and C:/user/yourName/.androidStudio.4.
You dont have to delete your projects folder!
In my case, going to the Settings menu in Android Studio, there I could download the SDK (none were installed) through the "edit" button
I got this error when moving a project from one computer to antother, even though it wasn't an Android project and didn't need an Android SDK.
The solution for me was to open the file local.properties and remove the line that says sdk.dir. Hope this can help someone.
All you need to do is close the project opened in android studio. This error occurs when you reinstall Android Studio. The previous project that you have been working on will be opened by default. Select that folder from file explorer and move into different location and then again launch Android Studio. The SDK installation will begin thereafter.
The Reason that why Android Studio can't install/find SDK automatically:
As I tried many times for reinstalling Android Studio, but each time I faced with this SDK popup. I figured out that after installing, Android Studio seeks for project folder automatically (usually located in C:\Users\Username\AppData\AndroidStudioProject) to syn previous settings, gradle, SDK path, Android Studio Settings etc. When I deleted this folder (if you need your previous projects copy it somewhere for latter replacement) the usual installation has been started after clicking on install.
I just encountered this issue when updating my Android Studio after a couple of years of not using it, and the solution ended up very easy:
I exited the window with the SDK prompt and closed the old project it was trying to open. Once the project was closed, the IDE was able to prompt me with the download window, and there SDK download worked!

Android Studio doesn't launch: Could not find or load main class com.intellij.idea.Main

Being new in Android devopmnet, I have been using Android Studio for development, but suddenly it doesn't work anymore.
The program doesn't launch anymore, and If I execute the studio.bat from Command Prompt, I get the following error:
Error: Could not find or load main class com.intellij.idea.Main
I have seen other posts about Android Studio not launching (e.g. this and this), but neither of them solve my problem. I have set PATH variables for both JAVA_HOME and JDK_HOME correctly to C:\Program Files\Java\jdk1.7.0_07
As I have mentioned, Android Studio used to work and I don't have any idea why it has stopped working. Any clue?
For android studio 1.3.1
go to environment variable and create new variable and give it a name JAVA_HOME and in path use this C:\Progra~1\Java\jdk1.7.0_71.
I hope that can help you.
if you have just used copy paste of exe file it will show this message so go in Program Files\Android\Android Studio\bin and click on exe file.
I had the same issue after updating the Android studio. I was not able to launch it from click on Android Studio icon and after running ./studio.sh it was giving me same error
I follow the below step and solved the problem.
I downloaded the studio and install it in the new directory.
After installation success, copy all the files & folders and paste and replace it into old location where studio was installed.
Having JAVA_HOME set to point latest JDK version (C:\Program Files\Java\jdk1.7.0_79) will make the Android studio work. Make sure the path is correct. Seems that JDK_HOME is not needed.
can refer Installing Android Studio (Not working)
If you have recently uninstalled and reinstalled Android Studio and had previously pinned the Android Studio icon to your Task Bar or Start Menu, it may be that this icon no longer looks for the new installation.
Delete it and re-pin it and all will be fine.
I faced the same issue while launching the studio.exe file. The actual problem was I have downloaded the 64-bit version of Android studio. But my computer supports only 32 bit.
So I downloaded 32-bit version and installed.
Now it is working fine.
Well after searching allover the web, failed to get solution till i decided to reinstall android studio. same folder changed nothing didn't delete anything just reinstalled and boom works as before
This happens when you update Studio and new version is installed and previous one is in process of deletion: at the main time if PC shut down or suddenly crashed due to power cut etc. Then this problem will appear:
could not find main class com/intellij/idea/main
Solution:
Go to this path "C:\Program Files\Android", there you will find two Android Studio Folders.
Find which one is latest: (Latest name wold be "Android Studio1") && (Old version would be Android Studio)
Delete old one(if you don't need it any more) and launch latest exe on this path:
C:\Program Files\Android\Android Studio1\bin
Open the Installer and download it again and you can select delete previous versions to clear confusion.
Open studio64 instead of studio
I found Answer: you just make wrong shortcut(just ctrl+C ctrl+v) for launchfile(exe). You must make shortcut following this method:
Right mouse click and select make shortcut menu.
Please follow the below steps,
Go to My Computer -> Properties -> Advance System Settings
System properties window will appear
Go to Advance tab -> Environment Variables -> New
Add or update JAVA_HOME path as expected.
Optionally you can also add or update JDK_HOME if you have JDK installed in your PC

Android Studio can't find Java SDK in Windows 8

The new Android Studio has a strange problem when you run the installer in Windows 8. Even after installing the Java SDK and setting JAVA_HOME it still complains that it cannot find Java, which it is looking for under C:\windows\system32. The only solution I've found is to delete java*.exe from system32, but obviously this is not ideal (although you can replace them from the sdk dir afterwards). Is there something I'm missing? Also does anyone know why those 3 java exe files end up in System32 in the first place?
I had exactly the same problem.
Probably, you have java.exe in C:\Windows\System32 folder.
Rename this file and try installing again.
BTW, there are few related posts to check out.
Android SDK installation doesn't find JDK
Android studio doesn't start
Try opening Android Studio through the App menu instead of the file manager.

Categories

Resources