Status Update
Comments
xa...@android.com <xa...@android.com>
al...@google.com <al...@google.com> #2
This error shows up when there is a module in your project whose .iml file does not contain:
external.system.id ="GRADLE"
Can you please check your .iml files? Also, instead of opening the project, *import* it, that will completely rewrite your .iml files and you won't see that error again.
Can you please check your .iml files? Also, instead of opening the project, *import* it, that will completely rewrite your .iml files and you won't see that error again.
ss...@gmail.com <ss...@gmail.com> #3
I can confirm that it works with AS 0.8.14 if I do
1) open AS,
2) delete the Gradle Java modules from the project,
3) re-import the Gradle Java modules to the project,
4) close AS,
5) re-open AS.
In that case AS does not *not* complain about Gradle Java modules to be non-Gradle Java modules, and I've confirmed that the generated *.iml files containexternal.system.id ="GRADLE".
However, if I do
6) close AS,
7) delete the *.iml files,
8) re-open AS,
then AS again complains *although* the generates files again containexternal.system.id ="GRADLE". It seems that the problem is related to "open" vs. "import". In the latter instructions, the *.iml files seem to get implicitly generated because the Gradle Java modules are referred to from setting.gradle.
Can it be that AS is somehow performing the check for non-Gradle Java modules before the *.iml files are generated in case of just opening (instead of importing) the project?
1) open AS,
2) delete the Gradle Java modules from the project,
3) re-import the Gradle Java modules to the project,
4) close AS,
5) re-open AS.
In that case AS does not *not* complain about Gradle Java modules to be non-Gradle Java modules, and I've confirmed that the generated *.iml files contain
However, if I do
6) close AS,
7) delete the *.iml files,
8) re-open AS,
then AS again complains *although* the generates files again contain
Can it be that AS is somehow performing the check for non-Gradle Java modules before the *.iml files are generated in case of just opening (instead of importing) the project?
al...@google.com <al...@google.com> #4
I see what is happening now. Yes, you are right. This is an issue with "open". I think I know how to fix this issue.
ss...@gmail.com <ss...@gmail.com> #5
Thanks for the confirmation. On a more or less related note, as this would not have happened if I was committing the *.iml files, what is your recommendation WRT this? I know about [1] which recommends to share "All the .iml module files", but it's kind of annoying that these files get rewritten if e.g. dependencies change in build.gradle. In general, most of the *.iml files seem to be duplicate content WRT the build.gradle files and can be derived from them. So, should we commit *.iml files for Gradle Android modules to Git?
[1]https://intellij-support.jetbrains.com/entries/23393067
[1]
al...@google.com <al...@google.com> #6
It is better not to add iml files to source control. For regular IDEA projects is OK because .iml files are the source of truth for project configuration. In the case of Android projects, the source of truth is gradle.build files, and .iml are generated from them every time you sync your project with Gradle.
ss...@gmail.com <ss...@gmail.com> #7
Thanks for the clear recommendation!
ss...@gmail.com <ss...@gmail.com> #8
@5 As you seem to know what the problem is, would it be appropriate to change the status from "NeedsInfo" to "Accepted"?
xa...@android.com <xa...@android.com>
ma...@gmail.com <ma...@gmail.com> #10
It also happens if there are comments in .iml file like:
<!----------- My comment -------------->
<!----------- My comment -------------->
[Deleted User] <[Deleted User]> #11
I just received this error from AS 1.2.1.1 and I do not have any non-Gradle Java modules in my project.
I have one main android application + six Android libraries.
We do not commit our .iml files to source control.
I have one main android application + six Android libraries.
We do not commit our .iml files to source control.
va...@gmail.com <va...@gmail.com> #12
I received the same error in version 1.3.2.
ck...@gmail.com <ck...@gmail.com> #13
I received this error on 2.1.2.
al...@gmail.com <al...@gmail.com> #14
[Comment deleted]
sa...@gmail.com <sa...@gmail.com> #15
received this error in 2.3 canary 2
[Deleted User] <[Deleted User]> #16
I am receiving this error in AS 2.3 Canary 2 after doing File->Invalidate Caches->Restart. Mine is a CMake project. This error is not very useful, since the project eventually builds anyway.
jk...@gmail.com <jk...@gmail.com> #17
[Comment deleted]
jk...@gmail.com <jk...@gmail.com> #18
I am seeing this with AS 2.3 Beta 1 as well. Since this issue has been closed for some time, I went ahead and created a new issue @ https://code.google.com/p/android/issues/detail?id=230550&thanks=230550&ts=1482021669
jk...@gmail.com <jk...@gmail.com> #19
#18 & #19: Did you happen to get this error after switching to Gradle 3.2?
And are you, by any chance, using the com.github.dcendents.android-maven plugin? I upgraded from 1.4.2 of that to 1.5, and updated to Gradle 3.2 at the same time, and I'm seeing the error even after downgrading to AS 2.2.3.
I'm in the process of doing a clean install now, and then I'll be trying reverting back to the older version of both, to see if that changes anything.
And are you, by any chance, using the com.github.dcendents.android-maven plugin? I upgraded from 1.4.2 of that to 1.5, and updated to Gradle 3.2 at the same time, and I'm seeing the error even after downgrading to AS 2.2.3.
I'm in the process of doing a clean install now, and then I'll be trying reverting back to the older version of both, to see if that changes anything.
jk...@gmail.com <jk...@gmail.com> #20
I don't know what's changed, but after a clean install, and removing ALL .iml files, after an initial complaint on opening the project, it rebuild all the .iml files and now seems fine. It's weird that last night, I tried making a brand-new project, and got the same results, but I'll take what I can get.
That said, it seems interesting to me that several people at once all seemed to run into the same thing. There may be something going on, still.
That said, it seems interesting to me that several people at once all seemed to run into the same thing. There may be something going on, still.
[Deleted User] <[Deleted User]> #21
The issue is still exist in android studio 3.0.1
al...@google.com <al...@google.com>
ko...@gmail.com <ko...@gmail.com> #22
Same here on android studio 3.0.1
mi...@gmail.com <mi...@gmail.com> #23
Same here on android studio 3.0.1
hu...@swifthero.ahf.xyz <hu...@swifthero.ahf.xyz> #24
Same here on android studio 3.0.1
je...@gmail.com <je...@gmail.com> #25
The same in Android 3.1
ab...@gmail.com <ab...@gmail.com> #26
also the same in Android 3.1
ta...@gmail.com <ta...@gmail.com> #27
where can i find java gradle module?
00...@gmail.com <00...@gmail.com> #28
same error in Android Studio 3.1.2
ri...@gmail.com <ri...@gmail.com> #29
Msg Error in Android Studio v 3.1.2 :
6:48 PM Unsupported Modules Detected: Compilation is not supported for following modules: AndroidStudioProjects. Unfortunately you can't have non-Gradle Java modules and Android-Gradle modules in one project.
I do not have any non-Gradle Java modules in my project.
6:48 PM Unsupported Modules Detected: Compilation is not supported for following modules: AndroidStudioProjects. Unfortunately you can't have non-Gradle Java modules and Android-Gradle modules in one project.
I do not have any non-Gradle Java modules in my project.
da...@gmail.com <da...@gmail.com> #30
The error occurs also in:
Android Studio 3.1.4
Build #AI-173.4907809, built on July 23, 2018
JRE: 1.8.0_152-release-1024-b01 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 4.15.0-32-generic
I am not sure, but I believe this causes further errors which are quite problematic. I have several projects with this issue: in all of them, some dependencies that are defined in a module's build.gradle file cannot be resolved by AS. Actually, the dependencies are resolved and downloaded from the repositories and show up under "External Libraries" in Project view. However, everywhere I try to use any class from those dependencies... I get a "Cannot resolve symbol XYZ". So I end up stuck with unresolved imports, no way to navigate through classes, etc.
The wierdest thing, though, is that the app compiles fine and runs in a device. It's just AS cannot resolve symbols from well-resolved dependencies.
Project structure overview:
- "app" Android application module (Gradle); depends on "commons", "annotations" and "processor" modules -> *gets detected as non-Gradle*
- "commons" Android library module (Gradle) with common utils, views, dependencies, etc.
- "annotations" java module (Gradle)
- "processor" java module (Gradle)
The symbols that are not resolved by AS come from dependencies defined in the "commons" module.
I have invalidated caches, deleted .idea and .gradle folders, re-downloaded the project, deleted ~/.gradle/caches folder, deleted *.iml files... no luck whatsoever.
Any hints on this issue? Do you believe the "Unsupported Modules Detected" error has anything to do with the "Cannot resolve symbol" issue?
Thanks a lot and best regards.
Android Studio 3.1.4
Build #AI-173.4907809, built on July 23, 2018
JRE: 1.8.0_152-release-1024-b01 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 4.15.0-32-generic
I am not sure, but I believe this causes further errors which are quite problematic. I have several projects with this issue: in all of them, some dependencies that are defined in a module's build.gradle file cannot be resolved by AS. Actually, the dependencies are resolved and downloaded from the repositories and show up under "External Libraries" in Project view. However, everywhere I try to use any class from those dependencies... I get a "Cannot resolve symbol XYZ". So I end up stuck with unresolved imports, no way to navigate through classes, etc.
The wierdest thing, though, is that the app compiles fine and runs in a device. It's just AS cannot resolve symbols from well-resolved dependencies.
Project structure overview:
- "app" Android application module (Gradle); depends on "commons", "annotations" and "processor" modules -> *gets detected as non-Gradle*
- "commons" Android library module (Gradle) with common utils, views, dependencies, etc.
- "annotations" java module (Gradle)
- "processor" java module (Gradle)
The symbols that are not resolved by AS come from dependencies defined in the "commons" module.
I have invalidated caches, deleted .idea and .gradle folders, re-downloaded the project, deleted ~/.gradle/caches folder, deleted *.iml files... no luck whatsoever.
Any hints on this issue? Do you believe the "Unsupported Modules Detected" error has anything to do with the "Cannot resolve symbol" issue?
Thanks a lot and best regards.
sa...@gmail.com <sa...@gmail.com> #31
Same error in 3.2.1
Did some research and this was the outcome after trying in Windows & Mac.
When importing a project you have a screen giving 2 options:
- Create project from existing sources
- Import project from external model
Inside the "Import project from external model" there are 2 more options:
- Android Gradle
- Gradle
If you select "Android Gradle" everything is fine, no false positive at all.
If you select Gradle you will get the false positive error message every time you open that project in Android Studio.
Did some research and this was the outcome after trying in Windows & Mac.
When importing a project you have a screen giving 2 options:
- Create project from existing sources
- Import project from external model
Inside the "Import project from external model" there are 2 more options:
- Android Gradle
- Gradle
If you select "Android Gradle" everything is fine, no false positive at all.
If you select Gradle you will get the false positive error message every time you open that project in Android Studio.
ri...@gmail.com <ri...@gmail.com> #32
same error in 3.5.1
ge...@gmail.com <ge...@gmail.com> #33
Same error in 4.0.0
ab...@gmail.com <ab...@gmail.com> #34
Same issue I am facing every single time I open my project in android studio 4.0.0
3d...@gmail.com <3d...@gmail.com> #35
AS 4,0,1
for one of older project
deleted .idea and .gradle folders, re-downloaded the project, deleted ~/.gradle/caches folder, deleted *.iml files..
work ok.
for one of older project
deleted .idea and .gradle folders, re-downloaded the project, deleted ~/.gradle/caches folder, deleted *.iml files..
work ok.
aq...@google.com <aq...@google.com> #36
+1
ja...@gmail.com <ja...@gmail.com> #37
This still happens with AS 4.0.1. All of my *.iml files specify 'external.system.id ="GRADLE"', and the Java modules build
when I double-click on the "build" gradle task - but the IDE can't build the Java modules itself. Better to use a Makefile for
building I guess ...
when I double-click on the "build" gradle task - but the IDE can't build the Java modules itself. Better to use a Makefile for
building I guess ...
la...@gmail.com <la...@gmail.com> #38
who solved this issue on the latest versions of AS, please share your actions
ro...@gmail.com <ro...@gmail.com> #39
Comment has been deleted.
so...@google.com <so...@google.com> #40
If you get this message it is unlikely to be the same old issue. Please file a new bug and, if possible, share your idea.log
files (Help | Show Log...
). Thank you!
ma...@gmail.com <ma...@gmail.com> #41
this is happening here too, nothing works, I'm using Android Studio Ladybug Feature Drop | 2024.2.2 Canary 1 on a mac m2
bug reported
bug reported
Description
I have some Gradle Java modules (ModuleA, ModuleB, ModuleC) in the same project as my Android modules. For the Gradle Java modules, I have *not* committed the *.iml files, just the *.gradle files. When opening the project, Android Studio complains:
Unsupported Modules Detected: Compilation is not supported for following modules: ModuleA, ModuleB, ModuleC. Unfortunately you can't have non-Gradle Java modules and Android-Gradle modules in one project.
However, Android Studio afterwards shows the Gradle Java modules' build.gradle files under "Gradle Scripts" in the "Project" view. Also, the *.iml files for the Gradle Java modules generated by Android Studio contain both the "android-gradle" and the "java-gradle" facet. So the modules *are* in some way correctly detected as Gradle modules, but still the warning about "Unsupported Modules Detected" is misleading.