gpt4 book ai didi

android - 无法合并 dex - 当我使用 Facebook 受众网络 SDK 时

转载 作者:搜寻专家 更新时间:2023-11-01 08:23:04 24 4
gpt4 key购买 nike

我在使用 Facebook 受众网络 SDK 时收到此错误。

Error:Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'. java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex

我的应用级别gradle

    apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

repositories {
maven { url 'https://maven.fabric.io/public' }
}

android {
compileSdkVersion 27
buildToolsVersion "27.0.3"

defaultConfig {
applicationId "com.xyz.abc"
minSdkVersion 16
targetSdkVersion 27
versionCode 8
versionName "1.1"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}

dexOptions {
incremental = true;
preDexLibraries = false
javaMaxHeapSize "4g"
jumboMode true
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {

implementation fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})

implementation('com.crashlytics.sdk.android:crashlytics:2.6.5@aar') {
transitive = true;
}

implementation 'com.android.support:multidex:1.0.2'
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:27.0.2'
implementation 'com.android.support:design:27.0.2'
implementation 'com.android.support:support-vector-drawable:27.0.2'
implementation 'com.android.support:cardview-v7:27.0.2'
implementation 'com.android.support:recyclerview-v7:27.0.2'
implementation 'com.android.support:support-v4:27.0.2'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'

implementation 'com.github.bumptech.glide:glide:4.4.0'

implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
implementation 'com.android.volley:volley:1.0.0'
implementation 'com.google.code.gson:gson:2.8.2'


implementation 'com.google.android.gms:play-services-base:11.8.0'
implementation 'com.google.android.gms:play-services-ads:11.8.0'
implementation 'com.google.firebase:firebase-messaging:11.8.0'
implementation 'com.google.android.gms:play-services:11.8.0'
implementation 'com.google.android.gms:play-services-auth:11.8.0'
implementation 'com.firebase:firebase-jobdispatcher:0.6.0'

implementation 'me.wangyuwei:ParticleView:1.0.4'
implementation 'com.devbrackets.android:exomedia:4.0.3'
implementation 'com.facebook.android:audience-network-sdk:4.27.0'

testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'

我的 Master gradle 是这样的。

buildscript {
repositories {
jcenter()
maven { url 'https://maven.fabric.io/public' }
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.google.gms:google-services:3.1.1'
classpath 'io.fabric.tools:gradle:1.+'

}
}

allprojects {
repositories {
maven { url 'https://maven.google.com' }
google()
jcenter()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

最佳答案

Facebook Audience Network 已经包含一份 exoplayer。

替换

implementation 'com.facebook.android:audience-network-sdk:4.27.0'

通过

implementation ('com.facebook.android:audience-network-sdk:4.27.0'){
exclude group: 'com.google.android.exoplayer'
}

它应该可以工作。

关于android - 无法合并 dex - 当我使用 Facebook 受众网络 SDK 时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48356840/

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