Status Update
Comments
js...@googlemail.com <js...@googlemail.com> #2
This behavior occurs since com.android.tools.build:gradle:7.1.0
. With com.android.tools.build:gradle:7.0.4
it runs fine.
So I'm not sure anymore if this is then a problem with AS or with the gradle plugin (which is recommended to use by AS).
sm...@google.com <sm...@google.com>
pa...@google.com <pa...@google.com> #3
Hi, are you using Unified Gradle test runner to run your tests in Studio? You can check by going to File > Settings > Build, Execution, Deployment > Testing and checking if "Run Android instrumented tests using Gradle" is checked.
he...@worldiety.de <he...@worldiety.de> #4
Hello! I am having the same issue. For me, deactivating the "Unified Gradle test runner" fixes the problem.
he...@worldiety.de <he...@worldiety.de> #5
To be more specific, this seems to happen with all projects, that have the tests in the root-project. When the root-project contains sub-projects with tests, like in a structure
MyRootProject +-- SubProject
the subprojects work without problems. Also this only seems to happen with the newer Android gradle plugins. I verified the error occurs for 7.1.2 while the 7.0.x seem to work correctly.
ar...@google.com <ar...@google.com> #6
This seems to be a problem in the AGP.
Assigning to Build team to take a look.
ga...@google.com <ga...@google.com> #7
To reproduce the issue, run:
git clone https://github.com/nextcloud/android && git reset --hard 2a6398addac23366ece60fb26243d3a397e426a7
and import in BB after that.
The issue is that Studio tries to run Nextcloud:connectedGenericDebugAndroidTest
task, but the correct task name is connectedGenericDebugAndroidTest
. Nextcloud
is just a root project name, but it should not be in the full task path.
Karima/Yuriy, do you know how task name is computed for android tests?
ka...@google.com <ka...@google.com> #8
I think everything regarding the UTP is located in com.android.tools.idea.testartifacts.instrumented
package.
ga...@google.com <ga...@google.com> #9
Yuki, can you please take a look, and check if
private fun getTaskNames(androidModuleModel: GradleAndroidModel): List<String> {
return listOf(
"${moduleData.id}:connected${androidModuleModel.selectedVariantName.usLocaleCapitalize()}AndroidTest"
)
}
returns correct value?
so...@google.com <so...@google.com> #10
Did we add these task names ot models? I think it these task names should come from the AGP and for old versions be populated somewhere by sync.
hu...@google.com <hu...@google.com> #12
It wasn't reproduced on BumbleBee Patch 2 either. I also confirmed that ${moduleData.id}
returns "app" as I expected.
Are you able to reproduce it on your side, Ivan? It might be cache related issue or the stale RunConfiguration in the project. Please make sure to delete existing RunConfiguration and maybe clearing the cache in IDE.
hu...@google.com <hu...@google.com> #13
Sorry for the confusion. I'm now able to reproduce it after rerunning git reset --hard 2a6398addac23366ece60fb26243d3a397e426a7
command. (Apparently, git clone command returns non-zero status for me last time and git reset command wasn't executed).
This project has a bit tricky settings.gradle
:
rootProject.name = 'Nextcloud'
include ':'
"${moduleData.id}" is resolved to "Nextcloud".
Yuriy, is this an expected behavior? If so, what value should we use here instead?
hu...@google.com <hu...@google.com> #14
We should use moduleData.getGradlePath()
instead of moduleData.id
. I'll create a fix.
hu...@google.com <hu...@google.com>
lp...@gmail.com <lp...@gmail.com> #15
I did uninstall Android Studio and Re Install.
And revert gradle file from backup.
I got work. Do you have backup?
Description
Trying to run one or more instrumented tests via run configurations fails with the line:
Running the app on a connected phone works without, though.
Steps to reproduce:
Nextcloud/java/com (androidTest)
-> right click ->Run tests in 'com'
"Example" project:https://github.com/nextcloud/android
Build: AI-211.7628.21.2111.8139111, 202202012023,
AI-211.7628.21.2111.8139111, JRE 11.0.11+0-b60-7590822x64 JetBrains s.r.o., OS Linux(amd64) v5.10.96-1-MANJARO, screens 1920.0x1080.0
AS: Bumblebee | 2021.1.1 Patch 1; Kotlin plugin: 211-1.6.10-release-923-AS7442.40; Android Gradle Plugin: 7.1.1; Gradle: 7.3.3; Gradle JDK: version 11.0.11; NDK: from local.properties: (not specified), latest from SDK: (not found); LLDB: pinned revision 3.1 not found, latest from SDK: (package not found); CMake: from local.properties: (not specified), latest from SDK: (not found), from PATH: 3.22.2Source: user_sentiment_feedback