Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio 3.1.1 - unable to add module (import gradle project)

Android Studio 3.1.1. New module -> Import gradle project, after I select project to import and confirm, IDE crashes with exception:

Element: class org.jetbrains.plugins.groovy.lang.psi.impl.GroovyFileImpl because: different providers: SingleRootFileViewProvider{myVirtualFile=file:///home/michal/AndroidStudioProjects/FirebaseJobTest/settings.gradle, content=VirtualFileContent{size=26}}(1416c50); SingleRootFileViewProvider{myVirtualFile=file:///home/michal/AndroidStudioProjects/FirebaseJobTest/settings.gradle, content=VirtualFileContent{size=26}}(665cfacf) invalidated at: see attachment com.intellij.psi.PsiInvalidElementAccessException: Element: class org.jetbrains.plugins.groovy.lang.psi.impl.GroovyFileImpl because: different providers: SingleRootFileViewProvider{myVirtualFile=file:///home/michal/AndroidStudioProjects/FirebaseJobTest/settings.gradle, content=VirtualFileContent{size=26}}(1416c50); SingleRootFileViewProvider{myVirtualFile=file:///home/michal/AndroidStudioProjects/FirebaseJobTest/settings.gradle, content=VirtualFileContent{size=26}}(665cfacf) invalidated at: see attachment at com.intellij.psi.util.PsiUtilCore.ensureValid(PsiUtilCore.java:502)

Do you know any workaround?

like image 961
user1209216 Avatar asked Apr 13 '18 07:04

user1209216


People also ask

How do I import a module into gradle?

Project structure -> Modules -> "+" -> Import module. Save this answer.

Where do I put repositories in Android Studio?

Go to buildscript > repositories and configure the Maven repository address for the HMS Core SDK. If the agconnect-services. json file has been added to the app, go to buildscript > dependencies and add the AppGallery Connect plugin configuration and Android Gradle plugin configuration.


1 Answers

I was facing the same issue, seems like IDE issue, try manually adding

include ':app', ':your_module_name'

in settings.gradle and sync gradle, hope it helps.

like image 160
Muhammad Waqas Avatar answered Sep 28 '22 05:09

Muhammad Waqas