android.support.test不存在,android - Android-错误:程序包android.support.test不存在 - 堆栈内存溢出...

像波纹管一样使用:

dependencies.gradle :

ext {

versions = [

// For project configuration

java : JavaVersion.VERSION_1_8,

compileSdk : 28,

targetSdk : 28,

minSdk : 21,

buildTools : '28.0.2',

dokka : '0.9.16',

// For app

kotlin : '1.2.61',

coroutine : '0.24.0',

appCompat : '1.0.0-beta01',

recyclerview : '1.0.0-beta01',

constraintLayout : '2.0.0-alpha1',

cardview : '1.0.0-beta01',

browser : '1.0.0-beta01',

androidKtx : '1.0.0-beta01',

dagger : '2.16',

firebaseCloudMessage : '17.1.0',

firebaseAnalytics : '16.0.3',

playServices : '15.0.1',

exoPlayer : '2.8.2',

flexbox : '1.0.0',

material : '1.0.0-beta01',

room : '2.0.0-beta01',

lifecycle : '2.0.0-beta01',

rxKotlin : '2.2.0',

rxAndroid : '2.0.2',

moshi : '1.6.0',

okhttp : '3.11.0',

timber : '4.7.1',

threeTenABP : '1.1.0',

rxBinding : '2.1.1',

fresco : '1.10.0',

kotshi : '1.0.4',

frescoImageViewer : '0.5.1',

markwon : '1.1.0',

aVLoadingIndicatorView: '2.1.3',

glide : '4.8.0-SNAPSHOT',

// For wearable

wear : '2.3.0',

playServicesWearable : '15.0.1',

supportWearable : '27.1.1',

// For testing

junit : '4.12',

truth : '0.42',

espresso : '3.1.0-alpha4',

mockito : '2.21.0'

]

libraries = [

.....

.....

// For testing

junit : "junit:junit:${versions.junit}",

espressoCore : "androidx.test.espresso:espresso-core:${versions.espresso}",

espressoIntents : "androidx.test.espresso:espresso-intents:${versions.espresso}",

roomTest : "android.arch.persistence.room:testing:${versions.room}",

truth : "com.google.truth:truth:${versions.truth}"

]

}

然后build.gradle(project... :

buildscript {

apply from: rootProject.file('dependencies.gradle')

repositories {

jcenter()

google()

maven {

url 'https://maven.fabric.io/public'

}

}

dependencies {

classpath 'com.android.tools.build:gradle:3.2.0-rc02'

classpath 'com.google.gms:google-services:4.1.0'

classpath 'io.fabric.tools:gradle:1.25.4'

}

}

allprojects {

repositories {

google()

jcenter()

mavenCentral()

maven { url 'https://maven.google.com' }

}

apply from: rootProject.file('dependencies.gradle')

}

task clean(type: Delete) {

delete rootProject.buildDir

}

然后build.gradle(Module... :

apply plugin: 'com.android.application'

repositories {

jcenter()

}

android {

compileSdkVersion 28

defaultConfig {

applicationId "ww.ww.ww"

minSdkVersion 16

targetSdkVersion 28

versionCode 13

versionName "2.1"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

vectorDrawables.useSupportLibrary = true

multiDexEnabled true

}

buildTypes {

....

}

....

}

dependencies {

implementation fileTree(include: ['*.jar'], dir: 'libs')

implementation 'com.android.support.constraint:constraint-layout:2.0.0-alpha2'

implementation 'com.android.support:exifinterface:28.0.0-rc02'

implementation 'com.android.support:appcompat-v7:28.0.0-rc02'

implementation 'com.android.support:recyclerview-v7:28.0.0-rc02'

implementation 'com.android.support:cardview-v7:28.0.0-rc02'

implementation 'com.android.support:design:28.0.0-rc02'

implementation 'com.android.support:support-vector-drawable:28.0.0-rc02'

implementation 'com.android.support:multidex:1.0.3'

//espresso

testImplementation libraries.junit

testImplementation libraries.truth

androidTestImplementation libraries.espressoCore

androidTestImplementation libraries.espressoIntents

...

}

注意这一行:

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值