bjoernQ / unmock-plugin

Gradle plugin to be used in combination with the new unit testing feature of the Gradle Plugin / Android Studio to use real classes for e.g. SparseArray.
Apache License 2.0
323 stars 22 forks source link

[Supprot]The specified API level can not be greater than 21 #25

Closed Raynor999 closed 7 years ago

Raynor999 commented 7 years ago

downloadFrom 'https://oss.sonatype.org/content/groups/public/org/robolectric/android-all/6.0.0_r1-robolectric-0/android-all-6.0.0_r1-robolectric-0.jar' After API 21,com.android.internal.util.ArrayUtils.java implemention has changed, Dependencies:SparseArray .java ->com.android.internal.util.ArrayUtils ->dalvik.system.VMRuntime
Even if "dalvik.system.VMRuntime " is mocked, it will crash at initialize Sparse
Array.

bjoernQ commented 7 years ago

I will have a look into this and update the sample project to API level 21.

bjoernQ commented 7 years ago

I updated the sample project. It should work using version 0.6.0 of the plugin which adds some magic to handle some VMRuntime and java.lang.System method calls internally.