Reputation: 84
I working on an Android Application but I'm facing a problem which is : Unable to execute dex: Multiple dex files define Lcom/google/ads/AdRequest$ErrorCode;
I've tried some things like removing the GoogleAdMobAdsSdk-6.4.1.jar
file, adding : import com.google.android.gms.ads.*;, but now I'm facing another problem which is in :
adView.loadAd(new AdRequest());
it tells me that The constructor AdRequest() is not visible, Please Help Me, Guys, I'm new in android developing.
And thanks to every one
Upvotes: 0
Views: 188
Reputation: 55370
Looks like you were using the Admob Ads SDK, but since you have now included the Google Play Services library, the interface is slightly different.
For this particular error, you need to use the AdRequest.Builder class, i.e.
AdRequest request = new AdRequest.Builder()
.addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
.build();
I suggest you take a look at the migration guide.
Upvotes: 1