Android Studio Arctic Fox 2020.3.1 can't install its tools - android-studio

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.

Related

Upgrading Andriod Studio 4.2.2 not working and producing a Gradle Input/output error

I am a new self teaching developer hoping to learn Kotlin development via Android Studio. I also just realized if I want to learn Kotlin/Android then
I'm also learning Gradle like it or not.
I recently install Fedora 34 then installed Android Studio from the Fedora Software repository. Upon starting my very first tutorial on Kotlin, Gradle build failed to sync and Android Studio indicated that version 4.2.2 is a available stopping me before I have even started. I have started Android Studio as root several times yet the upgrade does not happen. I have googled Gradle input/out error, setting.gradle and gradle.build for any configuration that I may need to make or I may have over looked.
Project Structure
Gradle Plugin Version 4.2.1
Gradle Version 7.1.1
Gradle for current project
user home /root/.gradle
Generate .iml file is checked
Download external annotations is checked
use Gradle from 'gradle-wrapper.properties'file
I have run the following:
Gradle sycn,
Invalidate Cashes/Restart
AGP cache clean with:$ ./gradlew cleanBuildCache
Gradle upgrade v7.1.1 with SDKMAN without any assumed issues.
Grade scan https://gradle.com/s/axcqhuiwtpfcg/activate/m55kfphbqfp5o
Close Android Studio and open as root assuming it will auto upgrade to 4.2.2 with the following:
[root#fedora var]# sudo ./lib/flatpak/app/com.google.AndroidStudio/x86_64/stable/c98dfa958bbd5225b99de3f2dc5f5947fb3993760db630edde199f6eef3e5494/files/extra/android-studio/bin/studio.sh
2021-07-15 10:03:39,933 [ 6000] WARN - Container.ComponentManagerImpl - Do not use constructor injection (requestorClass=com.android.tools.idea.AndroidInitialConfigurator)
2021-07-15 10:03:43,869 [ 9936] WARN - nSystem.impl.ActionManagerImpl - keymap "ReSharper" not found [Plugin: com.android.tools.ndk]
2021-07-15 10:03:46,968 [ 13035] WARN - tartup.impl.StartupManagerImpl - Activities registered via registerPostStartupActivity must be dumb-aware: com.android.tools.idea.stats.AndroidStudioUsageTracker$ProjectLifecycleTracker$projectComponentsInitialized$1#509dc6a9
2021-07-15 10:04:07,452 [ 33519] WARN - Container.ComponentManagerImpl - Do not use constructor injection (requestorClass=com.android.tools.idea.apk.ApkWritingAccessProvider)
2021-07-15 10:04:38,382 [ 64449] WARN - ues.SyncIssueUsageReporterImpl - Multiple sync failures reported. Discarding: SDK_BUILD_TOOLS_TOO_LOW
2021-07-15 10:04:38,429 [ 64496] WARN - e.project.sync.GradleSyncState - Gradle sync failed: Input/output error (29 s 101 ms)
2021-07-15 10:04:38,431 [ 64498] WARN - e.project.sync.GradleSyncState - Input/output error
com.intellij.openapi.externalSystem.model.ExternalSystemException: Input/output error
At this point Android Studio is now open yet the upgrade notice to 4.2.2 is still present.
Thank you for any enlightenment today.

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

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

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.

Android Studio error: occurred starting process 'command '/home/private/Android/Sdk/ndk-bundle/toolchains/mips64el-linux-android-4.9...''?

I have error after minor update Android Studio. Ubuntu 18.04, Android Studio 3.1.2
Caused by: org.gradle.process.internal.ExecException: A problem occurred starting process 'command '/home/private/Android/Sdk/ndk-bundle/toolchains/mips64el-linux-android-4.9/prebuilt/linux-x86_64/bin/mips64el-linux-android-strip''
Caused by: net.rubygrapefruit.platform.NativeException: Could not start '/home/private/Android/Sdk/ndk-bundle/toolchains/mips64el-linux-android-4.9/prebuilt/linux-x86_64/bin/mips64el-linux-android-strip'
Caused by: java.io.IOException: Cannot run program "/home/private/Android/Sdk/ndk-bundle/toolchains/mips64el-linux-android-4.9/prebuilt/linux-x86_64/bin/mips64el-linux-android-strip" (in directory "/home/private/StudioProjects/yamatrack-cart-app-android/viewer"): error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
2 solution if you use an older gradle version
don't use the latest ndk 17 because they have removed the mips build scripts
copy the mips folder from ndk 16 under toolchain into ndk 17.
Second solution worked for me even with configured nbi filters.
I was getting this error when trying to build an older release of my code which was using an old version of the Android Gradle Plugin.
I found that upgrading to the latest Android Gradle plugin (3.1.2) fixed this. Although it is a bit worrying that I can't just checkout an older version of my code and build it with the plugin version from that release.
Although the build now appears to succeed with the newer Gradle plugin, I am getting this slightly worrying warning:
Unable to strip library 'MyApp/build/intermediates/transforms/mergeJniLibs/develop/debug/0/lib/mips/libsqlite3x.so' due to missing strip tool for ABI 'MIPS'. Packaging it as is.
I have this in my build.gradle as I depend on some native libs:
ndk {
abiFilters "armeabi-v7a", "x86"
}

Gradle sync failed after upgrade to Android Studio 3.0 Beta 1

A project syncing and building OK when on Android Studio 3.0 Canary 9. Just started failing the Gradle sync immediately after the upgrade to Android Studio 3.0 Beta 1!
Using the Android Studio bundled Java 8 without hacks on a Debian GNU/Linux 9 (Stretch, stable, up-to-date).
UPDATE: Solved with Beta 2
https://androidstudio.googleblog.com/2017/08/android-studio-30-beta-2.html
Note: additional effort needed on rewriting code to avoid problematic Java libs for Android.
UPDATE: First try from Google
https://androidstudio.googleblog.com/2017/08/android-studio-30-beta-1.html
Several issues arise (e.g., errors about signature-polymorphic method without --min-sdk-version >= 26)
These issues were not present on Canary 9!
Error:Execution failed for task ':app:transformClassesWithDexBuilderForDebug'.
> com.android.build.api.transform.TransformException: org.gradle.tooling.BuildException: com.android.dx.cf.code.SimException: signature-polymorphic method called without --min-sdk-version >= 26
(Google's nonsolution)
Original sync issue
Same issue on a Windows
Gradle error upgrading to Android Studio 3.0 Beta 1
From Studio
Build: 3.0 Beta 1, AI-171.4243858, 201708032321,
AI-171.4243858, JRE 1.8.0_152-release-915-b01x64 JetBrains s.r.o, OS Linux(amd64) v4.9.0-3-amd64 unknown, screens 1920x1080, 1920x1080
Gradle '...' project refresh failed
Cause: java.lang.NullPointerException
at sun.nio.fs.UnixPath.normalizeAndCheck(UnixPath.java:77)
at sun.nio.fs.UnixPath.<init>(UnixPath.java:71)
at sun.nio.fs.UnixFileSystem.getPath(UnixFileSystem.java:281)
at java.nio.file.Paths.get(Paths.java:84)
at com.android.build.gradle.internal.scope.BuildOutput.getOutputPath(BuildOutput.java:222)
at com.android.build.gradle.internal.scope.BuildOutputs.lambda$load$2(BuildOutputs.java:243)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1376)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
at com.android.build.gradle.internal.scope.BuildOutputs.load(BuildOutputs.java:245)
at com.android.build.gradle.internal.scope.BuildOutputs.load(BuildOutputs.java:184)
at com.android.build.gradle.internal.scope.BuildOutputs.load(BuildOutputs.java:140)
at com.android.build.gradle.internal.ide.BuildOutputsSupplier.lambda$get$1(BuildOutputsSupplier.java:55)
at com.google.common.collect.ImmutableList.forEach(ImmutableList.java:397)
at com.android.build.gradle.internal.ide.BuildOutputsSupplier.get(BuildOutputsSupplier.java:50)
at com.android.build.gradle.internal.ide.BuildOutputsSupplier.get(BuildOutputsSupplier.java:35)
at com.android.build.gradle.internal.ide.AndroidArtifactImpl.getOutputs(AndroidArtifactImpl.java:134)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.gradle.tooling.internal.adapter.ProtocolToModelAdapter$ReflectionMethodInvoker.invoke(ProtocolToModelAdapter.java:592)
at org.gradle.tooling.internal.adapter.ProtocolToModelAdapter$AdaptingMethodInvoker.invoke(ProtocolToModelAdapter.java:397)
at org.gradle.tooling.internal.adapter.ProtocolToModelAdapter$PropertyCachingMethodInvoker.invoke(ProtocolToModelAdapter.java:625)
at org.gradle.tooling.internal.adapter.ProtocolToModelAdapter$SafeMethodInvoker.invoke(ProtocolToModelAdapter.java:647)
at org.gradle.tooling.internal.adapter.ProtocolToModelAdapter$SupportedPropertyInvoker.invoke(ProtocolToModelAdapter.java:670)
at org.gradle.tooling.internal.adapter.ProtocolToModelAdapter$InvocationHandlerImpl.invoke(ProtocolToModelAdapter.java:356)
at com.sun.proxy.$Proxy220.getOutputs(Unknown Source)
at com.android.tools.idea.gradle.project.model.ide.android.IdeAndroidArtifactImpl.<init>(IdeAndroidArtifactImpl.java:57)
at com.android.tools.idea.gradle.project.model.ide.android.IdeVariantImpl.lambda$new$0(IdeVariantImpl.java:60)
at com.android.tools.idea.gradle.project.model.ide.android.ModelCache.lambda$computeIfAbsent$0(ModelCache.java:31)
at java.util.HashMap.computeIfAbsent(HashMap.java:1126)
at com.android.tools.idea.gradle.project.model.ide.android.ModelCache.computeIfAbsent(ModelCache.java:31)
at com.android.tools.idea.gradle.project.model.ide.android.IdeVariantImpl.<init>(IdeVariantImpl.java:59)
at com.android.tools.idea.gradle.project.model.ide.android.IdeAndroidProjectImpl.lambda$new$4(IdeAndroidProjectImpl.java:88)
at com.android.tools.idea.gradle.project.model.ide.android.ModelCache.lambda$computeIfAbsent$0(ModelCache.java:31)
at java.util.HashMap.computeIfAbsent(HashMap.java:1126)
at com.android.tools.idea.gradle.project.model.ide.android.ModelCache.computeIfAbsent(ModelCache.java:31)
at com.android.tools.idea.gradle.project.model.ide.android.IdeModel.copy(IdeModel.java:74)
at com.android.tools.idea.gradle.project.model.ide.android.IdeAndroidProjectImpl.<init>(IdeAndroidProjectImpl.java:87)
at com.android.tools.idea.gradle.project.model.ide.android.IdeAndroidProjectImpl.<init>(IdeAndroidProjectImpl.java:68)
at com.android.tools.idea.gradle.project.model.AndroidModuleModel.<init>(AndroidModuleModel.java:131)
at com.android.tools.idea.gradle.project.sync.idea.AndroidGradleProjectResolver.populateModuleContentRoots(AndroidGradleProjectResolver.java:214)
at org.jetbrains.plugins.gradle.service.project.AbstractProjectResolverExtension.populateModuleContentRoots(AbstractProjectResolverExtension.java:103)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.doResolveProjectInfo(GradleProjectResolver.java:366)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.access$200(GradleProjectResolver.java:79)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver$ProjectConnectionDataNodeFunction.fun(GradleProjectResolver.java:902)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver$ProjectConnectionDataNodeFunction.fun(GradleProjectResolver.java:886)
at org.jetbrains.plugins.gradle.service.execution.GradleExecutionHelper.execute(GradleExecutionHelper.java:218)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(GradleProjectResolver.java:139)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(GradleProjectResolver.java:79)
at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl.lambda$resolveProjectInfo$0(RemoteExternalSystemProjectResolverImpl.java:37)
at com.intellij.openapi.externalSystem.service.remote.AbstractRemoteExternalSystemService.execute(AbstractRemoteExternalSystemService.java:59)
at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl.resolveProjectInfo(RemoteExternalSystemProjectResolverImpl.java:37)
at com.intellij.openapi.externalSystem.service.remote.wrapper.ExternalSystemProjectResolverWrapper.resolveProjectInfo(ExternalSystemProjectResolverWrapper.java:45)
at com.intellij.openapi.externalSystem.service.internal.ExternalSystemResolveProjectTask.doExecute(ExternalSystemResolveProjectTask.java:66)
at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:139)
at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:125)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$3.execute(ExternalSystemUtil.java:388)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$5.run(ExternalSystemUtil.java:445)
at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:726)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$1(CoreProgressManager.java:176)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:556)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:501)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:66)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:163)
at com.intellij.openapi.progress.impl.ProgressManagerImpl$1.run(ProgressManagerImpl.java:137)
at com.intellij.openapi.application.impl.ApplicationImpl$2.run(ApplicationImpl.java:334)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
UPDATE: Android Studio 3.0 Beta 3
With the following list of bug fixes:
Seems like this issue is already gone. After Updating from 3.0 Beta 2 to 3.0 Beta 3, I don't have to manually clean the project.
UPDATE: Android Studio 3.0 Beta 2
From the official Android Studio 3.0 Beta 2 known issues:
If you have an existing Android Studio project that's
using an alpha version of Android plugin 3.0.0 (such as 3.0.0-alpha9),
you may get the following error when you migrate to Android plugin
3.0.0-beta1 (or higher) and sync your project: Gradle project refresh failed.
Resolve this issue by selecting Build > Clean Project from the menu bar.
You can fix this issue by doing this:
Build > Clean Project
Reference: https://androidstudio.googleblog.com/2017/08/android-studio-30-beta-1.html
Read here:
https://androidstudio.googleblog.com/2017/08/android-studio-30-beta-1.html
Open the Terminal window by selecting View > Tool Windows > Terminal from the menu bar.
Delete all intermediate and cached build files with the following command: gradlew clean.
Build your project with the following command: gradlew assemble.
Sync your project files with Gradle by clicking Sync Project from the toolbar.
Or as I did, open the tab "Gradle" and run "clean" and then "assemble"
like this:
Go to your right at Android Studio, open the tab "gradle", then in ":app"/"Tasks"/"build" you will see "clean", "assemble" and other tasks.
Run first clean and then assemble, you may get an error but it still works and finally rebuild your project.
There is a solution offered by Google:
Resolve this issue selecting Build > Clean Project from the menu bar. You need to perform this action only once for each project. You can then sync your project files with Gradle by clicking Sync Project from the toolbar.
Following solutions didn't work for me :
Pressing that try again button again and again
Using offline and online gradle changes
Cleaning, syncing or rebuilding.
Solution:
After all these I just visited ~/.gradle folder, it contains a single folder named wrapper, just rename it to anything else i.e. wrapper123. That's it problem solved !!!! Press build and it will start syncing and building the project
I'm on Android Studio 3.0 Beta 2, and I found that on top of the clean and sync proposed here, for my project which was Java-Kotlin-mixed code base, I had to drop my Kotlin version to 1.1.3-2, which is the IDE bundled version, clean & sync then works, and then I can bring the Kotlin version back to 1.1.4 which is latest at the time of writing.
recquired online for until fix the error (fixing the gradle error.after successfully fixed the errror.you can work in offline.)
1.download latest gradle from ->https://gradle.org/releases
2.after downloading the zip files,it extract all the files into a folder (for good work:-name the folder 'gradle4',place the samelocal disc where your android studio installed eg-you installed android studio in local disc :c if place the 'gradle4' in local disc c)
3.android studio->file menu->settings->build,Excecution,Deployment->Gradle
4.check-use local gradle distribution
5.give gradle folder path into the gradle home optionScreen shot of gradle setting step 5
6.Enable embedded Maven Repository
Screen shot of Enable Maven Repository
click ->apply
Build menu->clean project
-problem solved-

Resources