Android 未能添加API
我按照指示去做 我犯了这个错误 错误:任务“:app:preDebugAndroidTestBuild”的执行失败。 与依赖项“com.android.support.test:运行程序”在项目中“app”冲突。应用程序(0.5)和测试应用程序(1.0.1)的解析版本不同。有关详细信息,请参阅 build.gradle项目Android 未能添加API,android,Android,我按照指示去做 我犯了这个错误 错误:任务“:app:preDebugAndroidTestBuild”的执行失败。 与依赖项“com.android.support.test:运行程序”在项目中“app”冲突。应用程序(0.5)和测试应用程序(1.0.1)的解析版本不同。有关详细信息,请参阅 build.gradle项目 buildscript { repositories { google() jcenter() } dependen
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven { url 'https://jitpack.io' }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
build.gradle应用程序
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.example.ofirv.gamesugest"
minSdkVersion 21
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'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
compile 'com.github.igdb:api-android-java:master-SNAPSHOT'
}
谢谢用下面的代码替换这一行
编译'com.github.igdb:api android java:master SNAPSHOT'
:(它应该可以工作。我已经为您测试过了)
谢谢,你能告诉我你做了什么吗?不客气!我从模块com.github.igdb:api android java:master SNAPSHOT中排除了冲突依赖项com.android.support.test:runner。
implementation ('com.github.igdb:api-android-java:master-SNAPSHOT'){
exclude module: 'runner'
}