0

I am currently developing an android app and implementing in-app purchases.

My application runs fine in simulator mode, but when I try to build an APK I get this following error:

Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexException: Multiple dex files define Lcom/android/vending/billing/IInAppBillingService;

I'm not sure what is the exact cause, but here are my libraries I am using (IAP library): Libraries

Lastly, this is my Gradle build which I did set up to compile the library correctly:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.2"
    defaultConfig {
        applicationId "flarehubpe.xflare.flarehub"
        minSdkVersion 15
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile 'com.anjlab.android.iab.v3:library:1.0.+'
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:25.2.0'
    testCompile 'junit:junit:4.12'
}

What am I doing wrong?

coolpater
  • 51
  • 3
  • Try some of the solutions here - http://stackoverflow.com/questions/33915955/android-studio-transformexception-errorexecution-failed-for-task-apptransf – mondakuwar Apr 24 '17 at 22:24
  • defaultConfig { multiDexEnabled true } http://stackoverflow.com/questions/32807587/com-android-build-transform-api-transformexception – rahul Apr 24 '17 at 22:25
  • It seems that solved half of the problem. Now it: Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'. > com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/android/vending/billing/IInAppBillingService$Stub$Proxy.class – coolpater Apr 24 '17 at 22:31

0 Answers0