gpt4 book ai didi

java - 需要帮助,我是 Android Studio 的初学者

转载 作者:行者123 更新时间:2023-12-01 16:54:53 24 4
gpt4 key购买 nike

我收到了继续 Android Studio 项目的任务,但是当我发布 APK 时出现了这样的错误。

../../build.gradle: commons-logging 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.

../../build.gradle: httpclient 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 jar.

这在我的 build.gradle 依赖项中

 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'
})
compile 'com.google.code.gson:gson:2.4'
compile 'org.apache.httpcomponents:httpcore:4.2.4'
compile 'org.apache.httpcomponents:httpmime:4.3'
compile 'com.android.support:appcompat-v7:28.0.0'
compile 'com.android.support:support-compat:28.0.0'
compile 'com.android.support:design:28.0.0'
compile 'pl.droidsonroids.gif:android-gif-drawable:1.1.+'
compile 'com.android.support:support-v4:28.0.0'
compile 'com.google.code.gson:gson:2.4'
compile 'com.google.zxing:core:3.2.1'
compile 'com.google.android.gms:play-services-maps:11.0.4'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.android.support:cardview-v7:28.0.0'
compile 'com.journeyapps:zxing-android-embedded:3.2.0@aar'
compile 'me.dm7.barcodescanner:zxing:1.9'
compile 'com.google.firebase:firebase-messaging:11.0.4'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'

但我不知道问题出在哪里..

最佳答案

将此添加到应用程序模块中的 build.gradle

configurations {
all {
exclude module: 'httpclient'
}
}

希望能成功

谢谢!快乐编码!

关于java - 需要帮助,我是 Android Studio 的初学者,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61606291/

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