- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我在为发布版本执行 gradle 构建时遇到此错误。
Error: xpp3 defines classes that conflict with classes now provided by Android. Solutions include finding newer versions or alternative libraries that don't have the same problem (for example, for httpclient use HttpUrlConnection or okhttp instead), or repackaging the library using something like jarjar. [DuplicatePlatformClasses]
我试图排除 httpclient
但没有帮助。
在调试版本中它可以工作,但在发布版本中它给了我这个错误。
我使用的是 Android 异步 Http 客户端,但删除它也没有解决错误。
我的 gradle 看起来像这样:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.corona.corona"
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(include: ['*.jar'], dir: 'libs')
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'
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:design:26.1.0'
implementation 'com.android.support:support-v4:26.1.0'
implementation 'com.android.support:recyclerview-v7:26.1.0'
implementation 'com.android.support:cardview-v7:26.1.0'
implementation 'com.pkmmte.view:circularimageview:1.1'
implementation 'com.google.code.gson:gson:2.8.0'
implementation 'org.igniterealtime.smack:smack-android:4.1.0'
implementation 'org.igniterealtime.smack:smack-tcp:4.1.0'
implementation 'org.igniterealtime.smack:smack-android-extensions:4.1.0'
implementation 'com.mcxiaoke.volley:library:1.0.19'
implementation 'com.github.bumptech.glide:glide:3.7.0'
implementation 'id.zelory:compressor:2.1.0'
implementation 'com.googlecode.libphonenumber:libphonenumber:8.6.0'
implementation 'io.github.rockerhieu:emojicon:1.4.2'
implementation 'io.github.rockerhieu:emojiconize:1.0.0'
implementation 'com.google.android:flexbox:0.3.1'
implementation 'com.mani:ThinDownloadManager:1.4.0'
implementation 'jp.wasabeef:blurry:2.1.1'
implementation 'com.facebook.shimmer:shimmer:0.1.0@aar'
implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.4'
}
repositories {
mavenCentral()
}
configurations {
all {
exclude module: 'httpclient'
exclude module: 'commons-logging'
exclude group: 'org.apache.httpcomponents'
}
}
最佳答案
问题似乎来自 Smack 库。尝试排除 xpp3 模块。
configurations {
all {
...
exclude group: 'xpp3', module: 'xpp3'
}
}
关于android - Gradle Xpp3错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48488563/
我想为 XStream 的读取使用快速拉取解析器,但使用 Java 6 中的默认拉取解析器。(不是 DOM!)我必须做什么? 最佳答案 将适当的驱动程序传递给 XStream 构造函数: XStrea
我是java编程新手。 只是想找出为什么我的代码不起作用。 boolean insideItem = false; int eventType = xpp.getEventType(); while
我是一名优秀的程序员,十分优秀!