स्वाद विन्यास के आधार पर
मेरे समाधान:
- विभाजन दो स्वाद के लिए:
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'
}
}
- चाल आपके परीक्षण से संबंधित निर्भरताओं "autoTestC में 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'
}
- भागो टेस्ट
स्रोत
2017-07-27 07:16:23
मुझे लगता है कि एक स्वीकार्य जवाब यहाँ नहीं है। – theblang
@mattblang अभी तक एक उत्तर स्वीकार नहीं करने के लिए मेरी माफ़ी। मैं पूरे ऐप के लिए बस 'minSdkVersion' बदल रहा हूं और अभी तक दिए गए उत्तरों को सत्यापित नहीं किया है। मैं भूल गया हूं, हालांकि, जवाब देने का मौका मिलने पर मुझे जवाब स्वीकार नहीं होगा। –