I just got a new laptop today and I am trying to get Android Studio working.
There was no problem installing it and I've got the latest JDK. I also
added the JAVA_HOME variabel to environment variables.
Problem: When starting android studio the loading bar is filled up and then nothing happens and I don't get passed the loading screen. Does anyone recognize this problem and know how to solve it?
Thanks!
I had the exact same problem, I uninstalled all versions of JDK and JRE that were installed on my computer and then installed the most recent 64 bit version. After that reinstalled Android Studio and now it is working great.
Related
I've installed the newest version of Android Studio with the installer on my Windows 10, currently it's version 2021.3.1.17 Dolphin.
Upon launching it, the splash screen appears and the little bar loads to the end and then it gets stuck indefinitely on that screen. All I'm seeing is this:
I've tried the following stuff already:
Completely uninstalling Android Studio, making sure all the files have been removed correctly before re-installing it (except the JetBrains folder, since I have other JetBrains stuff in it)
Re-Downloading the installer from the official Android Studio Website to make sure it was not corrupted.
Run as Administrator.
Was previously installed on a non-primary drive D:/, and I've also tried installing it on my primary drive C:/ just in case, same issue with C:/ installation too.
Ran studio.bat to see any errors, however, I'm assuming that bat file itself is buggy. It tells me that it does not find any JRE or JDK installation within the path. So to fix it I've set the newest Oracle JDK19 as my JAVA_HOME and the /bin accordingly, however, the studio.bat will then continue a long java error which seems honestly unfixable, so I won't even bother posting it here. Me setting the path shouldn't even be necessary, as Android Studio comes bundled with a JDK... and it should be using that one anyway.
So I'm out of things to try. I cannot make it work. My only lead was the Java error, but according to some Google search, I shouldn't even have to deal with it as it comes bundled with Android Studio. Looking into the files, there is indeed a jre folder within the Android Studio installation. Is it not using that one? What could be the reason that it is not using it if that is the case?
So, I was able to fix it myself after trying a few hours more. I've had also other Java installations (Java JDK 8, JDK 19) that interfered somehow with Android Studio. I've uninstalled everything related to Android Studio and I've uninstalled every Java version I had.
Additionally, I've removed every reference to Java or Android Studio from all of my system and environment variables. Also removed a path to Android SDK that was within my system variables.
After rebooting and installing Android Studio, it worked. Haven't installed any Java version so far, so not sure if the issues will return if I install my Java versions again.
I have a multi module Android Compose project. One module is an android app, others are android libraries or kotlin libraries. I'm running AS Artic Fox 2020.3.1 Beta 5 on MacOS 11.4 Big Sur.
After a library upgrade (probably AGP to use compose, I don't remember when exactly) Android Studio started to show syntax errors everywhere, both in .kts and .kt files.
Compilation and execution are working fine, only those weird JDK errors are displayed.
Here are some examples :
in a .kt file from a kotlin library module, in a .kts file from the buildSrc module
It seems that there is an error with the JDK somewhere, but I don't understand how to fix it.
I Googled/StackOverflowed before posting here and I already tried :
to check the JDK used Project Structure > SDK Location > Gradle. It is using the Embedded JDK 11.0.10
to reinstall AS using Jetbrains Toolbox
to invalidate cache and restart
to clone my project again
to delete ~/.gradle
But none of those actions helped...
Thanks in advance !
Update 22/07
I tried to create a new empty Compose project with .kts support, but no luck, everything is in red
Because of a bug preventing to update, I updated manually to RC_1. Here is my current setup.
I tried to change from Embedded JDK to a separately installed OpenJDK 11 and reimport but not luck (#alexey-belkov suggestion)
I checked the logs but found nothing obvious (#andy suggestion)
ℹ️ Finally I tried to create a new empty Android project with only .gradle support, and no errors ! Could it be a kotlin script plugin problem ?
This is the image of gradle daemon
This is the version of the android studio
and I have tried to change heap size in the gradle properties but it is not working.
I am really stuck on this issue because any project is not building and even when I was trying to build new project it is also not working.
I update to 4.2.1 on my Mac today, when I open up a project it starts an infinity loop of android studio windows of that project, had to hard restart my Mac.
The only way I was able to fix it, was by going back to 4.1.3.
For solving this problem in windows run this command in cmd.
setx _JAVA_OPTIONS -Djava.net.preferIPv4Stack=true
and this will work definetly.
Why won't Android Studio create a class?
It doesn't even work for newly created projects
Update
OR why are all of these empty?
The reason is you may have installed the 64 bit version on a 32 bit machine. I had the same problem. If you have 32-bit OS, try to uninstall 64-bit version of Android Studio and install 32-bit version from this page: https://developer.android.com/studio/index.html#downloads
I too faced the same Issue. Go to your Android Studio -> Help -> Edit Custom VM options. Add the following line to the opened file.
-Djdk.util.zip.ensureTrailingSlash=false
Source : Fix suggested by Wojciech Fred
To me, the problem was due to incorrect upgrade to new version of Android Studio. Studio patching seemingly went ok, but at Event Log, I constantly got this error:
2:55 PM FileNotFoundException: Entry fileTemplates//code/Google Test Fixture SetUp Method.cc.ft not found in /home/vlada/android-studio-145.3200535/lib/idea.jar
I also got similar message in 'IDE Fatal Errors' window.
Downloading and installing the latest version of Studio solved the problem for me.
After I updated to Android Studio 2.3, I haven't been able to use the embedded JDK. When I try to build the project, I get errors like this:
Error:The newly created daemon process has a different context than expected.
Java home is different.
Expecting: 'D:\Development\IDE\AndroidStudio\jre' but was: 'C:\Program Files\Java\jre1.8.0_121'.
Please configure the JDK to match the expected one.
Open JDK Settings
But the JAVA_HOME environment variable isn't defined, but I can still use the normal JDK any problems, so I don't believe that's a problem. Where does Android Studio find the JAVA_HOME that prevents me from using the embedded JDK?
I tried uninstalled the system JDK to get it to work, and I updated java, which lead to it pointing to the JRE. I then reinstalled the JDK and when I point to it, it works fine. But I want to use the embedded JDK. Any ideas?
I have tried setting JAVA_HOME in gradle.properties, as linked in comments, but it still shows the error.
The line I added was:
org.gradle.java.home=D:/Development/IDE/AndroidStudio/jre
It should make the embedded JDK work (and change JAVA_HOME in the IDE) but it doesn't. It still leads to the same error mentioned at the top of this post.
In the snippet it says jre, and that was because when I copied it, I had just uninstalled the JDK. Updating the JDK and Java resulted in JAVA_HOME being set to the JDK location, but it isn't defined as an environment variable. I tried deleting the JDK table in Android Studio's config folder, but it did not work.
And what it looks when I set the JDK to be the embedded:
Try to reset your path of your updated JDK. and check it again. May be it will help you. Also clear your android studio temp cache and all.
I fixed this issue by uninstalling all the jdk installation & updates then reinstall only one jdk and assure its env. variables
I do not have a solution but I have the same problem it happens as the android studio opens from java_home/jre thence all JVMs that will fork next will come from this path, while your system varible tells Gradle to get his java.exe from JAVA_HOME
I tried to make gradle read from jre but it falied also i tried to make android studio open from java_home/bin but it falid also
I had the exactly same issue with embedded JDK which was working on Android studio version 2.2.3 and when I updated then every time studio prompts JRE not found then I added system JDK path in project folder and now Whole Android studio hanging and I switched back to Android studio 2.2.3. It seems Android studio 2.3.1 is buggy release.
It seems ,There are some miss match of JDK version.
So Try this:
First Uninstall all Jdk/jre and Android Studio.
Clear temp/prefetch etc.
then Simply Install latest version of Android studio.
Remember: Don't install any other JDK/jre and make sure that your system have proper internet connectivity.All missing file automatically downloaded.
I had try this already and it was work for me .I hope it will also work for you.
I must say the AS has too many trouble in environment settings. There are some concepts we need to know.
AS default java runtime environment itself ,as shown below.
AS default java runtime environment itself.
System has another Java_home as shown below.
System's JDK version
Then problem is coming , what will happen when the system's JDK version doesn't match the AS's JDK version?
i.
java.lang.UnsupportedClassVersionError
ii.
gradle failure:certification ...
iii. There are some other error I couldn't remember now.
Solution:
If your AS update to latest version,you should update your Gradle to latest version,and make sure your system's JDK is match AS's JDK version. At least, your idk version update to more than JDK1.8.0. When you do all of this ,try to restart your AS ,if does works ,try to restart your computer.
Extra:
The proxy software has some influences when Gradle sync, if there are any tips about certificate ,try to close proxy software and try again.