Update Android Studio 4.1.2 to 2020.3.1 failure - android

I'm trying to update Android Studio 4.1.2 to 2020.3.1, update fails and suggest to read idea_updater.log. Here's the dialog box prompted during update:
The only relevant error I can found is this one:
03/08 13:57:57 INFO DeleteAction.doApply - Delete action. File: C:\Program Files\Android\Android Studio\jre\jre\bin
03/08 13:57:57 INFO DeleteAction.doApply - Delete: C:\Program Files\Android\Android Studio\jre\jre\bin
03/08 13:57:57 ERROR Patch.apply - apply failed
java.io.IOException: Cannot delete: C:\Program Files\Android\Android Studio\jre\jre\bin
at com.intellij.updater.Utils.tryDelete(Utils.java:115)
at com.intellij.updater.Utils.access$000(Utils.java:12)
at com.intellij.updater.Utils$1.postVisitDirectory(Utils.java:77)
at com.intellij.updater.Utils$1.postVisitDirectory(Utils.java:68)
at java.nio.file.Files.walkFileTree(Files.java:2688)
at java.nio.file.Files.walkFileTree(Files.java:2742)
at com.intellij.updater.Utils.delete(Utils.java:68)
at com.intellij.updater.DeleteAction.doApply(DeleteAction.java:71)
at com.intellij.updater.PatchAction.apply(PatchAction.java:213)
at com.intellij.updater.Patch.lambda$apply$3(Patch.java:406)
at com.intellij.updater.Patch.forEach(Patch.java:454)
at com.intellij.updater.Patch.apply(Patch.java:399)
at com.intellij.updater.PatchFileCreator.apply(PatchFileCreator.java:116)
at com.intellij.updater.Runner.install(Runner.java:381)
at com.intellij.updater.Runner._main(Runner.java:180)
at com.intellij.updater.Runner.main(Runner.java:41)
Caused by: java.nio.file.FileSystemException: C:\Program Files\Android\Android Studio\jre\jre\bin: Impossibile accedere al file. Il file è utilizzato da un altro processo.
at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:86)
at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97)
at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102)
at sun.nio.fs.WindowsFileSystemProvider.implDelete(WindowsFileSystemProvider.java:273)
at sun.nio.fs.AbstractFileSystemProvider.delete(AbstractFileSystemProvider.java:103)
at java.nio.file.Files.delete(Files.java:1126)
at com.intellij.updater.Utils.tryDelete(Utils.java:89)
... 15 more
it seems that it's unable to remove C:\Program Files\Android\Android Studio\jre\jre\bin folder since it's locked from another process.
At the moment the error dialog appear the folder cited above is empty (before update holds 55 files and 3 folders).
But AFAIK there are not other processes trying to use any resource in Android Studio while the update is running.
Tried several times with the same result. Any hints? Should I remove Android Studio and try a fresh new install?

Download a fresh JRE and install it to another folder NOT below your android studio folder
for latest openJDK as of date (my favorite), download it here
restart windows in safe mode
delete the c:\program files\android\android studio\jre and its subfolders
restart windows to normal mode
run Android studio and pick the fresh JRE folder you've just installed
try the update again

I've not been able to find any lock on such folder. I needed to uninstall 4.1.2 and reinstall 2020.3.1 (everything worked).

Related

Android Studio (version 2022.1) Unable to find bundled Java version

I have been struggling facing that problem in Android studio using Flutter.
Any solution for that issue?
I am using Windows 10 and tired of searching for that problem and fixing it.
If you installed Android Studio Electric Eel | 2022.1.1
For Windows Users,
Open the terminal and open to the android studio directory
Like,
cd C:\Program Files\Android\Android Studio
Then,
mklink /D "jre" "jbr”
copy the content of jbr and paste the content into jre folder
To resolve the issue after completing the above change, just create a sym link jre -> jbr.
run doctor this commend ‘flutter doctor’ again and the problem is solved.
Follow these steps.
Go to C:\Program Files\Android\Android Studio
Go into the jbr file, copy all of them and paste them into the jre file
Run flutter doctor.

Why "Failed to load JVM DLL"?

I updated android studio from Dolphin to Electric Eel and now it won't start, giving the following error message:
Failed to load JVM DLL C:\Program Files\Android\Android Studio\jbr\\bin\server\jvm.dll
If you already have a JDK installed, define a JAVA_HOME variable in Computer > System Properties > System Settings > Environment Variables.
I already have JAVA_HOME set but tried different paths, different java versions, uninstalling, installing, etc.
Tried deleting all the caches I could find (probably missing something).
Tried uninstalling android studio multiple times, or going back to the older version and updating again.
While on the older version - tried to change the JDK that the studio was using and then update.
Nothing of the above works.
After some Windows updates, I faced the same problem. Download a fresh copy of JetBrainsRuntime and replace the C:\Program Files\Android\Android Studio\jbr folder with this new one.
Edit:
There's a workaround mentioned here. It worked for me.
It says to install Microsoft Visual C++ Redistributable
Installing it provides a "missing vcruntime140_1.dll file in bundled Java Runtime" to the Android Studio.
Old answer:
I "solved" it by deleting the jvm.dll file in C:\Program Files\Android\Android Studio\jbr\bin\server.
Then it started actually looking up the JAVA_HOME variable and the studio launched.

Android Studio 3.1.3 path error

Android studio 3.1.3 isn't running and displaying error posted below(image). I have set the jdk path in "Environment Variables" but still the problem persists. Reinstalling Android Studio after deleting the user data isn't helping. Do post other alternative way to fix this.
p.s.- I have changed jdk version from settings in Android studio to a more latest version(i.e. 1.6 to 1.8). On restart of A.S. the problem started.
I installed AS 2.1.3 removing AS 3.1.3, A.S. 2.1.3 is working fine.
Error message:
Failed to create JVM:error code -1
JVM Path: C:\Program Files\Android\Android Studio\jre\jre
If you already have a 64 bit JDK installed, define a JAVA_HOME variable in
Computer >System properties> System settings> Environment Variables.
Here is an image for help:
Open Control Panel
Click on System
From the left chose Advanced system settings
Click on Environment Variable
Under the System Variable try to find JRE_HOME if exist, change the Variable Value where you install the java and then select the jre folder, if not exist, add new variable with JRE_HOME for Variable Name and where you install the java and then select the jre folder for Variable Value.
try to run the Android Studio

Gradle sync failed Invalid Project Jdk

Getting fed up with this problem, heard android studio is better than eclipse in many ways, but I cant even start a single project with it because of this error, tried many solutions still its showing same thing, First i thought it was only when importing old eclipse project, but its not.
1) I tried uninstalling every jdk and jre and installed latest JDK 1.8.0_65 and set all paths and JAVA_HOME
C:\Users\username>java -version
java version "1.8.0_65"
Java(TM) SE Runtime Environment (build 1.8.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.65-b01, mixed mode)
C:\Users\username>javac -version
javac 1.8.0_65
C:\Users\username>set JAVA_HOME
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_65
2) Reinstalled android studio
3) Updated all sdk using sdk manager
still if i try to start a new project, i am getting the error
8:10:45 PM Invalid Project JDK
Please choose a valid JDK directory
Open JDK Settings
8:10:45 PM Gradle sync started
8:10:45 PM Gradle sync failed: Invalid Project Jdk
JDK Location by default it is showing C:\Program Files\Java\jdk1.7.0_10, And i am changing it to C:\Program Files\Java\jdk1.8.0_65, But seems like its not getting applied.
By the way, I am using 64 bit windows 7 and installed 64 bit java.Hope someone can guide me from this mess, its been few night am wasting time on this.
Adding screenshot of my JAVA_HOME
Below is the screenshot of JDK location that is showing inside android studio
In Android Studio 1.5.1, this error was shown in red: "Android SDK location should not contain whitespace, as this can cause problems with the NDK tools." The problem was never with the JDK location. It was with the SDK Location.
I moved the SDK folder out of Program Files because of the whitespace, changed D:\Program Files\Android\sdk to D:\Android\sdk, and the JDK location then stayed. Android Studio does not seem to like saving the JDK location value if there is an error with the SDK location.
Don't use cmd line, just do it normally.
if you use a error path, it will warn you .
go to your
C:\programFiles\Java
copy your Java folder
then go to your
C:\programFiles(x86)
paste the files there.
then go back to your androidstudio change your JDK directory to this
C:\programFiles(x86)\java\jdk1.8.0_74.
"mine is jdk1.8.074 yours might be different, put whatever yours is"

Android installation/SDK Manager issues

I have downloaded android-sdk_r08-windows.zip and installed it in c:\. When I try to run the SDK Manager, it briefly pops up a DOS window then closes. Trying to run adroid update sdk results in a null pointer exception. I have tried uninstalling/reinstalling the SDK for both android and java multiple times. This is on windows XP SP3. Any ideas?
Thanks,
John
C:\android-sdk-windows>java -version
java version "1.6.0_23"
Java(TM) SE Runtime Environment (build 1.6.0_23-b05)
Java HotSpot(TM) Client VM (build 19.0-b09, mixed mode, sharing)
C:\android-sdk-windows>tools\android.bat update sdk
[INFO] Starting Android SDK and AVD Manager
No command line parameters provided, launching UI.
See 'android --help' for operations from the command line.
java.lang.NullPointerException
at com.android.sdklib.internal.avd.AvdManager.parseAvdInfo(AvdManager.java:1155)
at com.android.sdklib.internal.avd.AvdManager.buildAvdList(AvdManager.java:1134)
at com.android.sdklib.internal.avd.AvdManager.<init>(AvdManager.java:376)
at com.android.sdkuilib.internal.repository.UpdaterData.initSdk(UpdaterData.java:230)
at com.android.sdkuilib.internal.repository.UpdaterData.<init>(UpdaterData.java:107)
at com.android.sdkuilib.internal.repository.UpdaterWindowImpl.<init>(UpdaterWindowImpl.java:86)
at com.android.sdkuilib.repository.UpdaterWindow.<init>(UpdaterWindow.java:54)
at com.android.sdkmanager.Main.showMainWindow(Main.java:297)
at com.android.sdkmanager.Main.doAction(Main.java:260)
at com.android.sdkmanager.Main.run(Main.java:99)
at com.android.sdkmanager.Main.main(Main.java:88)
Apparently my system had a residual .android folder lying around from when I played around with the android SDK over a year ago. Renaming that file resulted in the SDK Manager coming up.
Make sure the JDK path is added to the Environmental variables.Its usually happenes when a JDK/JRE uninstall is succeeded by another JDK install
Have you installed the JDK, rather than the JRE?
Also, check that your JAVA_HOME variable points to your JDK install path.
instead of opening android sdk manager open android.bat in tools folder. i think it is sdk\tools
You need make sure that:
1) JDK or JRE is installed
2) Within System Variables, the JAVA_HOME variable is set to your JDK/JRE folder (e.g. C:\Program Files\Java\jre7)
3) Your PATH variable includes %JAVA_HOME%\bin

Categories

Resources