Monday, February 22, 2016

Multiple dex files define Landroid/support/annotation/AnimRes and Lcom/google/ads/AdRequest$ErrorCode

Resolution - create build-extras.gradle in folder - platforms\android. with following code

configurations { all*.exclude group: 'com.android.support', module: 'support-v4'
}


Multiple dex files define Lcom/google/ads/AdRequest$ErrorCode

Uncomment framework tags and comment dependency tag in plugin.xml of plugins\cordova-plugin-googleplus

Remove plugin - ionic plugin remove cordova-plugin-googleplayservices
ionic platform remove android
ionic platform add android

build.gradle has following section. It should have following entries for compile.

dependencies {
    compile fileTree(dir: 'libs', include: '*.jar')
    // SUB-PROJECT DEPENDENCIES START
    debugCompile project(path: "CordovaLib", configuration: "debug")
    releaseCompile project(path: "CordovaLib", configuration: "release")
    debugCompile project(path: "com.phonegap.plugins.facebookconnect:FacebookLib", configuration: "debug")
    releaseCompile project(path: "com.phonegap.plugins.facebookconnect:FacebookLib", configuration: "release")
    compile "com.android.support:support-v4:+"
    compile "com.google.android.gms:play-services-ads:+"
    compile "com.google.android.gms:play-services-plus:+"
    compile "com.google.android.gms:play-services-identity:+"
    // SUB-PROJECT DEPENDENCIES END
}

Delete google-play-services jar file from platform/android/lib folder. This file creates issue 

No comments:

Post a Comment