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

ExceptionInInitializerError: Exception java.lang.NoSuchFieldError: mFlags [in thread "Test worker"] with 14-robolectric-10818077 #87

Open johnjohndoe opened 2 months ago

johnjohndoe commented 2 months ago

Context

Current state

Target state

Test failures

Running the unit tests in the project via ./gradlew testDebugUnitTest :engelsystem:test testCcc37c3DebugUnitTest results in test failures, e.g.:

java.lang.NoClassDefFoundError: Could not initialize class android.os.Bundle
    at androidx.core.os.BundleKt.bundleOf(Bundle.kt:34)
    at nerd.tuxmobil.fahrplan.congress.extensions.IntentExtensionsKt.withExtras(IntentExtensions.kt:12)
    ...

    Caused by:
    java.lang.ExceptionInInitializerError: Exception java.lang.NoSuchFieldError: mFlags [in thread "Test worker"]
        at android.os.Bundle.<init>(Bundle.java:77)
        at android.os.Bundle.<clinit>(Bundle.java:65)
        at androidx.core.os.BundleKt.bundleOf(Bundle.kt:34)
        at nerd.tuxmobil.fahrplan.congress.extensions.IntentExtensionsKt.withExtras(IntentExtensions.kt:12)
        ...

See: IntentExtensionsKt.withExtras -> androidx.core.os.bundleOf

Related