Richard Parkins
Richard Parkins

Reputation: 528

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.

Upvotes: 0

Views: 605

Answers (1)

Richard Parkins
Richard Parkins

Reputation: 528

[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.

Upvotes: 1

Related Questions