-
Notifications
You must be signed in to change notification settings - Fork 249
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
Cannot inject mocks when using dexmaker-mockito-inline #119
Comments
|
Hi, thank you for your reply. Here is the logcat: the component i try to test is mentioned as "my_service". Related to your second point in the previous comment i do run on Android P and i have set my application as debuggable before running the test. From what i can see in logcat there seems to be some ABI incompatibility issue that stroke my attention. |
Can you please provide the whole logcat (via adb logcat), from 5 seconds before to 5 seconds after your test. |
Here it is |
What device are you running on? This should not happen on a release version of Android P. Did you update your enumerator to the latest version. Here is the issue.
|
It is a custom proprietary device running Android but unfortunately i cannot disclose something more on that. Which enumerator do you refer to? |
If you run a custom Android, please make sure that you branch this Android off the final pi-dev branch. Your Android seems to be missing the change that added this method. |
It seems i have the appropriate commits in place. Could it be that i use non-SDK API as the commit mentions? But it is a quite simple test i try to run where i try to mock an Intent and a Context. The Context is part of the SDK i guess? |
I don't think it matters what you mock as we fail to initialize the mockito mockmaker. I recommend to write a test that does nothing else than access VMDebug#allowHiddenApiReflectionFrom via reflection. Once this is possible this problem your mockito problem will probably go away. |
Hi i have an issue using dexmaker-mockito-inline from within android studio.
I want to use it in order to mock some final methods of a class but before doing that i try to run some tests that were previously successfully run on target when i was using mockito-android.
I run my test class with MockitoJUnitRunner and i use mock annotations like @mock and @Injectmocks
and i seem to have issues when initMocks() is called:
The stacktrace is the following:
My build.gradle looks like this
What could be the cause of it?
Previously there was no issue when i was using
Thank you in advance
The text was updated successfully, but these errors were encountered: