Android MoPub sdk with Tapjoy sdk build error


#1

Hi,

Im implementing MoPub SDK for Android with Android Studio 1.3. My project use a few more dependencies and was building and running smooth before i implemented MoPub. When i build the project with all the dependencies including mopub i get this error:

Error:Execution failed for task ':app:dexDebug'. > com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.7.0_75\bin\java.exe'' finished with non-zero exit value 2

when i remove the Tapjoy SDK from my dependencies the build succeeds as expected but without the Tapjoy SDK ofc:(

Im using the sdk via jCenter AAR and followed the correct steps from the “Getting Started” (https://dev.twitter.com/mopub/android/getting-started) and Github (https://github.com/mopub/mopub-android-sdk).

My gradle file:

dependencies {
compile 'com.google.android.gms:play-services:7.5.0'
compile 'com.facebook.android:facebook-android-sdk:4.1.0'
compile 'com.android.support:recyclerview-v7:22.2.1'
compile files('libs/tapjoyconnectlibrary.jar')
compile files('libs/chartboost.jar')
compile files('libs/adcolony.jar')
compile('com.mopub:mopub-sdk:3.10.0@aar') { transitive = true } 
}

Jur


#2

Hello Jurdefur,

Please add this to your defaultConfig in the respective build.gradle.

defaultConfig {
    multiDexEnabled true
}

This should fix the dex issue. It looks like with all of the SDKs and adapters included, the method limit for a single dex file of 65,536 is exceeded per Google’s documentation on MultiDex. For more information, please see the documentation here.

Let me know if it doesn’t and we can troubleshoot the issue further. If you have any questions, please reach out.

Thanks!


#3

Thanks i fixed the problem by enabling proguard