gpt4 book ai didi

Android - Activity 使用或覆盖已弃用的 API

转载 作者:太空宇宙 更新时间:2023-11-03 11:31:49 25 4
gpt4 key购买 nike

我确实在最新的 Android Studio 上创建了一个全新的 Android 项目。我做的第一件事是通过将以下内容添加到 gradle 文件中,将“Realm”库添加到项目中:

compile 'io.realm:realm-android:0.80.3'

如果我尝试编译,我会收到以下错误:

Note: C:\....\MainActivity.java uses or overrides a deprecated API.

Origin 2: C:\Users\Usmaan.gradle\caches\modules-2\files-2.1\io.realm\realm-android\0.80.3\7979d05ba7b919c53766bf98e31aaf0e9feb0590\realm-android-0.80.3.jar Error:duplicate files during packaging of APK C:...\app\build\outputs\apk\app-debug-unaligned.apk Path in archive: META-INF/services/javax.annotation.processing.Processor Origin 1: C:\Users\Usmaan.gradle\caches\modules-2\files-2.1\com.jakewharton\butterknife\6.1.0\63735f48b82bcd24cdd33821342428252eb1ca5a\butterknife-6.1.0.jar You can ignore those files in your build.gradle: android {
packagingOptions { exclude 'META-INF/services/javax.annotation.processing.Processor' } Error:Execution failed for task ':app:packageDebug'.

Duplicate files copied in APK META-INF/services/javax.annotation.processing.Processor File 1: C:\Users\Usmaan.gradle\caches\modules-2\files-2.1\com.jakewharton\butterknife\6.1.0\63735f48b82bcd24cdd33821342428252eb1ca5a\butterknife-6.1.0.jar File 2: C:\Users\Usmaan.gradle\caches\modules-2\files-2.1\io.realm\realm-android\0.80.3\7979d05ba7b919c53766bf98e31aaf0e9feb0590\realm-android-0.80.3.jar }

有什么想法吗?

最佳答案

看起来您也在使用 Butterknife?您是否尝试过将以下内容添加到您的 build.gradle 中:

android {
...

packagingOptions {
exclude 'META-INF/services/javax.annotation.processing.Processor'
}
}

关于Android - Activity 使用或覆盖已弃用的 API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30683719/

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