简体   繁体   中英

Unable to merge dex when integrating TensorFlow & DJI SDK

I am trying to integrate a DJI SDK project with the TensorFlow Android Example. After combining the code & build.gradle files, I get the error "Unable to merge dex" when building. Gradle syncs fine. Here is the DJI SDK's Gradle properties:

classpath 'com.android.tools.build:gradle:2.3.2'
compileSdkVersion 23
buildToolsVersion "25.0.0"
applicationId "com.dji.GSDemo.GoogleMap"
minSdkVersion 19
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.3.0'
compile 'com.google.android.gms:play-services:9.2.0'
compile 'com.android.support:design:23.3.0'
compile 'com.android.support:multidex:1.0.1'
compile 'com.google.android.gms:play-services-ads:9.2.0'
compile 'com.google.android.gms:play-services-auth:9.2.0'
compile 'com.google.android.gms:play-services-gcm:9.2.0'

compile ('com.dji:dji-sdk:4.5.1')
provided ('com.dji:dji-sdk-provided:4.5.1')
}

Here are TensorFlow's gradle properties:

classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'org.apache.httpcomponents:httpclient:4.5.4'
compileSdkVersion 23 
buildToolsVersion'26.0.2'

For the integrated project, I kept TensorFlow's gradle version (3.0.1) but changed minSdkVersion to 19 to match the DJI SDK project. Where do I start to debug my error?

just replace compile with implementation.

like: replace this

compile 'com.android.support:appcompat-v7:26.0.2'
compile 'com.android.support:support-v4:26.1.0'

with

implementation 'com.android.support:appcompat-v7:26.0.2'
implementation 'com.android.support:support-v4:26.1.0'

Hope it Works.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM