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
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'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.
I put the following code in my manifest.xml
<activity android:name="CPohonApp" android:configChanges="keyboardHidden|orientation"></activity>
and this is the code in my activity
#Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
}
but still the App crashes when I rotate.
Why does this happen?
I use Android 2.3.3 API 10
thank you
EDIT
this is my log cat
09-25 14:36:31.351: E/AndroidRuntime(334): FATAL EXCEPTION: main
09-25 14:36:31.351: E/AndroidRuntime(334): java.lang.RuntimeException: Unable to start activity ComponentInfo{org.hdte.sawit/org.hdte.sawit.pohon.CPohonApp}: java.lang.NullPointerException
09-25 14:36:31.351: E/AndroidRuntime(334): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647)
09-25 14:36:31.351: E/AndroidRuntime(334): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
09-25 14:36:31.351: E/AndroidRuntime(334): at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:2832)
09-25 14:36:31.351: E/AndroidRuntime(334): at android.app.ActivityThread.access$1600(ActivityThread.java:117)
09-25 14:36:31.351: E/AndroidRuntime(334): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
09-25 14:36:31.351: E/AndroidRuntime(334): at android.os.Handler.dispatchMessage(Handler.java:99)
09-25 14:36:31.351: E/AndroidRuntime(334): at android.os.Looper.loop(Looper.java:123)
09-25 14:36:31.351: E/AndroidRuntime(334): at android.app.ActivityThread.main(ActivityThread.java:3683)
09-25 14:36:31.351: E/AndroidRuntime(334): at java.lang.reflect.Method.invokeNative(Native Method)
09-25 14:36:31.351: E/AndroidRuntime(334): at java.lang.reflect.Method.invoke(Method.java:507)
09-25 14:36:31.351: E/AndroidRuntime(334): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
09-25 14:36:31.351: E/AndroidRuntime(334): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
09-25 14:36:31.351: E/AndroidRuntime(334): at dalvik.system.NativeStart.main(Native Method)
09-25 14:36:31.351: E/AndroidRuntime(334): Caused by: java.lang.NullPointerException
09-25 14:36:31.351: E/AndroidRuntime(334): at org.hdte.sawit.pohon.CPohonApp.createDialogSend(CPohonApp.java:277)
09-25 14:36:31.351: E/AndroidRuntime(334): at org.hdte.sawit.pohon.CPohonApp.onCreateDialog(CPohonApp.java:299)
09-25 14:36:31.351: E/AndroidRuntime(334): at android.app.Activity.onCreateDialog(Activity.java:2482)
09-25 14:36:31.351: E/AndroidRuntime(334): at android.app.Activity.createDialog(Activity.java:882)
09-25 14:36:31.351: E/AndroidRuntime(334): at android.app.Activity.restoreManagedDialogs(Activity.java:871)
09-25 14:36:31.351: E/AndroidRuntime(334): at android.app.Activity.performRestoreInstanceState(Activity.java:817)
09-25 14:36:31.351: E/AndroidRuntime(334): at android.app.Instrumentation.callActivityOnRestoreInstanceState(Instrumentation.java:1096)
09-25 14:36:31.351: E/AndroidRuntime(334): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1625)
09-25 14:36:31.351: E/AndroidRuntime(334): ... 12 more
You should you Dot(.) leading your activity Name.
<activity android:name=".CPohonApp" android:configChanges="keyboardHidden|orientation"></activity>
Or use full package name with your activity name when you declare it in android manifest file.
<activity android:name="yourpackagename.CPohonApp" android:configChanges="keyboardHidden|orientation"></activity>
Use in each Activity tag
<activity android:name=".example" android:configChanges="orientation|keyboardHidden"/>
add this code in manifest
android:configChanges="orientation|keyboardHidden|screenSize"
full code example
<activity
android:name=".your activity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:label="#string/app_name" >
</activity>
I am new at android. I am trying to run java code program of modbusdroid in eclipse
i did not change any code only downloaded latest version seroUtils.jar and added to project because it was missing. error log is attached please help me
when i run it in eclipse
source - https://github.com/bigcat/ModbusDroid
09-25 17:22:17.806: E/dalvikvm(813): Could not find class 'com.bencatlin.modbusdroid.OldVersion.MbDroidMsgExceptionHandler', referenced from method com.bencatlin.modbusdroid.OldVersion.ModbusDroid.onCreate
09-25 17:22:19.117: E/dalvikvm(813): Could not find class 'com.serotonin.util.queue.ByteQueue', referenced from method com.serotonin.modbus4j.base.ModbusUtils.calculateCRC
09-25 17:22:20.277: E/dalvikvm(813): Could not find class 'com.serotonin.messaging.StreamTransport', referenced from method com.serotonin.modbus4j.ip.tcp.TcpMaster.openConnection
09-25 17:22:20.498: E/dalvikvm(813): Could not find class 'com.serotonin.modbus4j.ip.encap.EncapMessageParser', referenced from method com.serotonin.modbus4j.ip.tcp.TcpMaster.init
09-25 17:22:20.667: E/dalvikvm(813): Could not find class 'com.serotonin.modbus4j.ip.xa.XaMessageParser', referenced from method com.serotonin.modbus4j.ip.tcp.TcpMaster.init
09-25 17:22:20.807: E/dalvikvm(813): Could not find class 'com.serotonin.modbus4j.ip.encap.EncapMessageRequest', referenced from method com.serotonin.modbus4j.ip.tcp.TcpMaster.send
09-25 17:22:20.930: E/dalvikvm(813): Could not find class 'com.serotonin.modbus4j.ip.xa.XaMessageRequest', referenced from method com.serotonin.modbus4j.ip.tcp.TcpMaster.send
09-25 17:22:21.437: E/dalvikvm(813): Could not find class 'com.serotonin.messaging.MessageControl', referenced from method com.serotonin.modbus4j.ModbusMaster.getMessageControl
09-25 17:22:21.797: E/dalvikvm(813): Could not find class 'com.serotonin.messaging.DefaultMessagingExceptionHandler', referenced from method com.serotonin.modbus4j.Modbus.<init>
09-25 17:22:22.002: E/dalvikvm(813): Could not find class 'com.serotonin.messaging.DefaultMessagingExceptionHandler', referenced from method com.serotonin.modbus4j.Modbus.setExceptionHandler
09-25 17:22:22.277: E/AndroidRuntime(813): FATAL EXCEPTION: main
09-25 17:22:22.277: E/AndroidRuntime(813): java.lang.NoClassDefFoundError: com.serotonin.messaging.DefaultMessagingExceptionHandler
09-25 17:22:22.277: E/AndroidRuntime(813): at com.serotonin.modbus4j.Modbus.<init>(Modbus.java:34)
09-25 17:22:22.277: E/AndroidRuntime(813): at com.serotonin.modbus4j.ModbusMaster.<init>(ModbusMaster.java:55)
09-25 17:22:22.277: E/AndroidRuntime(813): at com.serotonin.modbus4j.ip.tcp.TcpMaster.<init>(TcpMaster.java:55)
09-25 17:22:22.277: E/AndroidRuntime(813): at com.bencatlin.modbusdroid.OldVersion.ModbusTCPMaster.<init>(ModbusTCPMaster.java:23)
09-25 17:22:22.277: E/AndroidRuntime(813): at com.bencatlin.modbusdroid.OldVersion.ModbusTCPFactory.createModbusTCPMaster(ModbusTCPFactory.java:12)
09-25 17:22:22.277: E/AndroidRuntime(813): at com.bencatlin.modbusdroid.OldVersion.ModbusDroid.onCreate(ModbusDroid.java:426)
09-25 17:22:22.277: E/AndroidRuntime(813): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
09-25 17:22:22.277: E/AndroidRuntime(813): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
09-25 17:22:22.277: E/AndroidRuntime(813): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
09-25 17:22:22.277: E/AndroidRuntime(813): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
09-25 17:22:22.277: E/AndroidRuntime(813): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
09-25 17:22:22.277: E/AndroidRuntime(813): at android.os.Handler.dispatchMessage(Handler.java:99)
09-25 17:22:22.277: E/AndroidRuntime(813): at android.os.Looper.loop(Looper.java:123)
09-25 17:22:22.277: E/AndroidRuntime(813): at android.app.ActivityThread.main(ActivityThread.java:4627)
09-25 17:22:22.277: E/AndroidRuntime(813): at java.lang.reflect.Method.invokeNative(Native Method)
09-25 17:22:22.277: E/AndroidRuntime(813): at java.lang.reflect.Method.invoke(Method.java:521)
09-25 17:22:22.277: E/AndroidRuntime(813): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
09-25 17:22:22.277: E/AndroidRuntime(813): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
09-25 17:22:22.277: E/AndroidRuntime(813): at dalvik.system.NativeStart.main(Native Method)
Display.getRotation was added in Api level 8 (Froyo 2.2 ). I guess you are using a older device or emulator. Create a new AVD with api level >= 8
I had the same problem, I solved putting a new seroutils.jar into the 'libraries' tab into 'java build path' and then I've checked the jar into the 'order and export' tab.
It solves the problem permanently.
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.