1

My new Android studio version is giving below error for the sample project could you please help?

Below is the logs for IDE Fatal Error i got

IDE Error

Root project path of the Gradle project not found for Module: 'MyApplication2'
com.intellij.openapi.diagnostic.Logger$EmptyThrowable
at com.intellij.openapi.diagnostic.Logger.error(Logger.java:140)
at org.jetbrains.plugins.gradle.execution.GradleOrderEnumeratorHandler.addCustomModuleRoots(GradleOrderEnumeratorHandler.java:110)
at com.android.tools.idea.gradle.project.AndroidGradleOrderEnumeratorHandlerFactory$1.addCustomModuleRoots(AndroidGradleOrderEnumeratorHandlerFactory.java:93)
at com.intellij.openapi.roots.impl.OrderEnumeratorBase.addCustomRootsForModule(OrderEnumeratorBase.java:422)
at com.intellij.openapi.roots.impl.OrderRootsEnumeratorImpl.collectModuleRoots(OrderRootsEnumeratorImpl.java:238)
at com.intellij.openapi.roots.impl.OrderRootsEnumeratorImpl.lambda$computeRoots$0(OrderRootsEnumeratorImpl.java:108)
at com.intellij.openapi.roots.impl.OrderEnumeratorBase.processEntries(OrderEnumeratorBase.java:303)
at com.intellij.openapi.roots.impl.ModuleOrderEnumerator.forEach(ModuleOrderEnumerator.java:47)
at com.intellij.openapi.roots.impl.OrderRootsEnumeratorImpl.computeRoots(OrderRootsEnumeratorImpl.java:104)
at com.intellij.openapi.roots.impl.OrderRootsEnumeratorImpl.getRoots(OrderRootsEnumeratorImpl.java:74)
at com.intellij.openapi.roots.OrderEnumerator.getClassesRoots(OrderEnumerator.java:159)

Because of this error Gradle build is getting failed Gradle error screen shot attached

Also in Project structure required files are not getting generated

for example: Application specific build.gradle Project structure picture attached

PS: Android studio version is 3.1.4

Devil10
  • 1,853
  • 1
  • 18
  • 22
user2454202
  • 451
  • 2
  • 4
  • 13

1 Answers1

0

I had the same problem and solved it by below methods.

I don't know what OS you are running, but mine is macOS High Sierra, and

Android Studio version is same as yours. (v 3.1.4)

First thing I tried, and it worked.

I changed the gradle version to 4.2 and re-opened the project.

File -> Project Structure -> Project -> Gradle version from 4.4 to 4.2

I changed the gradle version from 4.2 to 4.4 again.

I closed the project and re-opened it after I deleted the gradle on the below directory.

/Users/$USERNAME/.gradle/wrapper/dists/GRADLE_VERSION

JayB Kim
  • 327
  • 5
  • 16
  • B Kim I tried your suggestion and I still don't see the build.gradle app file getting generated . Could you please help – user2454202 Aug 14 '18 at 16:13
  • @user2454202 What OS are you running? Have you tried [completely uninstall Android Studio](https://stackoverflow.com/questions/17625622/how-to-completely-uninstall-android-studio) and reinstall it? If you haven't, I suggest you to do it first. If it doesn't work, we can start going from there. – JayB Kim Aug 16 '18 at 08:17