gpt4 book ai didi

android - 无法解析 com.android.support.test :runner:1. 0.0 和 'com.android.support.test.espresso:espresso-core:3.0.0'

转载 作者:塔克拉玛干 更新时间:2023-11-02 20:46:02 24 4
gpt4 key购买 nike

这是我的build.gradle(app)

buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}

dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

repositories {
maven { url 'https://maven.fabric.io/public' }
}


android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "com.my.app"
minSdkVersion 16
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dataBinding {
enabled = true
}

packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
}
}

ant.importBuild 'assets.xml'
preBuild.dependsOn(list, checksum)
clean.dependsOn(clean_assets)

def dagger_version = "2.10"
def retrofit2_version = "2.2.0"
def support_package_version = "26.0.0-alpha1"
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
//dagger
compile "com.google.dagger:dagger:${dagger_version}"
annotationProcessor "com.google.dagger:dagger-compiler:${dagger_version}"
//retrofit2
compile "com.squareup.retrofit2:retrofit:${retrofit2_version}"
compile "com.squareup.retrofit2:converter-jackson:${retrofit2_version}"
//okhttp3
//support packages
compile "com.android.support:appcompat-v7:${support_package_version}"
compile "com.android.support:cardview-v7:${support_package_version}"
compile "com.android.support:design:${support_package_version}"

compile project(':pocketsphinx-android-5prealpha-release')
compile 'pl.bclogic:pulsator4droid:1.0.3'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.squareup.okhttp3:logging-interceptor:3.4.1'

compile 'com.android.support:support-annotations:25.3.1'


testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-core:1.10.19'
androidTestCompile 'com.android.support.test.espresso:espresso-core:3.0.0'
androidTestCompile 'com.android.support.test:runner:1.0.0'

compile('com.crashlytics.sdk.android:crashlytics:2.6.8@aar') {
transitive = true;
}
}

我注意到来自 here 的有争议的依赖关系我得到以下错误

Failed to resolve:com.android.support.test.espresso:espresso-core:3.0.0

Failed to resolve:com.android.support.test:runner:1.0.0

我已经更新了 sdk 管理器,但仍然面临这个问题。我必须降级到较低版本吗?谁能帮忙?

最佳答案

当我想尝试 Espresso 时遇到了同样的问题。

我已经通过添加解决了

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

allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}

在项目的 build.gradle 文件中。参见 https://developer.android.com/topic/libraries/testing-support-library/packages.html#gradle-dependencies .

关于android - 无法解析 com.android.support.test :runner:1. 0.0 和 'com.android.support.test.espresso:espresso-core:3.0.0',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45622351/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com