Fixed
Status Update
Comments
ad...@atlassian.com <ad...@atlassian.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.
sl...@google.com <sl...@google.com>
be...@google.com <be...@google.com>
cm...@google.com <cm...@google.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?
ad...@atlassian.com <ad...@atlassian.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.
cm...@google.com <cm...@google.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]
k....@gmail.com <k....@gmail.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.
[Deleted User] <[Deleted User]> #7
Thanks for the clear recommendation!
sl...@google.com <sl...@google.com>
nk...@google.com <nk...@google.com> #8
@5 As you seem to know what the problem is, would it be appropriate to change the status from "NeedsInfo" to "Accepted"?
Description
Version used: espresso 3.0.1, runner:1.0.1
What steps will reproduce the problem?
1. Using this build.gradle from a standard library module created by the android studio 3.0.0 template
apply plugin: 'com.android.library'
android {
compileSdkVersion 26
defaultConfig {
minSdkVersion 16
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.google.android.gms:play-services-auth:11.6.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}
2. execute ./gradlew :myLibrary:connectedAndroidTest
3. Results in
Execution failed for task ':mylibrary:transformResourcesWithMergeJavaResForDebugAndroidTest'.
More than one file was found with OS independent path 'protobuf.meta'
How are you running your tests (via Android Studio, Gradle, adb, etc.)?
run through Gradle.
What is the expected output? What do you see instead?
Expected successful build