I am trying to implement my android studio but i ve encountered a problem and now i can't open my Android Studio Environment .I got a dialog with an error message saying : Failed to load JVM DLL C:\Program Files\Android Studio \jbr\bin\srver\jvm.dll
If you already have a JDK installed , define a JAVA_HOME varible in Computer >System Properties >System Settings >Environment Variable ... I've checked and i've already have define a JAVA_HOME variable. How can i solve this ?
Related
My operating system is Pop!_OS 20.10. I am simply trying to run a flutter project, which I created on IntelliJ, on my android device using IntelliJ IDEA. The build is being completed without any errors but when running the app, it says that my JAVA_HOME variable is set to an invalid directory:
Launching lib/main.dart on Mi A2 in debug mode...
Running Gradle task 'assembleDebug'...
ERROR: JAVA_HOME is set to an invalid directory: /app/extra/idea-IU/jre64
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.
Exception: Gradle task assembleDebug failed with exit code 1
SDKs installed on my platform settings are openjdk-15.0.2, corretto-1.8 and Android API 30 Platform. I didn't manually altered any environment variables before getting this error. After this, I tried to add JAVA_HOME variable to ~/.bashrc and /etc/environment files to point my JDK installation folder like this:
JAVA_HOME="/usr/lib/jvm/default-java"
and also tried with my current java installation:
JAVA_HOME="/usr/lib/jvm/java-11-openjdk-amd64"
but no luck. I did a lot of research and really don't know what to do at this point.
There are two possibilities
1 - Your flutter sdk is may be some old version. Run flutter upgrade to update your flutter sdk.
2 - You might not have installed JDK or the JDK Path is not set in Environment Variables.
This is to caution you that this is my first time Programming in Android Studio.
I have installed Java SDK V8 (even tried V14 with the same result) before installing Android Studio 3.6.2
I input the Java_Home Variable in the environment variables
Running on Windows 10 x64 Bit
I have downloaded the IDE twice tried deleting and reinstalling the IDE and Java but I keep getting the same error. The two pictures are attached in sequence of when the errors occur. I didn't even see the android application. It occurs as soon as I open the app.
Please help me.
First Error
Second Error Message
Environment Variables 3
Environment Variables]4
Environment Variables]5
Currently I am trying to set up my Android Studio environment for Flutter and I am unable to update sdkmanager or else I would obtain the following errors :
This error affects the rest of my tools folder (sdkmanager,avdmanager, basically any .bat I run within that folder) as well.
What I have tried:
Clean installed and reinstalled Android Studio numerous times
Uninstalled and reinstalled Java numerous times (Version 13)
Change parts of my sdkmanager.bat and android.bat based on the other stack overflow questions--since this did not work, I reverted them back to the original code
Run as admin with command prompt and powershell
Installed JDK 8 because Flutter doesn’t like other versions of Java
Changed my environmental variables -these are the variables in relation to Android Studio and Java as of now
CLASSPATH - %JAVA_HOME%\lib;
JAVA_HOME - C:\Program Files\Java\jdk-13.0.1
PATH - C:\Users[username]\AppData\Local\Android;C:\Program Files\Java\jdk-13.0.1\bin;C:\Windows\system32;C:\Users[username]\Documents\flutter\bin;C:\Program Files\Git\git-cmd.exe;
Updates
For majority of the .bat files, %JAVA_OPTS% is causing the issue, I’ve tried to set a JAVA_OPTS variable but that does not help
Solution
I deleted %JAVA_OPTS% from the .bat file and it seems that was the issue, but I don’t think I’m supposed to delete that part.
Setting JAVA_OPTS causes issues on using JDK versions lower than 11 as mentioned on this issue thread. Removing this should resolve the issue. Another workaround to prevent similar issues is to use the JDK bundled with Android Studio.
I have installed Android studio 3.0.1 and when i run the app he gives me an error
Error running App: No JDK specified
Note that i have installed JDK 9 and I made two environment variable JAVA_HOME and JDK_HOME and edit path variable
and in project structure I choose JDK 9 but I am also failed to run!!
Try following, it did work for me:
Go to File -> Project Structure -> SDK Location and check if the path for SDK and JDK location specified by you is correct. If its not then set the correct path.
For me it looks like this:
Android SDK location:
C:\Users\JDoe\AppData\Local\Android\Sdk
JDK location:
C:\Program Files\Android\Android Studio\jre
Installing AndroidStudio 2.0 on OS X El Capitan: if I install JRE 7 from http://www.oracle.com/technetwork/java/javase/downloads/jre7-downloads-1880261.html, I will not receive Public Updates; if I install JRE 8, Android Studio complains that it cannot use secure connection to receive upgrades:
Is there a way to convince AS that JRE 8 is not JRE 6? If impossible, which compromise is preferable: downgrade to JRE 7 and establish secure connection for Android Studio upgrades, or keep the latest JRE and wait for Android Studio fix?
From the documentation, by default Android Studio is launched from java 6: http://tools.android.com/tech-docs/configuration/osx-jdk
As it is mentioned you can export an env variable to indicate Android Studio what jdk to use :
export STUDIO_JDK=/Library/Java/JavaVirtualMachines/jdk<version>.jdk
In order to keep this env variable accessible from the GUI, you can add the following line to your ~/.profile file :
launchctl setenv STUDIO_JDK /Library/Java/JavaVirtualMachines/jdk<version>.jdk
Hope it helps.
Another solution for OSX: go to the Applications folder, right click on Android Studio, choose "Show Package Contents".
Open the Info.plist file. Locate the JVMVersion key, and set the string value you need.
In my case, I needed to be 1.7 and up to be able to run the RoboVM plugin, and the value was 1.6*,1.7+, so I left it only on 1.7+.
Restart Android Studio and it should be using the version of the JVM you need.
This works if you have root access on your Mac.
refers to Android Studio IDE with private jre/jdk? OSX
In Android Studio 2.1.2 and below,the default settings is '1.6*,1.7+'.
In the latest version of Android Studio(2.2 Preview 7),the default settings is '1.8*,1.8+'.