-
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
Is it possible to use dexmaker-mockito-inline on API <28? #120
Comments
dexmaker-mockito-inline just does not work before API 28. There is no fall back or anything. You have to use dexmaker-mockito but they you cannot stub final methods. Some people though about extending dexmaker-mockito-inline with class loader tricks to work for most classes on older platforms, but this is not implemented yet. |
In my case the problem is with hidden api spying and mocking which does not work on Android P. |
Can you give an example what you are trying to do. Beside the test and simplified app code, can you also describe what device you are running on? |
I'm spying ApplicationPackageManager which is hidden. It works well on api <28 with dexmaker-mockito, on 28 it works with dexmaker-mockito-inline |
I think I could be possible to provide proxy MockMaker which initialize |
dexmaker-mockito in the latest version should be able to deal with hidden methods. I need the test, the gradle file and the test log to debug the issue. |
Check this project https://github.com/lsuski/dexmaker-hidden-api-test and ExampleInstrumentedTest |
Hi,
I need dexmaker-mockito-inline to run tests on Android 9.0, but I still want to run tests on older apis. Currently I have this error:
Caused by: java.io.IOException: Requires API level 28. API level is 23
Is there a way to run tests on different API without changing gradle dependencies which is not quite convenient?
The text was updated successfully, but these errors were encountered: