Hi, im trying to add Admob ads to new project in Eclipse, but when i runing program, they crash.
It's log from Eclipse:
[SUB]
11-11 20:31:48.259: D/AndroidRuntime(10585): Shutting down VM
11-11 20:31:48.259: W/dalvikvm(10585): threadid=1: thread exiting with uncaught exception (group=0x40018578)
11-11 20:31:48.279: E/AndroidRuntime(10585): FATAL EXCEPTION: main
11-11 20:31:48.279: E/AndroidRuntime(10585): java.lang.RuntimeException: Unable to instantiate ac
tivity ComponentInfo{admob.admob.admob/com.Admob.android.ads.AdMob.Activity}: java.lang.ClassNotFoundException: com.Admob.android.ads.AdMob.A
ctivity in loader dalvik.system.PathClassLoader[/data/app/admob.admob.admob-1.apk]
11-11 20:31:48.279: E/AndroidRuntime(10585): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1573)
11-11 20:31:48.279: E/AndroidRuntime(10585): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
11-11 20:31:48.279: E/AndroidRuntime(10585): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
11-11 20:31:48.279: E/AndroidRuntime(10585): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
11-11 20:31:48.279: E/AndroidRuntime(10585): at android.os.Handler.dispatchMessage(Handler.java:99)
11-11 20:31:48.279: E/AndroidRuntime(10585): at android.os.Looper.loop(Looper.java:123)
11-11 20:31:48.279: E/AndroidRuntime(10585): at android.app.ActivityThread.main(ActivityThread.java:3687)
11-11 20:31:48.279: E/AndroidRuntime(10585): at java.lang.reflect.Method.invokeNative(Native Method)
11-11 20:31:48.279: E/AndroidRuntime(10585): at java.lang.reflect.Method.invoke(Method.java:507)
11-11 20:31:48.279: E/AndroidRuntime(10585): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
11-11 20:31:48.279: E/AndroidRuntime(10585): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625)
11-11 20:31:48.279: E/AndroidRuntime(10585): at dalvik.system.NativeStart.main(Native Method)
11-11 20:31:48.279: E/AndroidRuntime(10585): Caused by: java.lang.ClassNotFoundException: com.Admob.android.ads.AdMob.Activity in loader dalvik.system.PathClassLoader[/data/app/admob.admob.admob-1.apk]
11-11 20:31:48.279: E/AndroidRuntime(10585): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
11-11 20:31:48.279: E/AndroidRuntime(10585): at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
11-11 20:31:48.279: E/AndroidRuntime(10585): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
11-11 20:31:48.279: E/AndroidRuntime(10585): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
11-11 20:31:48.279: E/AndroidRuntime(10585): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1565)
11-11 20:31:48.279: E/AndroidRuntime(10585): ... 11 more[/SUB]
Main:
Attrs:
I have i sdk:
GoogleAdMobAdsSdk-4.3.1
What is bad?
It's log from Eclipse:
[SUB]
11-11 20:31:48.259: D/AndroidRuntime(10585): Shutting down VM
11-11 20:31:48.259: W/dalvikvm(10585): threadid=1: thread exiting with uncaught exception (group=0x40018578)
11-11 20:31:48.279: E/AndroidRuntime(10585): FATAL EXCEPTION: main
11-11 20:31:48.279: E/AndroidRuntime(10585): java.lang.RuntimeException: Unable to instantiate ac
tivity ComponentInfo{admob.admob.admob/com.Admob.android.ads.AdMob.Activity}: java.lang.ClassNotFoundException: com.Admob.android.ads.AdMob.A
ctivity in loader dalvik.system.PathClassLoader[/data/app/admob.admob.admob-1.apk]
11-11 20:31:48.279: E/AndroidRuntime(10585): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1573)
11-11 20:31:48.279: E/AndroidRuntime(10585): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
11-11 20:31:48.279: E/AndroidRuntime(10585): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
11-11 20:31:48.279: E/AndroidRuntime(10585): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
11-11 20:31:48.279: E/AndroidRuntime(10585): at android.os.Handler.dispatchMessage(Handler.java:99)
11-11 20:31:48.279: E/AndroidRuntime(10585): at android.os.Looper.loop(Looper.java:123)
11-11 20:31:48.279: E/AndroidRuntime(10585): at android.app.ActivityThread.main(ActivityThread.java:3687)
11-11 20:31:48.279: E/AndroidRuntime(10585): at java.lang.reflect.Method.invokeNative(Native Method)
11-11 20:31:48.279: E/AndroidRuntime(10585): at java.lang.reflect.Method.invoke(Method.java:507)
11-11 20:31:48.279: E/AndroidRuntime(10585): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
11-11 20:31:48.279: E/AndroidRuntime(10585): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625)
11-11 20:31:48.279: E/AndroidRuntime(10585): at dalvik.system.NativeStart.main(Native Method)
11-11 20:31:48.279: E/AndroidRuntime(10585): Caused by: java.lang.ClassNotFoundException: com.Admob.android.ads.AdMob.Activity in loader dalvik.system.PathClassLoader[/data/app/admob.admob.admob-1.apk]
11-11 20:31:48.279: E/AndroidRuntime(10585): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
11-11 20:31:48.279: E/AndroidRuntime(10585): at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
11-11 20:31:48.279: E/AndroidRuntime(10585): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
11-11 20:31:48.279: E/AndroidRuntime(10585): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
11-11 20:31:48.279: E/AndroidRuntime(10585): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1565)
11-11 20:31:48.279: E/AndroidRuntime(10585): ... 11 more[/SUB]
Code:
Android MAnifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="admob.admob.admob"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="10" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity
android:label="@string/app_name"
android:name="com.Admob.android.ads.AdMob.Activity">
<intent-filter >
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data android:value="a14ebd2e8706cdc" android:name="ADMOB_PUBLISHER_ID" />
</application>
<uses-permission android:name="android.permission.INTERNET" />
</manifest>
Main:
Code:
<?xml version="1.0" encoding="utf-8"?>
<linearlayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:admobsdk="http://schemas.android.com/apk/res/admob.admob.admob"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<com.admob.android.ads.AdView
android:id="@+id/ad"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
admobsdk:backgroundColor="#000000"
admobsdk:textColor="#FFFFFF"
admobsdk:keywords="Android application"
/>
</linearlayout>
Attrs:
Code:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name="com.admob.android.ads.AdView">
<attr name="testing" format="boolean" />
<attr name="backgroundColor" format="color" />
<attr name="textColor" format="color" />
<attr name="keywords" format="string" />
<attr name="refreshInterval" format="integer" />
<attr name="isGoneWithoutAd" format="boolean" />
</declare-styleable>
</resources>
I have i sdk:
GoogleAdMobAdsSdk-4.3.1
What is bad?
Last edited: