Çözümümün lezzet yapılandırmasına göre:
- bölünmüş lezzet iki:
buildTypes {
release {...}
debug {...}
}
productFlavors {
dev { ... }
autoTest {
minSdkVersion 18 // set to 18 only in this flavor
multiDexEnabled true // if you got dex index overflow error
testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner'
}
}
hareket
Test ile ilgili bağımlılıklarınız "autoTestC" ye ompile"
// for test
autoTestCompile 'com.android.support.test:runner:0.5', {
exclude group: 'com.android.support', module: 'support-annotations'
}
autoTestCompile 'com.android.support.test:rules:0.5', {
exclude group: 'com.android.support', module: 'support-annotations'
}
autoTestCompile 'com.android.support.test.espresso:espresso-web:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
}
autoTestCompile 'com.android.support.test.espresso:espresso-contrib:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
exclude group: 'com.android.support', module: 'support-v4'
exclude group: 'com.android.support', module: 'design'
exclude group: 'com.android.support', module: 'recyclerview-v7'
}
autoTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.2', {
exclude group: 'com.android.support', module: 'support-annotations'
}
- Koşu Testi
Burada kabul edilebilir bir cevap olduğunu düşünüyorum. – theblang
@mattblang Henüz bir cevabı kabul etmediğim için özür dilerim. Tüm uygulama için sadece 'minSdkVersion' değerini değiştirdim ve verilen cevapları henüz doğrulamadım. Yine de, cevaplarımı kendim test etme şansım olduğunda bir cevabı kabul etmedim. –