MBTilesOsmDroidExample Failed to Load MBTiles File from Assets Folder - android

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

Related

My app freezes crashes when it's supposed to go to the next activity

I don't know why the app crashes whenever it's supposed to go to the next Activity. I made a practice app that works as it should when using the same format. I uploaded the files to gist.github.
The error is
1216-1216/com.example.chiozokamalu.newfreshstart E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.ArrayIndexOutOfBoundsException
at com.example.chiozokamalu.newfreshstart.MainActivity.onClick(MainActivity.java:164)
at android.view.View.performClick(View.java:2485)
at android.view.View$PerformClick.run(View.java:9080)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3683)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
at dalvik.system.NativeStart.main(Native Method)
On line 164 of MainActivity.java:
questionView.setText(questions[questionIndex]); // set the text to the next question
EDIT: After Varun helped me, I get a new error which is
1307-1307/com.example.chiozokamalu.newfreshstart E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.chiozokamalu.newfreshstart/com.example.chiozokamalu.newfreshstart.Results1}: java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
at android.app.ActivityThread.access$1500(ActivityThread.java:117)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3683)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at com.example.chiozokamalu.newfreshstart.Results1.onCreate(Results1.java:58)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
            at android.app.ActivityThread.access$1500(ActivityThread.java:117)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:130)
            at android.app.ActivityThread.main(ActivityThread.java:3683)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:507)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
            at dalvik.system.NativeStart.main(Native Method)
The questions array at line no. 164 is going out of bound that means questionIndex is greater than the total length of the questions array. So you should add a check on the length before extracting value from the array.
You have added the check but after that you incremented the value so either you modify the if condition to if (questionIndex < questions.length -1)
or modify the questionIndex variable before the if condition
You are getting problem because you haven't initiated resultView9 that is why it is null and giving nullpointer, just initiatlise it as you done with other and everything is fine. You have initialised the resultView8 twice just add resultview9 over there

App crashes by Resource$NotFoundException using ActionBarSherlock

My application crashes on start up with this log:
09-25 07:12:27.721: W/ResourceType(361): Failure getting entry for 0x7f030016 (t=2 e=22) in package 0: 0xffffffb5
09-25 07:12:27.721: D/AndroidRuntime(361): Shutting down VM
09-25 07:12:27.721: W/dalvikvm(361): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
09-25 07:12:27.741: E/AndroidRuntime(361): FATAL EXCEPTION: main
09-25 07:12:27.741: E/AndroidRuntime(361): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.villaparvaneh/com.villaparvaneh.VillaListActivity}: android.content.res.Resources$NotFoundException: Resource ID #0x7f030016
09-25 07:12:27.741: E/AndroidRuntime(361): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
09-25 07:12:27.741: E/AndroidRuntime(361): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
09-25 07:12:27.741: E/AndroidRuntime(361): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
09-25 07:12:27.741: E/AndroidRuntime(361): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
09-25 07:12:27.741: E/AndroidRuntime(361): at android.os.Handler.dispatchMessage(Handler.java:99)
09-25 07:12:27.741: E/AndroidRuntime(361): at android.os.Looper.loop(Looper.java:123)
09-25 07:12:27.741: E/AndroidRuntime(361): at android.app.ActivityThread.main(ActivityThread.java:4627)
09-25 07:12:27.741: E/AndroidRuntime(361): at java.lang.reflect.Method.invokeNative(Native Method)
09-25 07:12:27.741: E/AndroidRuntime(361): at java.lang.reflect.Method.invoke(Method.java:521)
09-25 07:12:27.741: E/AndroidRuntime(361): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
09-25 07:12:27.741: E/AndroidRuntime(361): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
09-25 07:12:27.741: E/AndroidRuntime(361): at dalvik.system.NativeStart.main(Native Method)
09-25 07:12:27.741: E/AndroidRuntime(361): Caused by: android.content.res.Resources$NotFoundException: Resource ID #0x7f030016
09-25 07:12:27.741: E/AndroidRuntime(361): at android.content.res.Resources.getValue(Resources.java:892)
09-25 07:12:27.741: E/AndroidRuntime(361): at android.content.res.Resources.loadXmlResourceParser(Resources.java:1869)
09-25 07:12:27.741: E/AndroidRuntime(361): at android.content.res.Resources.getLayout(Resources.java:731)
09-25 07:12:27.741: E/AndroidRuntime(361): at android.view.LayoutInflater.inflate(LayoutInflater.java:318)
09-25 07:12:27.741: E/AndroidRuntime(361): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
09-25 07:12:27.741: E/AndroidRuntime(361): at com.actionbarsherlock.internal.ActionBarSherlockCompat.setContentView(ActionBarSherlockCompat.java:840)
09-25 07:12:27.741: E/AndroidRuntime(361): at com.actionbarsherlock.app.SherlockFragmentActivity.setContentView(SherlockFragmentActivity.java:261)
09-25 07:12:27.741: E/AndroidRuntime(361): at com.villaparvaneh.VillaListActivity.onCreate(VillaListActivity.java:47)
09-25 07:12:27.741: E/AndroidRuntime(361): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
09-25 07:12:27.741: E/AndroidRuntime(361): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
09-25 07:12:27.741: E/AndroidRuntime(361): ... 11 more
At first I used eclipse wizard for creating a Master/Detail activity and my minsdk was set to 11. but then I used ActionBarSherlock and changed my activity code for that nothing more! At first time lunch there was an error for not setting theme to Theme.Sherlock.Light. after I changed the style file the above error comes up!
I googled for a day and read some similar issues like this and this, but it seems that my problem is not related to them. I searched for resource 0x7f030016 in R.java file and find out that it is R.attr.actionModeCloseDrawable and the exception is thrown in the setContentView(int layoutResId) of ActionBarSherlockCompat.java or ActionBarSherlockNative.java at the following line:
mActivity.getLayoutInflater().inflate(layoutResId, mContentParent);
where layoutResId is R.attr.actionModeCloseDrawable and mContentParent is an instance of com.actionbarsherlock.internal.nineoldandroids.widget.NineFrameLayout. I spend a whole day on this and checked every related link on google, but I cant figure out what's happening. I use Android 4.3 for building the app and support library revision 18. I don't think my code is useful here because error is not happened in my code. maybe some of xml files in res folder is needed, just tell which one to add it.
Any idea?
Thanks

thread exiting with uncaught exception

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.

Getting error when updating ADT pugin" java.lang.NoClassDefFoundError: org.ksoap2.serialization.SoapObject"

here is the error i was getting ......
i tried like properties-Libraries changed jar file into separate folder Libs also..
04-19 15:02:58.419: E/AndroidRuntime(428): FATAL EXCEPTION: main
04-19 15:02:58.419: E/AndroidRuntime(428): java.lang.NoClassDefFoundError: org.ksoap2.serialization.SoapObject
04-19 15:02:58.419: E/AndroidRuntime(428): at com.emigos.ontime.OntimeGps5Activity.Login(OntimeGps5Activity.java:174)
04-19 15:02:58.419: E/AndroidRuntime(428): at com.emigos.ontime.OntimeGps5Activity$1.onClick(OntimeGps5Activity.java:80)
04-19 15:02:58.419: E/AndroidRuntime(428): at android.view.View.performClick(View.java:2485)
04-19 15:02:58.419: E/AndroidRuntime(428): at android.view.View$PerformClick.run(View.java:9080)
04-19 15:02:58.419: E/AndroidRuntime(428): at android.os.Handler.handleCallback(Handler.java:587)
04-19 15:02:58.419: E/AndroidRuntime(428): at android.os.Handler.dispatchMessage(Handler.java:92)
04-19 15:02:58.419: E/AndroidRuntime(428): at android.os.Looper.loop(Looper.java:123)
04-19 15:02:58.419: E/AndroidRuntime(428): at android.app.ActivityThread.main(ActivityThread.java:3683)
04-19 15:02:58.419: E/AndroidRuntime(428): at java.lang.reflect.Method.invokeNative(Native Method)
04-19 15:02:58.419: E/AndroidRuntime(428): at java.lang.reflect.Method.invoke(Method.java:507)
04-19 15:02:58.419: E/AndroidRuntime(428): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
04-19 15:02:58.419: E/AndroidRuntime(428): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
04-19 15:02:58.419: E/AndroidRuntime(428): at dalvik.system.NativeStart.main(Native Method)
Create new folder "libs" in the project and copy all the External Jar file files in this folder.then Right Click on Project -> Properties->Java Build Path->Here Change the Path of Jar files to "Libs" folder and remove the path of extrenal jar files that you have given from computer path.After That it will Work.
Note:if there is already folder "lib" in your project then only change the folder name "lib" to "libs".
If you are not getting my point then check this site:
http://xrigau.wordpress.com/2012/03/22/fix-some-problems-with-libraries-in-the-adt-17-plugin-10/
Name of folder Should be "libs" not "Libs"

Hello Android Stops Unexpectedly

I have searched the internet for days and have found dozens of solutions none of which work. So I thought I'd post my situation:
I have installed eclipse and the 2.3.3 android SDK onto my laptop, put the code in for hello world (or hello android) and clicked run. The emulator starts but when the activity is run I get the message "SORRY! the application Hello Android (process com.example helloandroid) has stopped unexpectedly. Please try again"
package com.example.helloandroid;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
public class HelloAndroid extends Activity {
/** Called when the activity is first created. */
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
TextView tv = new TextView(this);
tv.setText("Hello, Android");
setContentView(tv);
}
}
and this is log cat
02-03 12:54:59.470: D/AndroidRuntime(356): Shutting down VM
02-03 12:54:59.470: W/dalvikvm(356): threadid=1: thread exiting with uncaught exception (group=0x40015560)
02-03 12:54:59.521: E/AndroidRuntime(356): FATAL EXCEPTION: main
02-03 12:54:59.521: E/AndroidRuntime(356): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.helloandroid/com.example.helloandroid.HelloAndroidActivity}: java.lang.ClassNotFoundException: com.example.helloandroid.HelloAndroidActivity in loader dalvik.system.PathClassLoader[/data/app/com.example.helloandroid-1.apk]
02-03 12:54:59.521: E/AndroidRuntime(356): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1569)
02-03 12:54:59.521: E/AndroidRuntime(356): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
02-03 12:54:59.521: E/AndroidRuntime(356): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
02-03 12:54:59.521: E/AndroidRuntime(356): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
02-03 12:54:59.521: E/AndroidRuntime(356): at android.os.Handler.dispatchMessage(Handler.java:99)
02-03 12:54:59.521: E/AndroidRuntime(356): at android.os.Looper.loop(Looper.java:123)
02-03 12:54:59.521: E/AndroidRuntime(356): at android.app.ActivityThread.main(ActivityThread.java:3683)
02-03 12:54:59.521: E/AndroidRuntime(356): at java.lang.reflect.Method.invokeNative(Native Method)
02-03 12:54:59.521: E/AndroidRuntime(356): at java.lang.reflect.Method.invoke(Method.java:507)
02-03 12:54:59.521: E/AndroidRuntime(356): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
02-03 12:54:59.521: E/AndroidRuntime(356): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
02-03 12:54:59.521: E/AndroidRuntime(356): at dalvik.system.NativeStart.main(Native Method)
02-03 12:54:59.521: E/AndroidRuntime(356): Caused by: java.lang.ClassNotFoundException: com.example.helloandroid.HelloAndroidActivity in loader dalvik.system.PathClassLoader[/data/app/com.example.helloandroid-1.apk]
02-03 12:54:59.521: E/AndroidRuntime(356): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
02-03 12:54:59.521: E/AndroidRuntime(356): at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
02-03 12:54:59.521: E/AndroidRuntime(356): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
02-03 12:54:59.521: E/AndroidRuntime(356): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
02-03 12:54:59.521: E/AndroidRuntime(356): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1561)
02-03 12:54:59.521: E/AndroidRuntime(356): ... 11 more
02-03 12:59:59.691: I/Process(356): Sending signal. PID: 356 SIG: 9
02-03 13:00:33.371: D/AndroidRuntime(366): Shutting down VM
02-03 13:00:33.371: W/dalvikvm(366): threadid=1: thread exiting with uncaught exception (group=0x40015560)
02-03 13:00:33.431: E/AndroidRuntime(366): FATAL EXCEPTION: main
02-03 13:00:33.431: E/AndroidRuntime(366): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.helloandroid/com.example.helloandroid.HelloAndroidActivity}: java.lang.ClassNotFoundException: com.example.helloandroid.HelloAndroidActivity in loader dalvik.system.PathClassLoader[/data/app/com.example.helloandroid-1.apk]
02-03 13:00:33.431: E/AndroidRuntime(366): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1569)
02-03 13:00:33.431: E/AndroidRuntime(366): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
02-03 13:00:33.431: E/AndroidRuntime(366): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
02-03 13:00:33.431: E/AndroidRuntime(366): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
02-03 13:00:33.431: E/AndroidRuntime(366): at android.os.Handler.dispatchMessage(Handler.java:99)
02-03 13:00:33.431: E/AndroidRuntime(366): at android.os.Looper.loop(Looper.java:123)
02-03 13:00:33.431: E/AndroidRuntime(366): at android.app.ActivityThread.main(ActivityThread.java:3683)
02-03 13:00:33.431: E/AndroidRuntime(366): at java.lang.reflect.Method.invokeNative(Native Method)
02-03 13:00:33.431: E/AndroidRuntime(366): at java.lang.reflect.Method.invoke(Method.java:507)
02-03 13:00:33.431: E/AndroidRuntime(366): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
02-03 13:00:33.431: E/AndroidRuntime(366): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
02-03 13:00:33.431: E/AndroidRuntime(366): at dalvik.system.NativeStart.main(Native Method)
02-03 13:00:33.431: E/AndroidRuntime(366): Caused by: java.lang.ClassNotFoundException: com.example.helloandroid.HelloAndroidActivity in loader dalvik.system.PathClassLoader[/data/app/com.example.helloandroid-1.apk]
02-03 13:00:33.431: E/AndroidRuntime(366): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
02-03 13:00:33.431: E/AndroidRuntime(366): at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
02-03 13:00:33.431: E/AndroidRuntime(366): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
02-03 13:00:33.431: E/AndroidRuntime(366): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
02-03 13:00:33.431: E/AndroidRuntime(366): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1561)
02-03 13:00:33.431: E/AndroidRuntime(366): ... 11 more
02-03 13:05:33.600: I/Process(366): Sending signal. PID: 366 SIG: 9
It seems to be something wrong with the way your emulator is set up. Did you follow this tutorial especially the "Setting up the AVD" part?
I would start the install of the emulator all over again. Also you could send him a copy of your program and if he can successfully run your project in the emulator then you know you just need to get your emulator set up correctly.
try moving your setContentView() method above your textview initialization

Categories

Resources