car-samples icon indicating copy to clipboard operation
car-samples copied to clipboard

HelloWorld can't run the testing

Open icools opened this issue 3 years ago • 1 comments

In the Helloworld sample testing , gralde did not include the

testImplementation"androidx.car.app:app-testing:1.0.0-alpha01"

https://developer.android.com/reference/kotlin/androidx/car/app/testing/package-summary

or declare any testing define in the hello world build.gradle

also missing robolectric / junit and others

the car testing can't run.

icools avatar May 21 '21 02:05 icools

maybe HelloWorld gradle is

`android { compileSdkVersion 29

defaultConfig {
    applicationId "androidx.car.app.samples.helloworld"
    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    minSdkVersion 23
    targetSdkVersion 29
    versionCode 1
    versionName "1.0"
}

compileOptions {
    targetCompatibility = JavaVersion.VERSION_1_8
    sourceCompatibility = JavaVersion.VERSION_1_8
}

}

dependencies { implementation "androidx.car.app:app:1.0.0" testImplementation 'junit:junit:4.13.2' testImplementation "androidx.car.app:app-testing:1.0.0-alpha01" testImplementation 'androidx.test:runner:1.3.0' testImplementation "org.robolectric:robolectric:4.4" testImplementation "androidx.test:core:1.3.0" testImplementation "com.google.truth:truth:1.0" androidTestImplementation "com.google.truth:truth::0.40" } `

icools avatar May 21 '21 02:05 icools