所以问题是Google拥有了更新场所SDK,并将它们与Google Play服务分开了。现在,当我更新场所sdk并添加了:“ com.google.android.libraries.places:places-compat:1.1.0”
由Google在迁移指南中提供
https://developers.google.com/places/android-sdk/client-migration
我进行了一些更改,并能够编译并成功运行。
但是当我尝试为此创建一个发行版apk时,它就给了我这个:
What went wrong:
Execution failed for task ‘:app-guest:transformClassesWithJarMergingForProductionRelease’.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: android/support/v4/app/INotificationSideChannel$Stub$Proxy.class.
我认为有一些库已经包含在播放服务中,并且会被新的sdk依赖项所重复。
我已经尝试了通过terminal检查相关性的命令。
我在我的应用中使用的播放服务
val plus = artifact(artifactId = "play-services-plus")
val auth = artifact(artifactId = "play-services-auth")
val base = artifact(artifactId = "play-services-base")
val analytics = artifact(artifactId = "play-services-analytics")
val cast = artifact(artifactId = "play-services-cast")
val gcm = artifact(artifactId = "play-services-gcm")
val location = artifact(artifactId = "play-services-location")
val maps = artifact(artifactId = "play-services-maps",version = "16.1.0")
val nearby = artifact(artifactId = "play-services-nearby")
val safetynet = artifact(artifactId = "play-services-safetynet")
val wallet = artifact(artifactId = "play-services-wallet")
val tasks = artifact(artifactId = "play-services-tasks")
我就是我们的支持库
// v4 support libraries
val support_compat = artifact("support-compat")
val support_core_utils = artifact("support-core-utils")
val support_core_ui = artifact("support-core-ui")
val support_media_compat = artifact("support-media-compat")
val support_fragment = artifact("support-fragment")
@Deprecated("Prior to Support Library revision 24.2.0, there was a single v4 support library. That library was divided into multiple modules to improve efficiency. For backwards compatibility, if you list support-v4 in your Gradle script, your APK will include all of the v4 modules. However, to reduce APK size, we recommend that you just list the specific modules your app needs.")
val support_v4 = artifact("support-v4")
// Multidex Support Library
/** Multidex - See: https://developer.android.com/studio/build/multidex.html */
val multidex = artifact("multidex", version = Versions.multidex)
val multidex_instrumentation = artifact("multidex-instrumentation", Versions.multidex)
// v7 Support Libraries
val appcompat_v7 = artifact("appcompat-v7")
val cardview_v7 = artifact("cardview-v7")
val gridlayout_v7 = artifact("gridlayout-v7")
val mediarouter_v7 = artifact("mediarouter-v7")
val palette_v7 = artifact("palette-v7")
val recyclerview_v7 = artifact("recyclerview-v7")
val preference_v7 = artifact("preference-v7")
val support_v13 = artifact("support-v13")
val preference_v14 = artifact("preference-v14")
val preference_leanback_v17 = artifact("preference-leanback-v17")
val leanback_v17 = artifact("leanback-v17")
val support_vector_drawable = artifact("support-vector-drawable")
val animated_vector_drawable = artifact("animated-vector-drawable")
val support_annotations = artifact("support-annotations")
val design = artifact("design")
val customtabs = artifact("customtabs")
@Deprecated("As of release 26.0.0, the Percent Support library is deprecated. Clients of this module should migrate to the new ConstraintLayout widget, which is provided as a separate artifact in SDK Manager.")
val percent = artifact("percent")
val exifinterface = artifact("exifinterface")
val recommendation = artifact("recommendation")
val wear = artifact("wear")
val constraint_layout = artifact("constraint-layout", Versions.constraintlayout, ".constraint")
谁能告诉我哪个图书馆正在使用此'INotificationSideChannel',以便我可以排除它。
答案 0 :(得分:0)
您不得在应用程序或依赖项中重复库。您必须检查是否已插入v4库和编译库?。
删除重复库,以便仅保留一个V4。
在您的应用程序目录build.gradle文件中,添加以下命令:
android{
configurations {
all*.exclude group: 'com.android.support', module: 'support-v4'
all*.exclude group: 'com.android.support', module: 'support-annotations'
}
}