gpt4 book ai didi

java - AGPBI : {"kind" :"error" ,"text":"Program type already present:

转载 作者:行者123 更新时间:2023-12-01 19:54:56 34 4
gpt4 key购买 nike

错误如下:

AGPBI: {"kind":"error","text":"程序类型已存在:android.support.customtabs.ICustomTabsCallback","sources":[{}],"tool":"D8"}:app:transformDexArchiveWithExternalLibsDexMergerForDebug失败

失败:构建因异常而失败。

  • 出了什么问题:任务“:app:transformDexArchiveWithExternalLibsDexMergerForDebug”执行失败。

    com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: D:\ANDROID\project\app\build\intermediates\transforms\dexBuilder\debug\0.jar, Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes. Program type already present: android.support.customtabs.ICustomTabsCallback

这是我的应用程序上的内容:

  apply plugin: 'com.android.application'

android {
compileSdkVersion 29
buildToolsVersion '28.0.3'`

defaultConfig {
multiDexEnabled true
applicationId "com.project.app"
minSdkVersion 16
targetSdkVersion 29
versionCode 6
versionName "1.5"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

useLibrary 'org.apache.http.legacy'
}

repositories{
maven {
url "http://dl.bintray.com/teads/TeadsSDK-android"
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
testImplementation 'junit:junit:4.12'
implementation 'com.android.support:appcompat-v7:27.1.0'
implementation 'com.android.support:design:27.1.0'

implementation 'com.android.support:cardview-v7:26.0.1'
implementation 'com.android.support:recyclerview-v7:26.0.1'
implementation 'com.google.android:flexbox:1.1.0'

implementation 'com.flurry.android:analytics:11.4.0@aar'

//implementation 'com.flurry.android:analytics:8.2.0@aar'

implementation 'com.android.volley:volley:1.1.0'
implementation 'com.github.bumptech.glide:glide:3.8.0'
implementation 'com.googlecode.json-simple:json-simple:1.1'
implementation 'org.jsoup:jsoup:1.10.3'
implementation 'com.google.android.gms:play-services-ads:18.3.0'
//implementation 'com.google.android.gms:play-services-ads:18.3.0'
implementation 'com.facebook.android:facebook-android-sdk:[4,5)'

// Required dependency
implementation 'com.google.android.gms:play-services-basement:12.0.1'

// Teads SDK
/*implementation ('tv.teads.sdk:androidsdk:2.5.12:fullRelease@aar') {
transitive = true;
}*/

// Teads SDK
implementation("tv.teads.sdk.android:sdk:4.3.4@aar") {
transitive = true
}

// Teads Admob Adapter
implementation 'tv.teads.sdk.android:admobadapter:4.1.1'

implementation 'org.apmem.tools:layouts:1.10@aar'

}

你能帮我吗?我的应用程序出了什么问题。它同步成功,但当我构建它时,出现错误。我应该怎么办?感谢您的提前。

最佳答案

从版本 18.0.0 开始,依赖项 com.google.android.gms:play-services-ads 使用 AndroidX 包而不是支持库。此依赖项将 androidx 库传递到您的项目中,您可以使用“gradlew app:dependencies”任务检查它:

+--- com.google.android.gms:play-services-ads:18.0.0
| +--- androidx.collection:collection:1.0.0
| | \--- androidx.annotation:annotation:1.0.0
| +--- androidx.core:core:1.0.0
| | +--- androidx.annotation:annotation:1.0.0
| | +--- androidx.collection:collection:1.0.0 (*)
| | +--- androidx.lifecycle:lifecycle-runtime:2.0.0
| | | +--- androidx.lifecycle:lifecycle-common:2.0.0
| | | | \--- androidx.annotation:annotation:1.0.0
| | | +--- androidx.arch.core:core-common:2.0.0
| | | | \--- androidx.annotation:annotation:1.0.0
| | | \--- androidx.annotation:annotation:1.0.0
| | \--- androidx.versionedparcelable:versionedparcelable:1.0.0
...

每个 androidX 依赖项都包含 androidandroidx 包。由于 gradle 看到两个不同的依赖项,其中包含相同的包,因此它别无选择,只能抛出错误。作为解决方案,您可以将 'com.google.android.gms:play-services-ads' 降级到版本 17.2.1,因为它是使用的最后一个版本旧的支持包。其他解决方案可能是将您的项目迁移到 AndroidX

关于java - AGPBI : {"kind" :"error" ,"text":"Program type already present:,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59046587/

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