Android Studio 3.0 Beta 4 woes
See original GitHub issueI’ve stripped your sample and tried to run it with Android Studio 3.0 Beta 4 64-bit on Windows, but it fails with the following error:
"C:\Program Files\Java\jdk1.8.0_141\bin\java" ...
Exception in thread "main" java.lang.NoSuchMethodError: org.junit.platform.launcher.Launcher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;)V
at com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs(JUnit5IdeaTestRunner.java:61)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:51)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.rt.execution.application.AppMainV2.main(AppMainV2.java:131)
Process finished with exit code 1
From previous issues I’ve gathered that this release should work out-of-the-box with the preview editions of Android Studio. However, I’ve also tried the workarounds mentioned in JUnit 5 docs for IntelliJ IDEA without any luck.
Running from command line works fine:
sample ❯❯❯ .\gradlew.bat testDebugUnitTest
> Task :junitPlatformTestDebug
@BeforeAll
@Before Test taggedTest()
@After Test taggedTest()
@Before Test ordinaryTestCase()
@After Test ordinaryTestCase()
@Before Test dynamicTestsGeneratedFromFactory()
@After Test dynamicTestsGeneratedFromFactory()
@Before Test [1] Android's Cool!
@After Test [1] Android's Cool!
@Before Test [2] JUnit 5 as well
@After Test [2] JUnit 5 as well
@Before Test [3] Acknowledgement
@After Test [3] Acknowledgement
@Before Test Test with Custom Display Name in nested class
@After Test Test with Custom Display Name in nested class
@AfterAll
Test run finished after 2465 ms
[ 6 containers found ]
[ 0 containers skipped ]
[ 6 containers started ]
[ 0 containers aborted ]
[ 6 containers successful ]
[ 0 containers failed ]
[ 10 tests found ]
[ 1 tests skipped ]
[ 9 tests started ]
[ 0 tests aborted ]
[ 9 tests successful ]
[ 0 tests failed ]
BUILD SUCCESSFUL in 6s
17 actionable tasks: 1 executed, 16 up-to-date
I’ve attached the stripped project if it matters: android-junit5-sample.zip
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Android Studio 3.0 Beta 4 is now available
Android Studio 3.0 Beta 4 is now available in the Canary, Dev and Beta channels. Changes. New Android plugin DSL for manipulating dependency ......
Read more >How to install Android studio 3.0 beta 4 in windows?
When you click the android-studio\bin\studio64.exe you should follow this step by step instruction:.
Read more >Known issues with Android Studio and Android Gradle Plugin
Find out about current known issues with Android Studio and the Android Gradle Plugin. ... Android Studio doesn't start after installing version 4.2....
Read more >Android Studio 3.0 Beta 4 is available now! : r/androiddev
Is the problem with not being able to refactor stuff that's in generated files(R, dagger etc.) due to not having write permissions still...
Read more >Can't rename resource (layout) files in Android Studio 3.0 Beta ...
same problem here. no amount of CLI manual gradle clean and/or Build → Clean Project helped. Restarting did not help either. I don't...
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
Unfortunately no, but you can check the README for a solution to the problem, because I’ve come up with a workaround. Apply the
android-junit5-embedded-runtime
dependency as a separate entry in yourdependencies
and you can run the tests again.No change with 3.0 Beta 5.