Plugin errors in Android Studio 4.2 beta1
See original GitHub issueUsing de.mannodermaus.gradle.plugins:android-junit5:1.6.2.0 in Android Studio 4.2 beta1 in a multi-module project with:
- Gradle 6.7.1
- kotlin 1.4.20
- JUnit 5.7.0
- com.android.tools.build:gradle:4.2.0-beta01
- androidx.test🏃1.3.0
- de.mannodermaus.junit5:android-test-core:1.2.0
- de.mannodermaus.junit5:android-test-runner:1.2.0
I’m seeing two issues:
- Running an individual instrumented test works, but @BeforeAll function not invoked
- in the android block of build.gradle.kts, attempting this testOptions block:
testOptions {
junitPlatform {
instrumentationTests {
// Whether or not to validate configuration of instrumentation tests in this build
integrityCheckEnabled = true
}
}
}
The junitPlatform block shows as a syntax error even though the de.mannodermaus.android-junit5 is present and working in the plugins block.
Without the testOptions block, and manually invoking the @BeforeAll function, the instrumented test runs fine, and debugs fine using JUnit5 as far as I can tell. I know AS 4.2 beta 1 is brand new (and a beta), as is the android gradle plugin, so issues are not surprising. If there is anything additional I can do to help diagnose this, let me know.
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Known issues with Android Studio and Android Gradle Plugin
This update causes an underlying behavior change related to signing keys. To work around this issue, enter the same password for both the...
Read more >Gradle build failed after updating android studio to 4.2 Beta1
I've just updated android studio and can't build my previous project. I've encountered these errors: class jdk.internal.loader.
Read more >Cannot build signed APK on Android studio 4.2 beta 1 ...
When building Signed APK receive error with message. Missing class: org.conscrypt.ConscryptHostnameVerifier. Missing class: java.lang.instrument.
Read more >Fix Android Studio error: Missing essential plugin - YouTube
Just update Android Studio 4.2.1, but fail to run with error of: Missing essential plugin : org.jetbrains.android Please reinstall Android ...
Read more >Android Studio 4.2 Canary 3 available
General Fixes ; Android Gradle Plugin. Issue #158545411: Non-shrunk desugared library should only be packaged in the app APK ; Build Analyzer.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve had a similar experience with a different plugin before, where the provided DSL was not recognized at all and I had to use a different means to configure it. Might be a Kotlin DSL/Android Studio issue, rather than something within android-junit5.
As a workaround, you can forego the DSL sugar and access the extension directly with Kotlin DSL’s
the
method:This was resolved with the 1.7.1.1 release of the plugin, which moved the location of the extension to the
Project
rather than theTestOptions
block of the Android plugin. After updating to that version, either of the following will work (though the first version is more canonical):