-
Notifications
You must be signed in to change notification settings - Fork 202
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
Version 5.0.0 + Android fails with: Cannot inline bytecode built with JVM target 11 #488
Comments
Does this mean we are stuck with v4.x for Android development for the foreseeable future? |
The drop of compatibility is listed on mockito-core in its release notes combined with the rationale: https://github.com/mockito/mockito/releases/tag/v5.0.0 If you still need to support Java 8, you can keep on using Mockito 4. Nothing should break there. |
I was unaware that Mockito 5 no longer offers support for Java 8. Does this imply that for Android projects, the jvmTarget should now be set to VERSION_11? It seems to be supported with Android Gradle Plugin 7.0. If that's the case, would it be advisable to include a note in the Readme.md specifically for Android developers regarding this change? |
Yes that is indeed now required. Feel free to send me a PR with a README update on the version similar to what we have in the README of |
i have set jvmtarget and compatibility in compileoptions to Java 11 but the problem still exists |
@wiryadev, would it be possible for you to share an example project that demonstrates the issue you're encountering? The project linked at the beginning of this issue, https://github.com/bvschaik/mockito-kotlin-error, was resolved by adjusting the compile options to use JVM 11.
|
unfortunately it is not possible currently to create sample project for that nor that it is possible to share my office work project. I choose to just downgrade to 4.1.0. My current assumption is this happens because of some dependency that i use is compiled against Java 8. |
Android projects still use JVM target 1.8 due to device constraints; the gradle file therefore contains:
Upgrading mockito-kotlin from 4.1.0 to 5.0.0 causes the following compile error on any mock/whenever/etc call:
JVM target 11 is nowhere to be found in the Gradle files.
Steps to reproduce:
./gradlew testDebugUnitTest
If you downgrade mockito-kotlin to 4.1.0, the project compiles and runs successfully.
If mockito-kotlin no longer supports JVM 1.8, that should've been noted in the changelog.
The text was updated successfully, but these errors were encountered: