Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Splits option breaks test module #24

Open
MartinDevi opened this issue May 31, 2017 · 0 comments
Open

Splits option breaks test module #24

MartinDevi opened this issue May 31, 2017 · 0 comments

Comments

@MartinDevi
Copy link

I had an issue when trying to set up a testing module, based on the model provided in module-flavor1-androidTest-only. I eventually realized that it was due to the fact that I had ABI splits set up in my application, leading the connectedAndroidTest task to fail.

I was able to reproduce the issue in this project by adding the following snippet inside the android block of the app module's build.gradle file:

splits.abi {
    enable true
    reset()
    include 'armeabi', 'armeabi-v7a'
}

By running ./gradlew module-flavor1-androidTest-only:connectedDebugAndroidTest, I get the same exception as in my application.

> Expected configuration ':module-flavor1-androidTest-only:testTarget-metadata' to contain exactly one file, however, it contains no files.

By debugging Gradle, I found that the error occurs because TestApplicationData#getTestedApks handles modules with splits differently, since testedApkFiles.size() > 1 && splitSelectExe != null evaluates to true. The code then fails at TestApplicationData#loadMetadata.

I ended up disabling splits in my app, only when I'm running the instrumentation tests in this module. Any idea for a better workaround in the Gradle setup? Or is this just a bug in the Android Gradle Plugin which should be reported to their development team?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant