The import android.app.Activity is never used and app stopped unexpectedly-Collection of common programming errors
hey There finally I’m create android app and integer ad mob but when try it on my emulator get me stopped unexpectedly *here my code’s file*
cordova-2.2.0 *admobskd 6.2.1* android 2.2
Here mainActivity.java
package com.afrogfx.VerbTenses;
import android.app.Activity;
import android.os.Bundle;
import com.google.ads.*;
import org.apache.cordova.*;
public class VerbTenses extends DroidGap
{
private static final String AdMob_Ad_Unit = "ass0bcc0e6a0228";
private AdView adView;
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
super.setIntegerProperty("splashscreen", R.drawable.splash);
super.loadUrl("file:///android_asset/www/overview.html");
//admob
adView = new AdView(this, AdSize.BANNER, AdMob_Ad_Unit);
super.root.addView(adView);
AdRequest request = new AdRequest();
//request.setTesting(false);
adView.loadAd(request);
}
}
Here manifest.xml
Warning The import android.app.Activity is never used
console http://www.flickr.com/photos/afrogfx/8350084864/
LogCat http://www.flickr.com/photos/afrogfx/8350087082/
01-05 17:21:21.565: D/dalvikvm(726): DexOpt: couldn't find static field
01-05 17:21:21.565: W/dalvikvm(726): VFY: unable to resolve static field 19 (SDK_INT) in Landroid/os/Build$VERSION;
01-05 17:21:21.575: W/dalvikvm(726): VFY: rejecting opcode 0x60 at 0x0005
01-05 17:21:21.575: W/dalvikvm(726): VFY: rejected Lorg/apache/cordova/DroidGap;.init ()V
01-05 17:21:21.575: W/dalvikvm(726): Verifier rejected class Lorg/apache/cordova/DroidGap;
01-05 17:21:21.575: W/dalvikvm(726): Class init failed in newInstance call (Lcom/afrogfx/VerbTenses/VerbTenses;)
01-05 17:21:21.589: D/AndroidRuntime(726): Shutting down VM
01-05 17:21:21.589: W/dalvikvm(726): threadid=3: thread exiting with uncaught exception (group=0x4000fe70)
01-05 17:21:21.607: E/AndroidRuntime(726): Uncaught handler: thread main exiting due to uncaught exception
01-05 17:21:21.625: E/AndroidRuntime(726): java.lang.VerifyError: org.apache.cordova.DroidGap
01-05 17:21:21.625: E/AndroidRuntime(726): at java.lang.Class.newInstanceImpl(Native Method)
01-05 17:21:21.625: E/AndroidRuntime(726): at java.lang.Class.newInstance(Class.java:1472)
01-05 17:21:21.625: E/AndroidRuntime(726): at android.app.Instrumentation.newActivity(Instrumentation.java:1097)
01-05 17:21:21.625: E/AndroidRuntime(726): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2186)
01-05 17:21:21.625: E/AndroidRuntime(726): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2284)
01-05 17:21:21.625: E/AndroidRuntime(726): at android.app.ActivityThread.access$1800(ActivityThread.java:112)
01-05 17:21:21.625: E/AndroidRuntime(726): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692)
01-05 17:21:21.625: E/AndroidRuntime(726): at android.os.Handler.dispatchMessage(Handler.java:99)
01-05 17:21:21.625: E/AndroidRuntime(726): at android.os.Looper.loop(Looper.java:123)
01-05 17:21:21.625: E/AndroidRuntime(726): at android.app.ActivityThread.main(ActivityThread.java:3948)
01-05 17:21:21.625: E/AndroidRuntime(726): at java.lang.reflect.Method.invokeNative(Native Method)
01-05 17:21:21.625: E/AndroidRuntime(726): at java.lang.reflect.Method.invoke(Method.java:521)
01-05 17:21:21.625: E/AndroidRuntime(726): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)
01-05 17:21:21.625: E/AndroidRuntime(726): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
01-05 17:21:21.625: E/AndroidRuntime(726): at dalvik.system.NativeStart.main(Native Method)
01-05 17:21:21.644: I/dalvikvm(726): threadid=7: reacting to signal 3
01-05 17:21:21.745: I/dalvikvm(726): Wrote stack trace to '/data/anr/traces.txt'
01-05 17:23:13.524: I/Process(726): Sending signal. PID: 726 SIG: 9