-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
javax.tools.ToolProvider could not be found in InlineByteBuddyMockMaker #1855
Comments
I think this commit is part of the problem: https://github.com/mockito/mockito/pull/1567/files |
I tried with mockito 2.22.0, which should be a release before the commit, but the error is still there. https://github.com/mockito/mockito/releases?after=v2.23.0 edit: what fixed the issue for me was removing the |
The inline mockmaker is not supported on Android (as listed in the exception). However, we should probably not crash before we can show that message to the user. I would welcome a PR to fix this problem. |
@TimvdLippe What should people do for android then? Kotlin uses final classes only. |
@raphw What is our advice for Android? I don't remember what our final resolution was for inline + android for Kotlin. |
I just started using https://mockk.io/. Its Kotlin friendly also |
On Android, the inline mock maker won't work (neither will Mockk which uses the same approach as we do). It does not support the instrumentation API alltogether. I do agree that the error message is misleading. Currently preparing a PR to improve this. |
You can achieve this by using com.linkedin.dexmaker:dexmaker-mockito-inline for APIs >= 28 |
Hi guys
I'm encountering a crash when I run
AndroidTest
that contain mocking class cause the ByteBuddy didn't foundjavax.tools.ToolProvider
. I tried to reinstall JDK 8 but doesn't work. It seems to bejavax.tools.ToolProvider
not existing in it.Could you guys help me please?
Cheer,
Natthawut
Environment
Gradle 5.4.1
Build time: 2019-04-26 08:14:42 UTC
Revision: 261d171646b36a6a28d5a19a69676cd098a4c19d
Kotlin: 1.3.21
Groovy: 2.5.4
Ant: Apache Ant(TM) version 1.9.13 compiled on July 10 2018
JVM: 1.8.0_231 (Oracle Corporation 25.231-b11)
OS: Mac OS X 10.15.2 x86_64
Dependencies
Strack trace
MockitoAndroid.zip
The text was updated successfully, but these errors were encountered: