-
Notifications
You must be signed in to change notification settings - Fork 305
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
Too strict androidx.fragment:fragment-testing dependency on androidx.test:monitor #481
Comments
thanks for the report. androidx.fragment is actually housed in the AOSP repository and uses the Android bug tracker, but I've filed an issue there on your behalf. |
OK thanks. Is it on public bugtracker? If so could you post a link, so I'll star/watch it. |
Sorry I filed it in an internal tracker. Here was the fragment's teams response It does - a strict dependency would show as [1.2.0]. You just need to add that updated dependency as a debugImplementation dependency to match fragment-testing - you can't upgrade only androidTestImplementation |
Repost (as this is more appropriate location): Adding any of these in AS 4.1:
causes in the Codelab Test template https://github.com/googlecodelabs/android-testing
|
The above workaround causes:
|
I also got stuck on the fragments part of the testing codelab ("8. Task: Launch a Fragment from a Test"). However, I downloaded the solution code given at the end of the codelab ("12. Solution code"), and it worked just fine. It turns out that the problem came from me updating the versions of the dependencies in the gradle files to the latest versions. I was able to isolate which dependency was causing the issue by updating each dependency one at a time while checking to see if the tests still work. It is this dependency that is the problem:
The given value of
There seems to be something funny going on that started with Espresso 3.3.0-alpha03 that is causing this issue. See my comment for @Zingam above. |
@eugene-ma I don't remember much about my troubles I finished the exercises a while ago. What I learned is that you should go to the respective libraries pages and get the version numbers from there and try to match the versions that are in the docs/release notes (for example if you are updating to the latest versions). That auto-update feature causes more troubles than it helps IHMO. |
In my project (not codelab) I update both dependencies regularly to the newest versions and have no issues so far. |
For the record, all of these versions of Espresso have not worked for me:
|
@eugene-ma |
@clint22 |
…aint Apparently the cross-dependency versioning is a bit messed up at the moment: android/android-test#481
This does not appear to be resolved, and now that the 3.3.x releases of all the test libraries etc have come out, it bit me. Thanks @koral-- for the workaround, excluding the monitor transitive constraint from the fragment-testing dependency allowed my existing unit test suite to pass. Here is a diff of the dependencies that shows what changes when you either apply the workaround here / exclude the monitor transitive from fragement-testing, or you don't:
Now that the libraries that require this new API are generally available, the lack of an updated fragment-testing with usable transitive dependency version constraints creates a breaking change with no notice situation |
Just in case anyone else needs it, currently this is exactly how we are using fragment-testing (and why): // debugImplementation required vs testImplementation: https://issuetracker.google.com/issues/128612536
debugImplementation("androidx.fragment:fragment-testing:1.2.5") {
exclude group:'androidx.test', module:'monitor'
}
|
…aint Apparently the cross-dependency versioning is a bit messed up at the moment: android/android-test#481
…aint Apparently the cross-dependency versioning is a bit messed up at the moment: android/android-test#481
This is a follow-up of closed #472
After further investigation it seems that closing reason is incorrect and root cause is also in this repo, not Android junit5.
Relevant posts in #472 thread:
#472 (comment)
and
#472 (comment)
Workaround:
The text was updated successfully, but these errors were encountered: