Android Studio crashes on startup (64 bit, Windows 10) - android-studio

Each attempt to start Android Studio gets the same results -
Internal error. Please refer to https://code.google.com/p/android/issues
java.lang.NoSuchMethodError: com.intellij.ide.plugins.PluginManagerCore.loadDescriptors()[Lcom/intellij/ide/plugins/IdeaPluginDescriptorImpl;
at com.a.a.b.b.ar.a(ar.java:121)
at com.a.a.b.b.ar.a(ar.java:71)
at com.intellij.idea.MainImpl.start(MainImpl.java:19)
at com.intellij.idea.StartupUtil.startApp(StartupUtil.java:303)
at com.intellij.idea.StartupUtil.prepareApp(StartupUtil.java:245)
at com.intellij.ide.plugins.MainRunner.lambda$start$0(MainRunner.java:47)
at java.lang.Thread.run(Thread.java:748)
-----
JRE 1.8.0_242-release-1644-b01 amd64 by JetBrains s.r.o
C:\Program Files\Android\Android Studio\jre\jre
I've re-installed - same error.
I've uninstalled, removed .gradle and .AndroidStudio4.0 folders, reinstalled - same error.
Any help gratefully accepted.

Try to delete or rename marketplace folder in android studio
~\AppData\Roaming\Google

Related

JAVA_HOME is set to an invalid directory Android Studio Flutter

type here
Since the last update of android studio to Electric Eel 2022.1.1,
I'm facing this issue while running my flutter project on my phone:
Launching lib\main.dart on Redmi Note 8 Pro in debug mode...
Running Gradle task 'assembleDebug'...
ERROR: JAVA_HOME is set to an invalid directory: C:\Program Files\Android\Android Studio\jre
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
And JAVA_HOME variable was sat on 'C:\Program Files\Android\Android Studio\jre'.
I've tried all possible solution that I've looked for but none of them worked.
It seemes the problem is related to the latest version of Android Studio.
What is the issue and how to solve it.
For Windows:
The problem is because of trace of old Android Studio java folder, just delete this folder and it starts working:
C:\Program Files\Android\Android Studio\jre
The new Android Studio Electric Eel is using jbr, not jre.
For macOS:
If you are using macOS replace the path in .bash_profile or .zshrc
export JAVA_HOME="/Applications/Android Studio.app/Contents/jre/Contents/Home"
with
export JAVA_HOME="/Applications/Android Studio.app/Contents/jbr/Contents/Home"

Android Studio Arctic Fox 2020.3.1 can't install its tools

It seems to have a problem unzipping its tools. Without the tools I can't build anything. Help!
Since none of my projects will build, I tried to create a new empty project, no activity, everything else defaults. It decides to install its SDK build tools, and the popup window shows
Packages to install:
Android SDK Build-Tools 30.0.2 (build-tools;30.0.2)
Preparing "Install Android SDK Build-Tools 30.0.2 (revision: 30.0.2)".
Downloading https://dl.google.com/android/repository/build-tools_r30.0.2-linux.zip
and it gets stuck doing the unzip. The Console output shows:-
~/Downloads/Google/android-studio/bin/studio.sh
2021-10-24 09:08:35,761 [ 1828] WARN - Container.ComponentManagerImpl - Do not use constructor injection (requestorClass=com.android.tools.idea.AndroidInitialConfigurator)
2021-10-24 09:10:35,963 [ 122030] ERROR - intellij.openapi.progress.Task - 'void org.apache.commons.compress.archivers.zip.ZipFile.(java.nio.channels.SeekableByteChannel)'
java.lang.NoSuchMethodError: 'void org.apache.commons.compress.archivers.zip.ZipFile.(java.nio.channels.SeekableByteChannel)'
at com.android.repository.util.InstallerUtil.unzip(InstallerUtil.java:99)
at com.android.repository.impl.installer.BasicInstaller.doPrepare(BasicInstaller.java:90)
at com.android.repository.impl.installer.AbstractPackageOperation.prepare(AbstractPackageOperation.java:335)
at com.android.tools.idea.sdk.wizard.InstallTask.preparePackages(InstallTask.java:269)
at com.android.tools.idea.sdk.wizard.InstallTask.run(InstallTask.java:132)
at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:962)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressAsync$5(CoreProgressManager.java:472)
at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$3(ProgressRunner.java:235)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:178)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:658)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:610)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:65)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:165)
at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:235)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665)
at java.base/java.lang.Thread.run(Thread.java:834)
2021-10-24 09:10:35,966 [ 122033] ERROR - intellij.openapi.progress.Task - Android Studio Arctic Fox | 2020.3.1 Patch 3 Build #AI-203.7717.56.2031.7784292
2021-10-24 09:10:35,968 [ 122035] ERROR - intellij.openapi.progress.Task - JDK: 11.0.10; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o.
2021-10-24 09:10:35,968 [ 122035] ERROR - intellij.openapi.progress.Task - OS: Linux
2021-10-24 09:10:35,969 [ 122036] ERROR - intellij.openapi.progress.Task - Last Action: WelcomeScreen.CreateNewProject
It looks as if it is having a problem with apache.commons.compress, so I installed the latest version of that, but I still get the same error.
It looks like either Android Studio can't find the installed apache.commons.compress, and hasn't installed it itself where it can find it (which it should do before trying to use it), or else the zip file is corrupted.
[it seems to need commons-compress-1.21.jar, but it installs commons-compress-1.20.jar]
Steps to fix:-
Install apache-commons-compress-1.21.jar
Delete the entire android-studio installation directory.
Re-extract from the the tar.gz file that you downloaded.
cd into the android-studio installation directory
rm lib/commons-compress-1.20.jar
ln -s /usr/share/java/commons-compress.jar lib/commons-compress-1.21.jar
If your installer put commons-compress-1.21.jar somewhere else than /usr/share/java/, make the symbolic link to there instead.
Now you should be able to start Android Studio. It will download masses of stuff, but it should work: it did for me.
It's possible that the actual problem was that it didn't like unzipping the tar.gz file on top of an older Android Studio installation, which is what I originally did. I didn't try unzipping into an empty directory without replacing commons-compress-1.20.jar.

Internal error at starting android studio after update

I'm using ubuntu 20.04
I updated android studio to version 4.1. after that I can't start android studio and shows the following error.
Internal error. Please refer to https://code.google.com/p/android/issues
java.lang.ExceptionInInitializerError
at com.a.b.b.d.K.b(K.java:260)
at com.a.b.b.a.am.c(am.java:297)
at com.a.b.b.a.am.a(am.java:119)
at com.a.b.b.a.ai.a(ai.java:56)
at com.intellij.idea.MainImpl.start(MainImpl.java:19)
at com.intellij.idea.StartupUtil.startApp(StartupUtil.java:303)
at com.intellij.idea.StartupUtil.prepareApp(StartupUtil.java:245)
at com.intellij.ide.plugins.MainRunner.lambda$start$0(MainRunner.java:47)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NullPointerException
at com.intellij.ui.scale.JBUIScale.lambda$static$0(JBUIScale.java:76)
at com.intellij.openapi.util.AtomicNotNullLazyValue$1.compute(AtomicNotNullLazyValue.java:59)
at com.intellij.openapi.util.AtomicNotNullLazyValue.getValue(AtomicNotNullLazyValue.java:37)
at com.intellij.ui.scale.JBUIScale.lambda$static$1(JBUIScale.java:155)
at com.intellij.util.LazyInitializer$MutableNotNullValue.initialize(LazyInitializer.java:113)
at com.intellij.util.LazyInitializer$NullableValue.get(LazyInitializer.java:41)
at com.intellij.util.LazyInitializer$MutableNotNullValue.get(LazyInitializer.java:102)
at com.intellij.ui.scale.JBUIScale.lambda$static$2(JBUIScale.java:173)
at com.intellij.util.LazyInitializer$MutableNotNullValue.initialize(LazyInitializer.java:113)
at com.intellij.util.LazyInitializer$NullableValue.get(LazyInitializer.java:41)
at com.intellij.util.LazyInitializer$MutableNotNullValue.get(LazyInitializer.java:102)
at com.intellij.ui.scale.JBUIScale.scale(JBUIScale.java:297)
at com.intellij.util.ui.JBInsets.create(JBInsets.java:41)
at com.intellij.util.ui.UIUtil.getRegularPanelInsets(UIUtil.java:1356)
at com.intellij.util.ui.UIUtil.<clinit>(UIUtil.java:455)
... 9 more
-----
JRE 1.8.0_242-release-1644-b3-6222593 amd64 by JetBrains s.r.o
What should I do to fix this? I tried removing plugins. But it didn't work.
Deleting of:
~/.local/share/Google/AndroidStudio4.1,
~/.config/Google/AndroidStudio4.1,
~/.cache/Google/AndroidStudio4.1
helped me to run AndroidStudio again.

Android studio on Ubuntu will not open

Not sure what happened. I was using it and then switched to editing an api file in Geany, then went back to Android Studio and got this error below. Tried uninstalling and reinstalling but still no go. Any ideas?
Internal error. Please refer to https://code.google.com/p/android/issues
java.lang.NoSuchMethodError: com.intellij.ide.plugins.PluginManagerCore.loadDescriptors()[Lcom/intellij/ide/plugins/IdeaPluginDescriptorImpl;
at com.a.a.b.b.ar.a(ar.java:121)
at com.a.a.b.b.ar.a(ar.java:71)
at com.intellij.idea.MainImpl.start(MainImpl.java:19)
at com.intellij.idea.StartupUtil.startApp(StartupUtil.java:303)
at com.intellij.idea.StartupUtil.prepareApp(StartupUtil.java:245)
at com.intellij.ide.plugins.MainRunner.lambda$start$0(MainRunner.java:47)
at java.lang.Thread.run(Thread.java:748)
-----
JRE 1.8.0_242-release-1644-b3-6222593 amd64 by JetBrains s.r.o
/snap/android-studio/94/android-studio/jre/jre"
Remove lib folder .local/share/Google/AndroidStudio4.1/marketplace
or execute command
rm -rf ~/.local/share/Google/AndroidStudio4.1/marketplace/lib
It's working for me :-)
in ubantu: go to -> HOME/.LOCAL/SHARE/GOOGLE/ANDROIDSUTDIO4.1/marketplace
marketplace file need to remove then start android studio working fine

Android Studio 3.2.1: “Error initializing ADB: Android Debug Bridge not found”

Android Studio 3.2.1:
Error initializing ADB: Android Debug Bridge not found
And I installed all the required components.
I met this situation and the issue was with the "platform-tools". Some how it was broken,
I have done the following to fix it,
Download the latest platform-tools from the official site (https://developer.android.com/studio/releases/platform-tools).
Rename the current "~\Android\Sdk\platform-tools" to "~\Android\Sdk\platform-tools-OLD".
Unzip the downloaded zip file(eg:-platform-tools_r28.0.2-windows.zip) and copied it to "~\Android\Sdk\"
Now you have the updated platform-tools in the SDK directory, restart Android Studio by File->"Invalidate Caches and Restart".
Hope this helps.

Resources