I am implementing the system andEngine multiplayer for first, then be able to adjust all imports and libraries and runs without any error in MOTODEV, but the emulator "has stopped unexpectedly".
You can see code here.
Error on emulator:
08-02 00:52:55.500: D/AndroidRuntime(330): Shutting down VM
08-02 00:52:55.500: W/dalvikvm(330): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
08-02 00:52:55.549: E/AndroidRuntime(330): FATAL EXCEPTION: main
08-02 00:52:55.549: E/AndroidRuntime(330): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.multiplayerand/com.multiplayerand.MainActivity}: java.lang.ClassNotFoundException: com.multiplayerand.MainActivity in loader dalvik.system.PathClassLoader[/data/app/com.multiplayerand-2.apk]
08-02 00:52:55.549: E/AndroidRuntime(330): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2585)
08-02 00:52:55.549: E/AndroidRuntime(330): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
08-02 00:52:55.549: E/AndroidRuntime(330): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
08-02 00:52:55.549: E/AndroidRuntime(330): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
08-02 00:52:55.549: E/AndroidRuntime(330): at android.os.Handler.dispatchMessage(Handler.java:99)
08-02 00:52:55.549: E/AndroidRuntime(330): at android.os.Looper.loop(Looper.java:123)
08-02 00:52:55.549: E/AndroidRuntime(330): at android.app.ActivityThread.main(ActivityThread.java:4627)
08-02 00:52:55.549: E/AndroidRuntime(330): at java.lang.reflect.Method.invokeNative(Native Method)
08-02 00:52:55.549: E/AndroidRuntime(330): at java.lang.reflect.Method.invoke(Method.java:521)
08-02 00:52:55.549: E/AndroidRuntime(330): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
08-02 00:52:55.549: E/AndroidRuntime(330): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
08-02 00:52:55.549: E/AndroidRuntime(330): at dalvik.system.NativeStart.main(Native Method)
08-02 00:52:55.549: E/AndroidRuntime(330): Caused by: java.lang.ClassNotFoundException: com.multiplayerand.MainActivity in loader dalvik.system.PathClassLoader[/data/app/com.multiplayerand-2.apk]
08-02 00:52:55.549: E/AndroidRuntime(330): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
08-02 00:52:55.549: E/AndroidRuntime(330): at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
08-02 00:52:55.549: E/AndroidRuntime(330): at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
08-02 00:52:55.549: E/AndroidRuntime(330): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
08-02 00:52:55.549: E/AndroidRuntime(330): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2577)
08-02 00:52:55.549: E/AndroidRuntime(330): ... 11 more
Pay attention to this line from your log:
Unable to instantiate activity ComponentInfo{com.multiplayerand/com.multiplayerand.MainActivity}: java.lang.ClassNotFoundException: com.multiplayerand.MainActivity in loader dalvik.system.PathClassLoader
That line says,you tried to instantiate activity that it's name is MainActivity and it would be in com.multiplayerand pakage,but system could not find any Activity with this Component-info,and so java.lang.ClassNotFoundException has been occurred.
I guess you can solve problem if you:
Check that your Activity name be MainActivity.
Check that MainActivity be in package with name com.multiplayerand.
Check that you registered MainActivity in manifest of your project.
Related
I am compiling MBTilesOsmDroidExample https://github.com/djcoin/MBTilesOsmdroidExample I am getting following error.
the mbtile file is in the assest folder.
11-21 12:29:29.693: E/Database(330): sqlite3_open_v2("/mnt/sdcard/military-bene-and-tacan-routes.db", &handle, 1, NULL) failed
11-21 12:29:29.693: D/AndroidRuntime(330): Shutting down VM
11-21 12:29:29.693: W/dalvikvm(330): threadid=1: thread exiting with uncaught exception (group=0x40015560)
11-21 12:29:29.723: E/AndroidRuntime(330): FATAL EXCEPTION: main
11-21 12:29:29.723: E/AndroidRuntime(330): java.lang.RuntimeException: Unable to start activity ComponentInfo{org.tilespitter.mapboxtiles/org.tilespitter.mapboxtiles.MBTilesOsmdroidExample}: android.database.sqlite.SQLiteException: unable to open database file
11-21 12:29:29.723: E/AndroidRuntime(330): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647)
11-21 12:29:29.723: E/AndroidRuntime(330): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
11-21 12:29:29.723: E/AndroidRuntime(330): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
11-21 12:29:29.723: E/AndroidRuntime(330): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
11-21 12:29:29.723: E/AndroidRuntime(330): at android.os.Handler.dispatchMessage(Handler.java:99)
11-21 12:29:29.723: E/AndroidRuntime(330): at android.os.Looper.loop(Looper.java:123)
11-21 12:29:29.723: E/AndroidRuntime(330): at android.app.ActivityThread.main(ActivityThread.java:3683)
11-21 12:29:29.723: E/AndroidRuntime(330): at java.lang.reflect.Method.invokeNative(Native Method)
11-21 12:29:29.723: E/AndroidRuntime(330): at java.lang.reflect.Method.invoke(Method.java:507)
11-21 12:29:29.723: E/AndroidRuntime(330): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
11-21 12:29:29.723: E/AndroidRuntime(330): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
11-21 12:29:29.723: E/AndroidRuntime(330): at dalvik.system.NativeStart.main(Native Method)
11-21 12:29:29.723: E/AndroidRuntime(330): Caused by: android.database.sqlite.SQLiteException: unable to open database file
11-21 12:29:29.723: E/AndroidRuntime(330): at android.database.sqlite.SQLiteDatabase.dbopen(Native Method)
11-21 12:29:29.723: E/AndroidRuntime(330): at android.database.sqlite.SQLiteDatabase.<init>(SQLiteDatabase.java:1849)
11-21 12:29:29.723: E/AndroidRuntime(330): at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:820)
11-21 12:29:29.723: E/AndroidRuntime(330): at org.osmdroid.tileprovider.modules.MBTilesFileArchive.getDatabaseFileArchive(MBTilesFileArchive.java:43)
11-21 12:29:29.723: E/AndroidRuntime(330): at org.tilespitter.mapboxtiles.MBTilesOsmdroidExample.mapBeginConfig(MBTilesOsmdroidExample.java:55)
11-21 12:29:29.723: E/AndroidRuntime(330): at org.tilespitter.mapboxtiles.MBTilesOsmdroidExample.onCreate(MBTilesOsmdroidExample.java:43)
11-21 12:29:29.723: E/AndroidRuntime(330): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
11-21 12:29:29.723: E/AndroidRuntime(330): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
11-21 12:29:29.723: E/AndroidRuntime(330): ... 11 more
Here is the code that load assets. I did not change the code other than the name of file.
private void mapBeginConfig(){
mResourceProxy = new DefaultResourceProxyImpl(getApplicationContext());
SimpleRegisterReceiver simpleReceiver = new SimpleRegisterReceiver(this);
File f = new File(Environment.getExternalStorageDirectory(), "military-bene-and-tacan-routes.db"); //change from map.mbtiles
IArchiveFile[] files = { MBTilesFileArchive.getDatabaseFileArchive(f) };
MapTileModuleProviderBase moduleProvider = new MapTileFileArchiveProvider(simpleReceiver, MBTILESRENDER, files);
mProvider = new MapTileProviderArray(MBTILESRENDER, null,
new MapTileModuleProviderBase[]{ moduleProvider }
);
this.mOsmv = new MapView(this, 256, mResourceProxy, mProvider);
}
My question if can someone check why unable to load the MBtiles files assets folder?
Environment.getExternalStorageDirectory(), "military-bene-and-tacan-routes.db"
This statement refers to sdcard not assets. Place your .db file on sdcard and it will run
OSMDroid only does raw images from the assets folder. Databases have to be in /sdcard/osmdroid or somewhere else on the device. In order for the tiles to load the ITileSource name must match the name of the tile layer in the database. You could write adopt the existing database loaders to remove that check, which might simplify things for you
I have an activty with a button i would like to start a FragmentActivity using this button.
but my problem is my Activity is unknown. I checked My AndroidManifest all my Activities are declared . you find below the Log. In this class I am using an external lib.
08-02 10:51:49.574: E/dalvikvm(12660): Could not find class 'edu.dartmouth.cs.actiontabs.ViewPagerActivity', referenced from method edu.dartmouth.cs.actiontabs.TestActivity$1.onClick
08-02 10:51:49.714: E/SpannableStringBuilder(12660): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
08-02 10:51:52.035: E/AndroidRuntime(12660): FATAL EXCEPTION: main
08-02 10:51:52.035: E/AndroidRuntime(12660): java.lang.NoClassDefFoundError: edu.dartmouth.cs.actiontabs.ViewPagerActivity
08-02 10:51:52.035: E/AndroidRuntime(12660): at edu.dartmouth.cs.actiontabs.TestActivity$1.onClick(TestActivity.java:28)
08-02 10:51:52.035: E/AndroidRuntime(12660): at android.view.View.performClick(View.java:4222)
08-02 10:51:52.035: E/AndroidRuntime(12660): at android.view.View$PerformClick.run(View.java:17337)
08-02 10:51:52.035: E/AndroidRuntime(12660): at android.os.Handler.handleCallback(Handler.java:615)
08-02 10:51:52.035: E/AndroidRuntime(12660): at android.os.Handler.dispatchMessage(Handler.java:92)
08-02 10:51:52.035: E/AndroidRuntime(12660): at android.os.Looper.loop(Looper.java:137)
08-02 10:51:52.035: E/AndroidRuntime(12660): at android.app.ActivityThread.main(ActivityThread.java:4895)
08-02 10:51:52.035: E/AndroidRuntime(12660): at java.lang.reflect.Method.invokeNative(Native Method)
08-02 10:51:52.035: E/AndroidRuntime(12660): at java.lang.reflect.Method.invoke(Method.java:511)
08-02 10:51:52.035: E/AndroidRuntime(12660): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:994)
08-02 10:51:52.035: E/AndroidRuntime(12660): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:761)
08-02 10:51:52.035: E/AndroidRuntime(12660): at dalvik.system.NativeStart.main(Native Method)
the declaration of my Activity in the manifest file:
<activity android:name="edu.dartmouth.cs.actiontabs.ViewPagerActivity" >
</activity>
i'm getting this message when i run my application i don't know why i'm getting it could any one help me. here is the logcat.
java.lang.VerifyError: com.kosh.me.Smaller
at java.lang.Class.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1429)
at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2577)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
at android.app.ActivityThread.access$2300(ActivityThread.java:125)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4627)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:876)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:634)
at dalvik.system.NativeStart.main(Native Method)
This happens when the build library classes conflict with those at run-time. Try performing a Clean of your project followed by a build.
My Application was working fine. But as soon as i updated from ADT 16 to ADT 17 then i am getting this error
Unable to resolve superclass of Lcom/my/app/MyActivity; (130)
Link of class 'Lcom/my/app/MyActivity;' failed
D/AndroidRuntime(328): Shutting down VM
W/dalvikvm(328): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
E/AndroidRuntime(328): FATAL EXCEPTION: main
E/AndroidRuntime(328): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.my.app/com.my.app.MyActivity}: java.lang.ClassNotFoundException: com.my.app.MyActivity in loader dalvik.system.PathClassLoader[/data/app/com.my.app-1.apk]
E/AndroidRuntime(328): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2585)
E/AndroidRuntime(328): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
E/AndroidRuntime(328): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
E/AndroidRuntime(328): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
E/AndroidRuntime(328): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(328): at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime(328): at android.app.ActivityThread.main(ActivityThread.java:4627)
E/AndroidRuntime(328): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(328): at java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime(328): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
E/AndroidRuntime(328): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
E/AndroidRuntime(328): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime(328): Caused by: java.lang.ClassNotFoundException: com.my.app.MyActivity in loader dalvik.system.PathClassLoader[/data/app/com.my.app-1.apk]
E/AndroidRuntime(328): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
E/AndroidRuntime(328): at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
E/AndroidRuntime(328): at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
E/AndroidRuntime(328): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
E/AndroidRuntime(328): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2577)
E/AndroidRuntime(328): ... 11 more
How to resolve it?
This issue occurs because the "lib" folder is renamed to "libs" now by Android People.
And as soon as we place our external jars to this "libs" folder then it will automatically be added to the build path of the application.
15 reports
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.oas.fruitkungfufree/com.openfeint.internal.ui.IntroFlow}: java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
at android.app.ActivityThread.access$2300(ActivityThread.java:125)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4627)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at com.openfeint.internal.Util.setOrientation(Util.java:36)
at com.openfeint.internal.ui.NestedWindow.onCreate(NestedWindow.java:32)
at com.openfeint.internal.ui.WebNav.onCreate(WebNav.java:93)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
Does any one have a solution for this??
This is a problem with your code, you can't use an object that is null. This is a hint.