Hi, anyone got this error when build to run test f...
# android
p
Hi, anyone got this error when build to run test for DAO(Room database)?
Copy code
Unresolved reference: testing
Unresolved reference: InstantTaskExecutorRule

This is my test class:
=========================================
package com.kotlin.practice.githubrepo.db

import androidx.arch.core.executor.testing.InstantTaskExecutorRule
import androidx.test.ext.junit.runners.AndroidJUnit4
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith

@RunWith(AndroidJUnit4::class)
class RepoDaoTest : DbTest() {

    @get:Rule
    var instantTaskExecutorRule = InstantTaskExecutorRule()

    @Test
    fun insertAndRead() { }
}
g
do you have core-testing dependency?
p
i just change JUnit version from
4.13
to
4.12
, and it work fine, not sure what happen with 4.13!
this is my dependency
Copy code
testImplementation 'androidx.test:core:1.3.0'
testImplementation "androidx.arch.core:core-testing:2.1.0"
androidTestImplementation "android.arch.persistence.room:testing:1.1.1"
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
g
I don’t think it’s related