gpt4 book ai didi

android - 程序类型已存在 : org. xmlpull.v1.XmlPullParserException

转载 作者:行者123 更新时间:2023-11-29 02:25:04 29 4
gpt4 key购买 nike

将 robolectric 添加到 build.gradle 文件后出现错误

Program type already present: org.xmlpull.v1.XmlPullParserException.

我已经尝试使用 exclude 'org.xmlpull.v1' from configurations.allandroidTestImplementation 'org.robolectric:robolectric:3.8' 但它不起作用。

这是 build.gradle 文件。

apply plugin: 'com.android.application'

android {
compileSdkVersion 28
buildToolsVersion '28.0.2'
defaultConfig {
applicationId "com.app.aim_app"
minSdkVersion 17
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunnerArguments clearPackageData: 'true'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
testOptions {
execution 'ANDROID_TEST_ORCHESTRATOR'
unitTests {
includeAndroidResources = true
}
}
}

repositories {
mavenCentral()
google()
maven {
url 'https://maven.google.com'
}
jcenter()
maven {
name 'glide-snapshot'
url 'http://oss.sonatype.org/content/repositories/snapshots'
}
}

configurations.all {
resolutionStrategy.force 'com.android.support:support-annotations:28.0.0'
}

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:28.0.0', files('/libs/App42MultiPlayerGamingSDK.jar')
testImplementation 'junit:junit:4.12'
implementation 'com.github.bumptech.glide:glide:4.7.1'
annotationProcessor 'com.github.bumptech.glide:compiler:4.7.1'

androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test:rules:1.0.2'
androidTestImplementation 'com.android.support:support-annotations:28.0.0'
implementation "com.android.support.test.espresso.idling:idling-concurrent:3.0.2"

androidTestUtil 'com.android.support.test:orchestrator:1.0.2'

androidTestImplementation 'org.robolectric:robolectric:3.8'
}

最佳答案

乍一看,有一行代码立即脱颖而出。我会改变

implementation "com.android.support.test.espresso.idling:idling-concurrent:3.0.2"

androidTestImplementation "com.android.support.test.espresso.idling:idling-concurrent:3.0.2"

因为 Espresso 旨在协助 UI 自动化测试。

关于android - 程序类型已存在 : org. xmlpull.v1.XmlPullParserException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52717057/

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