Android studio, configure gradle project takes for

2019-01-22 11:39发布

After changing the gradle build file to use gradle build tool 0.8.+,

classpath 'com.android.tools.build:gradle:0.8.+'

my Android studio is stuck forever at "refreshing X Gradle project". I tried to restart AS, didn't work. I did even change gradle build tool back to 0.7.+, even downgrade my AS from 0.4.4 back to 0.4.2, still no hopes. Anyone experienced this before? pls help Tks.

Update: now I tried deleting all old .iml files and .idea folder, and reimported, now it's stuck at "Building X Gradle project info", seems like forever.

Building from commandline is perfectly fine.

Update 2: Log file included as requested (.AndroidStudioPreview\system\log\idea.log)

2014-02-17 00:45:27,412 [  46868]   WARN -      #org.jetbrains.idea.maven - Failed to update Maven indices for: [http://download.crashlytics.com/maven] http://download.crashlytics.com/maven 
org.jetbrains.idea.maven.server.MavenServerIndexerException: java.lang.RuntimeException: java.io.FileNotFoundException: Resource nexus-maven-repository-index.properties does not exist
    at org.jetbrains.idea.maven.server.Maven3ServerIndexerImpl.updateIndex(Maven3ServerIndexerImpl.java:210)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:322)
    at sun.rmi.transport.Transport$1.run(Transport.java:177)
    at sun.rmi.transport.Transport$1.run(Transport.java:174)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport.java:173)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:553)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:808)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:667)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:722)
    at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:273)
    at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:251)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:160)
    at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:194)
    at java.rmi.server.RemoteObjectInvocationHandler.invoke(RemoteObjectInvocationHandler.java:148)
    at $Proxy99.updateIndex(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at com.intellij.execution.rmi.RemoteUtil$2$1$1.compute(RemoteUtil.java:106)
    at com.intellij.execution.rmi.RemoteUtil.executeWithClassLoader(RemoteUtil.java:167)
    at com.intellij.execution.rmi.RemoteUtil$2$1.invoke(RemoteUtil.java:102)
    at $Proxy99.updateIndex(Unknown Source)
    at org.jetbrains.idea.maven.server.MavenIndexerWrapper$3.execute(MavenIndexerWrapper.java:110)
    at org.jetbrains.idea.maven.server.RemoteObjectWrapper.perform(RemoteObjectWrapper.java:118)
    at org.jetbrains.idea.maven.server.MavenIndexerWrapper.updateIndex(MavenIndexerWrapper.java:105)
    at org.jetbrains.idea.maven.indices.MavenIndex.updateContext(MavenIndex.java:317)
    at org.jetbrains.idea.maven.indices.MavenIndex.updateOrRepair(MavenIndex.java:276)
    at org.jetbrains.idea.maven.indices.MavenIndices.updateOrRepair(MavenIndices.java:126)
    at org.jetbrains.idea.maven.indices.MavenIndicesManager.doUpdateIndices(MavenIndicesManager.java:260)
    at org.jetbrains.idea.maven.indices.MavenIndicesManager.access$200(MavenIndicesManager.java:49)
    at org.jetbrains.idea.maven.indices.MavenIndicesManager$3.run(MavenIndicesManager.java:231)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$TaskRunnable.run(ProgressManagerImpl.java:464)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$2.run(ProgressManagerImpl.java:178)
    at com.intellij.openapi.progress.ProgressManager.executeProcessUnderProgress(ProgressManager.java:209)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:212)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcess(ProgressManagerImpl.java:171)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$8.run(ProgressManagerImpl.java:373)
    at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:436)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
    at java.util.concurrent.FutureTask.run(FutureTask.java:166)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:722)
    at com.intellij.openapi.application.impl.ApplicationImpl$1$1.run(ApplicationImpl.java:153)
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: java.io.FileNotFoundException: Resource nexus-maven-repository-index.properties does not exist
    at org.jetbrains.idea.maven.server.Maven3ServerIndexerImpl$2.run(Maven3ServerIndexerImpl.java:193)
    at org.jetbrains.idea.maven.server.Maven3ServerEmbedderImpl.executeWithMavenSession(Maven3ServerEmbedderImpl.java:314)
    at org.jetbrains.idea.maven.server.Maven3ServerIndexerImpl.updateIndex(Maven3ServerIndexerImpl.java:159)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:322)
    at sun.rmi.transport.Transport$1.run(Transport.java:177)
    at sun.rmi.transport.Transport$1.run(Transport.java:174)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport.java:173)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:553)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:808)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:667)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.RuntimeException: java.io.FileNotFoundException: Resource nexus-maven-repository-index.properties does not exist
    at org.jetbrains.idea.maven.server.Maven3ServerIndexFetcher.retrieve(Maven3ServerIndexFetcher.java:108)
    at org.sonatype.nexus.index.updater.AbstractResourceFetcher.retrieve(AbstractResourceFetcher.java:22)
    at org.sonatype.nexus.index.updater.DefaultIndexUpdater.downloadIndexProperties(DefaultIndexUpdater.java:484)
    at org.sonatype.nexus.index.updater.DefaultIndexUpdater.access$100(DefaultIndexUpdater.java:65)
    at org.sonatype.nexus.index.updater.DefaultIndexUpdater$IndexAdaptor.setProperties(DefaultIndexUpdater.java:771)
    at org.sonatype.nexus.index.updater.DefaultIndexUpdater.fetchAndUpdateIndex(DefaultIndexUpdater.java:945)
    at org.sonatype.nexus.index.updater.DefaultIndexUpdater.fetchAndUpdateIndex(DefaultIndexUpdater.java:150)
    at org.jetbrains.idea.maven.server.Maven3ServerIndexerImpl$2.run(Maven3ServerIndexerImpl.java:190)
    ... 17 more
Caused by: java.lang.RuntimeException: org.apache.maven.wagon.ResourceDoesNotExistException: Unable to locate resource in repository
    at org.apache.maven.wagon.providers.http.LightweightHttpWagon.fillInputData(LightweightHttpWagon.java:139)
    at org.apache.maven.wagon.StreamWagon.getInputStream(StreamWagon.java:116)
    at org.apache.maven.wagon.StreamWagon.getIfNewer(StreamWagon.java:88)
    at org.apache.maven.wagon.StreamWagon.get(StreamWagon.java:61)
    at org.jetbrains.idea.maven.server.Maven3ServerIndexFetcher.retrieve(Maven3ServerIndexFetcher.java:100)
    ... 24 more
Caused by: java.io.FileNotFoundException: http://download.crashlytics.com/maven/.index/nexus-maven-repository-index.properties
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
    at sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1664)
    at sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1662)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1660)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1243)
    at org.apache.maven.wagon.providers.http.LightweightHttpWagon.fillInputData(LightweightHttpWagon.java:122)
    ... 28 more
Caused by: java.io.FileNotFoundException: http://download.crashlytics.com/maven/.index/nexus-maven-repository-index.properties
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1613)
    at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:468)
    at org.apache.maven.wagon.providers.http.LightweightHttpWagon.fillInputData(LightweightHttpWagon.java:115)
    ... 28 more
2014-02-17 00:45:56,749 [  76205]   INFO -                  TestNG Runner - Create TestNG Template Configuration 
2014-02-17 00:45:56,750 [  76206]   INFO -                  TestNG Runner - Create TestNG Template Configuration 
2014-02-17 00:45:56,756 [  76212]   INFO - ellij.project.impl.ProjectImpl - 25 project components initialized in 20 ms 
2014-02-17 00:45:56,757 [  76213]   INFO - le.impl.ModuleManagerComponent - 0 module(s) loaded in 0 ms 
2014-02-17 00:47:30,887 [ 170343]   INFO - .project.GradleProjectResolver - Gradle project resolve error 
org.gradle.tooling.GradleConnectionException: Could not run build action using Gradle distribution 'http://services.gradle.org/distributions/gradle-1.9-bin.zip'.
    at org.gradle.tooling.internal.consumer.ResultHandlerAdapter.onFailure(ResultHandlerAdapter.java:55)
    at org.gradle.tooling.internal.consumer.async.DefaultAsyncConsumerActionExecutor$1$1.run(DefaultAsyncConsumerActionExecutor.java:57)
    at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:66)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:722)
    at org.gradle.tooling.internal.consumer.BlockingResultHandler.getResult(BlockingResultHandler.java:46)
    at org.gradle.tooling.internal.consumer.DefaultBuildActionExecuter.run(DefaultBuildActionExecuter.java:43)
    at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.doResolveProjectInfo(GradleProjectResolver.java:170)
    at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.access$000(GradleProjectResolver.java:61)
    at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver$1.fun(GradleProjectResolver.java:117)
    at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver$1.fun(GradleProjectResolver.java:113)
    at org.jetbrains.plugins.gradle.service.project.GradleExecutionHelper.execute(GradleExecutionHelper.java:182)
    at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(GradleProjectResolver.java:113)
    at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(GradleProjectResolver.java:61)
    at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl$1.produce(RemoteExternalSystemProjectResolverImpl.java:41)
    at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl$1.produce(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:49)
    at com.intellij.openapi.externalSystem.service.internal.ExternalSystemResolveProjectTask.doExecute(ExternalSystemResolveProjectTask.java:48)
    at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:137)
    at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:123)
    at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$3.execute(ExternalSystemUtil.java:471)
    at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$4$2.run(ExternalSystemUtil.java:549)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$TaskRunnable.run(ProgressManagerImpl.java:464)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$2.run(ProgressManagerImpl.java:178)
    at com.intellij.openapi.progress.ProgressManager.executeProcessUnderProgress(ProgressManager.java:209)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:212)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcess(ProgressManagerImpl.java:171)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$8.run(ProgressManagerImpl.java:373)
    at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:436)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
    at java.util.concurrent.FutureTask.run(FutureTask.java:166)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:722)
    at com.intellij.openapi.application.impl.ApplicationImpl$1$1.run(ApplicationImpl.java:153)
Caused by: java.nio.channels.OverlappingFileLockException
    at sun.nio.ch.SharedFileLockTable.checkList(FileLockTable.java:255)
    at sun.nio.ch.SharedFileLockTable.add(FileLockTable.java:152)
    at sun.nio.ch.FileChannelImpl.tryLock(FileChannelImpl.java:1017)
    at org.gradle.cache.internal.filelock.LockStateAccess.tryLock(LockStateAccess.java:83)
    at org.gradle.cache.internal.filelock.LockFileAccess.tryLockState(LockFileAccess.java:83)
    at org.gradle.cache.internal.DefaultFileLockManager$DefaultFileLock.lockStateRegion(DefaultFileLockManager.java:317)
    at org.gradle.cache.internal.DefaultFileLockManager$DefaultFileLock.lock(DefaultFileLockManager.java:260)
    at org.gradle.cache.internal.DefaultFileLockManager$DefaultFileLock.<init>(DefaultFileLockManager.java:132)
    at org.gradle.cache.internal.DefaultFileLockManager.lock(DefaultFileLockManager.java:87)
    at org.gradle.cache.internal.DefaultFileLockManager.lock(DefaultFileLockManager.java:74)
    at org.gradle.cache.internal.OnDemandFileAccess.readFile(OnDemandFileAccess.java:36)
    at org.gradle.cache.internal.SimpleStateCache.get(SimpleStateCache.java:40)
    at org.gradle.cache.internal.FileIntegrityViolationSuppressingPersistentStateCacheDecorator.get(FileIntegrityViolationSuppressingPersistentStateCacheDecorator.java:31)
    at org.gradle.launcher.daemon.registry.PersistentDaemonRegistry.getAll(PersistentDaemonRegistry.java:62)
    at org.gradle.launcher.daemon.registry.PersistentDaemonRegistry.getIdle(PersistentDaemonRegistry.java:77)
    at org.gradle.launcher.daemon.client.DefaultDaemonConnector.connect(DefaultDaemonConnector.java:67)
    at org.gradle.launcher.daemon.client.DaemonClient.execute(DaemonClient.java:149)
    at org.gradle.launcher.daemon.client.DaemonClient.execute(DaemonClient.java:74)
    at org.gradle.tooling.internal.provider.DaemonBuildActionExecuter.execute(DaemonBuildActionExecuter.java:42)
    at org.gradle.tooling.internal.provider.DaemonBuildActionExecuter.execute(DaemonBuildActionExecuter.java:29)
    at org.gradle.tooling.internal.provider.LoggingBridgingBuildActionExecuter.execute(LoggingBridgingBuildActionExecuter.java:53)
    at org.gradle.tooling.internal.provider.LoggingBridgingBuildActionExecuter.execute(LoggingBridgingBuildActionExecuter.java:30)
    at org.gradle.tooling.internal.provider.ProviderConnection.run(ProviderConnection.java:106)
    at org.gradle.tooling.internal.provider.ProviderConnection.run(ProviderConnection.java:100)
    at org.gradle.tooling.internal.provider.DefaultConnection.run(DefaultConnection.java:143)
    at org.gradle.tooling.internal.consumer.connection.ActionAwareConsumerConnection.run(ActionAwareConsumerConnection.java:40)
    at org.gradle.tooling.internal.consumer.DefaultBuildActionExecuter$1.run(DefaultBuildActionExecuter.java:53)
    at org.gradle.tooling.internal.consumer.connection.LazyConsumerActionExecutor.run(LazyConsumerActionExecutor.java:82)
    at org.gradle.tooling.internal.consumer.connection.ProgressLoggingConsumerActionExecutor.run(ProgressLoggingConsumerActionExecutor.java:58)
    at org.gradle.tooling.internal.consumer.connection.LoggingInitializerConsumerActionExecutor.run(LoggingInitializerConsumerActionExecutor.java:44)
    at org.gradle.tooling.internal.consumer.async.DefaultAsyncConsumerActionExecutor$1$1.run(DefaultAsyncConsumerActionExecutor.java:55)
    at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:66)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:722)
2014-02-17 00:47:30,893 [ 170349]   INFO - .BaseProjectImportErrorHandler - Failed to import Gradle project at 'C:/Users/Tung/TripGoify/TripGoify' 
org.gradle.tooling.GradleConnectionException: Could not run build action using Gradle distribution 'http://services.gradle.org/distributions/gradle-1.9-bin.zip'.
    at org.gradle.tooling.internal.consumer.ResultHandlerAdapter.onFailure(ResultHandlerAdapter.java:55)
    at org.gradle.tooling.internal.consumer.async.DefaultAsyncConsumerActionExecutor$1$1.run(DefaultAsyncConsumerActionExecutor.java:57)
    at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:66)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:722)
    at org.gradle.tooling.internal.consumer.BlockingResultHandler.getResult(BlockingResultHandler.java:46)
    at org.gradle.tooling.internal.consumer.DefaultBuildActionExecuter.run(DefaultBuildActionExecuter.java:43)
    at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.doResolveProjectInfo(GradleProjectResolver.java:170)
    at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.access$000(GradleProjectResolver.java:61)
    at 

9条回答
SAY GOODBYE
2楼-- · 2019-01-22 12:18

What worked for me in this regard was , replacing the GRDADLE jar and properties file from the respective project that you may be trying to import .

  1. Build a project fresh or , copy the gradle jar and properties file from the working project
  2. Now , further copy these files and replace with the "Originaly" not working gradle files of the project you are trying to import or the project where gradle build hangs

Bit late , but can be of some help to the future queries .

查看更多
Bombasti
3楼-- · 2019-01-22 12:21

In my case, I used a multi-project setup and included two separate projects in settings.gradle featuring some overlapping properties. I'm not sure which exact properties caused this, but they were most likely name-related. Basically, instead of throwing an exception ("duplicated [something] detected"), Gradle went into an endless loop. Replacing the duplicated properties helped.

查看更多
走好不送
4楼-- · 2019-01-22 12:38

In my case the problem was Genymotion plugin.
Once i removed it from studio and restarted. It worked fine.

I still don't know how that could happen as i regularly use genymotion with studio in my other machines.

You can still run genymotion even if you remove studio plugin by starting emulator from genymotion itself.

查看更多
够拽才男人
5楼-- · 2019-01-22 12:39

If you are on Windows check

C:\Users\YOUR_USER\.gradle\wrapper\dists

whether the gradle 1.10-all is installed there or not inside the directory.

Android Studio downloads the whole distribution first time which is around 60 MB so it takes some time.

Check the distributionUrl in gradle/gradle-wrapper.properties and match the same in your dist directory if it is not available studio will download it. Distribution url will look like :

distributionUrl=http\://services.gradle.org/distributions/gradle-1.10-all.zip

change it to whatever already installed will solve the problem.

Note : The directory name in dist and Zip name must same. Directory will be created while trying to download check whether the Zip is installed properly or not.

查看更多
淡お忘
6楼-- · 2019-01-22 12:39

I solved it

  • deleting gradle and intellij files

    rm -rf .idea/ *.iml .gradle/
    
  • reimporting the project on intellij

  • choosing same jdk for gradle that you use on gradle terminal(makes sense if you use daemon) enter image description here
  • and upgrading from gradle 2.4 to 2.13
查看更多
ゆ 、 Hurt°
7楼-- · 2019-01-22 12:40

delete gradle folder in your project folder then reopen it using studio, in choose dialog choose cancel, don't use grade wrapper to download latest version of gradle

查看更多
登录 后发表回答