SpyZip
SpyZip

Reputation: 5540

Robolectric includeAndroidResources not found

I'm following this http://robolectric.org/getting-started/

but I'm getting: Error:(61, 0) Could not set unknown property 'includeAndroidResources' for object of type com.android.build.gradle.internal.dsl.TestOptions$UnitTestOptions.

when I add

    android {
      testOptions {
        unitTests {
          includeAndroidResources = true
        }
      }
    } 

Upvotes: 12

Views: 5789

Answers (3)

heLL0
heLL0

Reputation: 1425

Including this:

android {

    testOptions.unitTests.isIncludeAndroidResources = true

 }

worked for me.

Upvotes: 1

Delly Fabian Lucas
Delly Fabian Lucas

Reputation: 79

Try this code

    testOptions {
        unitTests {
          isIncludeAndroidResources = true
        }
    }

Upvotes: 6

Daniel Tejada
Daniel Tejada

Reputation: 49

starting with Robolectric 3.3 you’ll need Android Studio 3.0 alpha 5.

I guess you're using an older version of Android Studio.

Upvotes: 4

Related Questions