NoClassDefFoundError: com.google.android.gms.ads.internal.client.zze

1,850 views
Skip to first unread message

Mohamed Ahmed

unread,
Nov 24, 2015, 12:16:11 PM11/24/15
to Google Mobile Ads SDK Developers
Hello friends

I'm trying to include admob ads in my app and I followed those steps Here but I got this Exception

                       FATAL EXCEPTION: main
                                                   java
.lang.NoClassDefFoundError: com.google.android.gms.ads.internal.client.zze
                                                       at com
.google.android.gms.ads.internal.client.zzl.<init>(Unknown Source)
                                                       at com
.google.android.gms.ads.internal.client.zzl.<clinit>(Unknown Source)
                                                       at com
.google.android.gms.ads.internal.client.zzy.<clinit>(Unknown Source)
                                                       at com
.google.android.gms.ads.AdRequest.<clinit>(Unknown Source)
                                                       at com
.google.android.gms.ads.AdRequest$Builder.<init>(Unknown Source)
                                                       at club
.androidy.callcontrolfree.MainActivity.onCreate(MainActivity.java:20)
                                                       at android
.app.Activity.performCreate(Activity.java:5179)
                                                       at android
.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1146)
                                                       at android
.app.ActivityThread.performLaunchActivity(ActivityThread.java:2336)
                                                       at android
.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2424)
                                                       at android
.app.ActivityThread.access$600(ActivityThread.java:169)
                                                       at android
.app.ActivityThread$H.handleMessage(ActivityThread.java:1388)
                                                       at android
.os.Handler.dispatchMessage(Handler.java:107)
                                                       at android
.os.Looper.loop(Looper.java:194)
                                                       at android
.app.ActivityThread.main(ActivityThread.java:5433)
                                                       at java
.lang.reflect.Method.invokeNative(Native Method)
                                                       at java
.lang.reflect.Method.invoke(Method.java:525)
                                                       at com
.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:924)
                                                       at com
.android.internal.os.ZygoteInit.main(ZygoteInit.java:691)
                                                       at dalvik
.system.NativeStart.main(Native Method)


this is my MainActivity code

import android.content.Intent;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.ShareActionProvider;

import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.AdView;

public class MainActivity extends Activity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
AdView mAdView = (AdView) findViewById(R.id.adView);
AdRequest adRequest = new AdRequest.Builder().build(); // this is line 20
mAdView.loadAd(adRequest);
}
}

my layout :

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="club.androidy.callcontrolfree.MainActivity">



<com.google.android.gms.ads.AdView
android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
ads:adSize="BANNER"
ads:adUnitId="@string/banner_ad_unit_id">
</com.google.android.gms.ads.AdView>

</RelativeLayout>


thank you in advance

Veer Arjun Busani

unread,
Nov 24, 2015, 12:52:12 PM11/24/15
to Google Mobile Ads SDK Developers
Hi Mohammed,

I have couple of questions with regards to the steps that you have followed:
  1. Were you able to reproduce the same issue using our sample app? If not, can you send us a sample app that demonstrates the issue. 
  2. Did you configure the Gradle file to reference Google Play Services as a dependency into the your project?  
Thanks,

Veer Arjun Busani
Mobile Ads SDK Team

Mohamed Ahmed

unread,
Nov 25, 2015, 7:04:58 AM11/25/15
to Google Mobile Ads SDK Developers
Hi Veer,

A1. The sample is working fine with no issues.

A2. Yes I did configure the Gradle file to reference Google Play Services as a dependency into my project.

I'll try to send you a sample soon

thank you for your concern

Mohamed Ahmed

unread,
Dec 4, 2015, 11:29:33 AM12/4/15
to Google Mobile Ads SDK Developers
Sorry for late answer

Cleaning the project solved the issue 

thank you
Reply all
Reply to author
Forward
0 new messages