我不明白如何導入AndroidJUnit4。如何導入AndroidJUnit4
總是出現錯誤:無法解析symobol AndroidJUnit4。
gradle這個сonfig:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "test.test"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
}
}
testOptions {
unitTests.returnDefaultValues = true
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.2.0'
compile 'com.google.android.gms:play-services:8.4.0'
compile 'com.android.support:support-v4:23.2.0'
testCompile 'junit:junit:4.12'
androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.2'
androidTestCompile 'com.android.support:support-annotations:23.2.0'
androidTestCompile 'com.android.support.test:runner:0.4.1'
androidTestCompile 'com.android.support.test:rules:0.4.1'
}
此外,在SDK管理器我已下載「本地倉庫進行支承實Librarues」
我有同樣的問題。將測試標記爲Android Instrumentation是什麼意思? – scoleman2272
@ scoleman2272,太晚了,但是https://pp.vk.me/c626719/v626719718/2f670/NRRxzxNiEIU.jpg – z17
使用Maven時怎麼樣? – JohnyTex