Search result for Question Taged junit5
There are some results of your Tag: junit5
    How to deal with deprecated gradle features were used in this build, making it incompatible with gradle 8.0

    1. FAILURE
    2. Sometime when you try to build the app you may encounter this FAILURE.
      ..."Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0."

    3. Most common Solution
    4. Run the Gradle build with a command line argument --warning-mode=all to see what exactly the deprecated features are.

      It will give you a detailed description of found issues with links to the Gradle docs for instructions how to fix your build.

      Adding --stacktrace to that, you will also be able to pinpoint where the warning comes from, if it's triggered by outdated code in one of the plugins and not your build script.

    5. Solution 2
    6. if the abouve Solution dont work Try this one

      cd android && ./gradlew clean && ./gradlew :app:bundleRelease

    7. Solution 3
    8. The process below worked in many case- First check Gradle Version:

      cd android
      ./gradlew -v

      In my case it was 6.5

      Go to and you'll get the plugin version for your gradle version. For gradle version 6.5, the plugin version is 4.1.0

      Then go to app/build.gradle and change classpath '<plugin_version>

    9. Solution 4
    10. if your project is incompatible with Gradle 8.0 .Here's what worked for you: First write this line of code in the Android Studio terminal:

      ./gradlew build --warning-mode all

      When you do that, you will be shown in the logcat what is found to be deprecated or an issue in your project, for me it was the jcenter() repository that needed to be removed in my settings.gradle file and also I needed to update classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.21" to classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.30" in my build.gradle project file.

      Once I did these things, my project built perfectly and installed on my emulator

    Kyle Elkins 2022-08-09
    android - JUnit5IdeaTestRunner fails running unit tests

    Suddenly Android Studio can't run unit tests for one of my modules. I get the error:

    Internal Error occurred. java.util.NoSuchElementException
    at java.util.ArrayList$
    at java.util.Collections$UnmodifiableCollection$
    at com.intellij.junit5.JUnit5TestRunnerUtil.createSelector(
    at com.intellij.junit5.JUnit5TestRunnerUtil.buildRequest(
    at com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs(
    at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(
    at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(
    at com.intellij.rt.execution.junit.JUnitStarter.main(

    The only thing I need to know is whether this is a known issue.
    Please notice that the unit tests of all the modules succeed if I run them in the external terminal or in the terminal in Android Studio or on the CI.
    And if I run on Android Studio the same unit test configuration, changing only the module then everything works fine.

    Please don't ask me to post the build.gradle files. Although it is likely that the problem is there, they are too big and more importantly if that is the problem, I wouldn't expect you to debug it.

    Nandita Maud 2022-11-01
    android - How to Store Values in JUnit 5 Extensions and Inject in Parameterized Test


    Expected - Create a JUnit 5 Extension class in order to manage use of a TestCoroutineDispatcher.

    Observed - Unable to access the testDispatcher variable created within the Extension class.

    Extension Implementation


    @ExtendWith(InstantExecutorExtension::class, MainCoroutineExtension::class)
    class FeedLoadContentTests {
        private val contentViewModel = ContentViewModel()
        private fun FeedLoad() = feedLoadTestCases()
        fun `Feed Load`(test: FeedLoadContentTest) = testDispatcher.runBlockingTest {
            // Some testing done here.


    class MainCoroutineExtension : BeforeEachCallback, AfterEachCallback {
        val testDispatcher = TestCoroutineDispatcher()
        override fun beforeEach(context: ExtensionContext?) {
        override fun afterEach(context: ExtensionContext?) {
    Nadra Serapion 2022-12-01