0
votes

When I try to create a new project (in Kotlin/Java) this error occours. Anyone to help me with this?

Gradle sync failed: Could not load wrapper properties from 'C:\Users\gabri\OneDrive\Documentos\TO\MyApplication\gradle\wrapper\gradle-wrapper.properties'. No value with key 'distributionUrl' specified in wrapper properties file 'C:\Users\gabri\OneDrive\Documentos\TO\MyApplication\gradle\wrapper\gradle-wrapper.properties'. java.lang.RuntimeException: Could not load wrapper properties from 'C:\Users\gabri\OneDrive\Documentos\TO\MyApplication\gradle\wrapper\gradle-wrapper.properties'. at org.gradle.wrapper.WrapperExecutor. (WrapperExecutor.java:61) at org.gradle.wrapper.WrapperExecutor.forProjectDirectory(WrapperExecutor.java:38) at org.gradle.tooling.internal.consumer.DistributionFactory.getDefaultDistribution(DistributionFactory.java:62) at org.gradle.tooling.internal.consumer.DefaultGradleConnector.connect(DefaultGradleConnector.java:137) at org.jetbrains.plugins.gradle.service.execution.GradleExecutionHelper.getConnection(GradleExecutionHelper.java:502) at org.jetbrains.plugins.gradle.service.execution.GradleExecutionHelper.execute(GradleExecutionHelper.java:273) at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(GradleProjectResolver.java:125) at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(GradleProjectResolver.java:60) at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl.lambda$resolveProjectInfo$0(RemoteExternalSystemProjectResolverImpl.java:35) at com.intellij.openapi.externalSystem.service.remote.AbstractRemoteExternalSystemService.execute(AbstractRemoteExternalSystemService.java:57) at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl.resolveProjectInfo(RemoteExternalSystemProjectResolverImpl.java:35) at com.intellij.openapi.externalSystem.service.remote.wrapper.ExternalSystemProjectResolverWrapper.resolveProjectInfo(ExternalSystemProjectResolverWrapper.java:44) at com.intellij.openapi.externalSystem.service.internal.ExternalSystemResolveProjectTask.doExecute(ExternalSystemResolveProjectTask.java:100) at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:146) at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:132) at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$3.executeImpl(ExternalSystemUtil.java:544) at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$3.lambda$execute$1(ExternalSystemUtil.java:392) at com.intellij.openapi.project.DumbServiceImpl.suspendIndexingAndRun(DumbServiceImpl.java:150) at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$3.execute(ExternalSystemUtil.java:392) at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$5.run(ExternalSystemUtil.java:660) at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:888) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:163) at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:585) at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:531) at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:59) at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:150) at com.intellij.openapi.progress.impl.CoreProgressManager$4.lambda$run$0(CoreProgressManager.java:402) at com.intellij.util.ConcurrencyUtil.runUnderThreadName(ConcurrencyUtil.java:221) at com.intellij.openapi.progress.impl.CoreProgressManager$4.run(CoreProgressManager.java:402) at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:238) 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:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.RuntimeException: No value with key 'distributionUrl' specified in wrapper properties file 'C:\Users\gabri\OneDrive\Documentos\TO\MyApplication\gradle\wrapper\gradle-wrapper.properties'. at org.gradle.wrapper.WrapperExecutor.reportMissingProperty(WrapperExecutor.java:135) at org.gradle.wrapper.WrapperExecutor.readDistroUrl(WrapperExecutor.java:78) at org.gradle.wrapper.WrapperExecutor.prepareDistributionUri(WrapperExecutor.java:67) at org.gradle.wrapper.WrapperExecutor. (WrapperExecutor.java:54) ... 34 more Consult IDE log for more details (Help | Show Log) (56 ms)

enter image description here

2

2 Answers

1
votes

It happpens sometimes that files dont sync well and stuff.

Try these:

  1. Go to File -> Invalidate Caches/Restart -> Sync project with Gradle Files
  2. Go to Build -> Clean Project -> Rebuild Project.

If this wont work then It seems like the distributionUrl is missing in your gradle-wrapper.properties of your project. gradle-wrapper.properties looks like as follows. check your path and add distributionUrl inside gradle-wrapper.properties file

Possible solution for this is to go to File -> Settings. Under Settings window choose Build,Execution, Deployment. Then under build tools choose Gradle. Click on use local gradle Distribution. Change gradle home by browsing gradle location eg. ... /gradle/gradle-2.10

0
votes

The ANDROID_HOME variable was not set correctly on the computer