Skip to content

android.testOptions.junitPlatform.unitTests.includeAndroidResources does not work #78

@theojalba

Description

@theojalba

When I add the option android.testOptions.junitPlatform.unitTests.includeAndroidResources to the app build.gradle, there is an Gradle error:

Could not set unknown property 'includeAndroidResources' for object of type de.mannodermaus.gradle.plugins.junit5.AndroidJUnitPlatformExtension$UnitTestOptions.

This is a snippet from the build.gradle:

android {
  ...
  testOptions {
    ...
   junitPlatform {
     ...
     unitTests {
       // Fix unit test resources not included with AS3
       includeAndroidResources = true
     }
  }
}

Some background info on this flag: https://android.jlelse.eu/make-robolectric-compatible-with-latest-gradle-tools-3-0-0-eca085681b3b

To fix this in the plugin, it seems you need to add the following line:
var includeAndroidResources = false

around here:

Could you fix this and release a new version with support for this flag so we can use resources in unit tests?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions