Вопрос

I am trying to move to gradle in my project and I've got problem while install admob

dependency
    compile group: 'com.google.guava', name: 'guava', version: '12.0'
    compile ('com.google.android.gms:play-services:4.+'){
        exclude module: 'com.google.ads'
    }
    compile 'org.codehaus.plexus:plexus-interpolation:1.19'
    compile 'de.greenrobot:eventbus:2.0.2'
    compile 'com.squareup.retrofit:retrofit:1.4.1'
    compile 'com.squareup.picasso:picasso:1.1.1'
    compile 'com.google.code.gson:gson:2.2.4'
    compile 'org.apache.commons:commons-lang3:3.0'

    compile fileTree(dir: 'libs', include: '*.jar')

And I am geting

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

in my libs folder only one GoogleAdMobAdsSdk-6.4.1.jar

Это было полезно?

Решение

If your using Google Play services , then remove the GoogleAdMobAdsSdk jar from lib folder

You can also exclude the ads from play service like this, to continue with jar.

compile ('com.google.android.gms:play-services:4.3.23'){
    exclude module:'gms.ads'
}

But you need to upgrade soon.

Note : Deprecated. On August 1, 2014, Google Play will stop accepting new or updated apps that use the old standalone Google Mobile Ads SDK v6.4.1 or lower. You must upgrade to the Google Play version of the Mobile Ads SDK by then. Read these links

https://developers.google.com/mobile-ads-sdk/docs/admob/play-migration https://developers.google.com/mobile-ads-sdk/download#downloadplay

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top