I am writing a code to display Admob Banner in my Android Application. i have done the following few adjustments in order to achieve this:
- configured google play services library following: https://developers.google.com/mobile-ads-sdk/docs/
Added
<activity android:name="com.google.android.gms.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />
and
<meta-data
android:name="com.google.android.gms.version"
android:value="4323000" />
code in my manifest file, and also added following permissions:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
- Followed the: https://developers.google.com/mobile-ads-sdk/docs/admob/fundamentals#play link to develop a banner in my application.
the problem occurs when i try to run the application it throws the following exception:
05-07 14:51:17.617: E/AndroidRuntime(7877): FATAL EXCEPTION: main
05-07 14:51:17.617: E/AndroidRuntime(7877): java.lang.NoClassDefFoundError: com.google.android.gms.ads.AdView
05-07 14:51:17.617: E/AndroidRuntime(7877): at com.atc.hums.HumsActivity.onCreate(HumsActivity.java:458)
05-07 14:51:17.617: E/AndroidRuntime(7877): at android.app.Activity.performCreate(Activity.java:5165)
05-07 14:51:17.617: E/AndroidRuntime(7877): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1103)
05-07 14:51:17.617: E/AndroidRuntime(7877): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2419)
05-07 14:51:17.617: E/AndroidRuntime(7877): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2520)
05-07 14:51:17.617: E/AndroidRuntime(7877): at android.app.ActivityThread.access$600(ActivityThread.java:162)
05-07 14:51:17.617: E/AndroidRuntime(7877): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1366)
05-07 14:51:17.617: E/AndroidRuntime(7877): at android.os.Handler.dispatchMessage(Handler.java:99)
05-07 14:51:17.617: E/AndroidRuntime(7877): at android.os.Looper.loop(Looper.java:158)
05-07 14:51:17.617: E/AndroidRuntime(7877): at android.app.ActivityThread.main(ActivityThread.java:5751)
05-07 14:51:17.617: E/AndroidRuntime(7877): at java.lang.reflect.Method.invokeNative(Native Method)
05-07 14:51:17.617: E/AndroidRuntime(7877): at java.lang.reflect.Method.invoke(Method.java:511)
05-07 14:51:17.617: E/AndroidRuntime(7877): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1083)
05-07 14:51:17.617: E/AndroidRuntime(7877): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:850)
05-07 14:51:17.617: E/AndroidRuntime(7877): at dalvik.system.NativeStart.main(Native Method)