Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner

android sdk3.1 compile error-Multiple dex files define Lorg/webrtc/VideoCapturerAndroid$CameraErrorHandler

Android studio1.5   build android P2pSample Error:

Error:Execution failed for task ':src:sample:p2pSample:transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/usr/java/jdk1.8.0_73/bin/java'' finished with non-zero exit value 2

UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Lorg/webrtc/VideoCapturerAndroid$CameraErrorHandler;
    at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:594)
    at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:552)
    at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:533)
    at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:170)
    at com.android.dx.merge.DexMerger.merge(DexMerger.java:188)
    at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:439)
    at com.android.dx.command.dexer.Main.runMonoDex(Main.java:287)
    at com.android.dx.command.dexer.Main.run(Main.java:230)
    at com.android.dx.command.dexer.Main.main(Main.java:199)
    at com.android.dx.command.Main.main(Main.java:103)

build.gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 15
    buildToolsVersion "19.1.0"

    defaultConfig {
        applicationId "com.intel.webrtc.p2p.sample"
        minSdkVersion 15
        targetSdkVersion 15
    }

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

    packagingOptions{
        exclude 'AndroidManifest.xml'
    }
}

dependencies {
    compile('io.socket:socket.io-client:0.7.0') {
        // excluding org.json which is provided by Android
        exclude group: 'org.json', module: 'json'
    }
    compile files('libs/woogeenbase.jar')

    compile files('libs/woogeenp2p.jar')

    compile files('libs/libjingle_peerconnection.jar')}
Tags (2)
0 Kudos
3 Replies
Highlighted
Beginner

 

 

android sdk3.1 have two org.webrtc .

Jar package structure:

libjingle_peerconnection.jar

META-INF

org.webrtc

woogeenbase.jar

com.intel.webrtc.base

META-INF

org.webrtc

Is it right?

0 Kudos
Highlighted
Beginner

 

 

Delete  

compile files('libs/libjingle_peerconnection.jar')

is  OK。

p2p sample running is ok now.

0 Kudos
Highlighted

OK. Great to see the problem

OK. Great to see the problem solved!

0 Kudos