android - Cannot resolve symbol 'AndroidJUnit4' -
obviously need correct import statment solve problem. according docs androidjunit4
, should
import android.support.test.runner.androidjunit4;
when that, android studio highlights runner
in red , complains "cannot resolve symbol 'runner'".
background
i got point following tutorials on android developer site setting tests using ui automator. first problem encountered com.android.support:support-v4:22.2.0
, com.android.support.test:runner:0.2
depend on different versions of com.android.support:support-annotations
. followed suggestions this android bug report , added following allprojects
in project's build.gradle
:
configurations.all { resolutionstrategy.force 'com.android.support:support-annotations:22.1.0' }
this solved immediate error, suspect lead current problems. have suggestions how fix this?
relevent sections `./gradlew :app:dependencies
androidtestcompile - classpath compiling androidtest sources. +--- com.jayway.android.robotium:robotium-solo:5.2.1 +--- com.squareup:fest-android:1.0.8 | \--- org.easytesting:fest-assert-core:2.0m10 | \--- org.easytesting:fest-util:1.2.5 +--- com.android.support.test:runner:0.2 | +--- junit:junit-dep:4.10 | | \--- org.hamcrest:hamcrest-core:1.1 | +--- com.android.support.test:exposed-instrumentation-api-publish:0.2 | \--- com.android.support:support-annotations:22.0.0 -> 22.2.0 +--- com.android.support.test:rules:0.2 | \--- com.android.support.test:runner:0.2 (*) \--- com.android.support.test.uiautomator:uiautomator-v18:2.1.0 compile - classpath compiling main sources. +--- com.android.support:appcompat-v7:22.2.0 | \--- com.android.support:support-v4:22.2.0 | \--- com.android.support:support-annotations:22.2.0 +--- com.android.support:support-v4:22.2.0 (*) +--- com.google.android.gms:play-services:6.1.71 | \--- com.android.support:support-v4:20.0.0 -> 22.2.0 (*) +--- com.crashlytics.android:crashlytics:1.+ -> 1.1.13 \--- com.jakewharton:butterknife:5.1.2
Comments
Post a Comment