Unable to launch app for broadcast intent - android

I wrote a small clock widget. Like all clocks, it has to be updated every minute. So I set up an alarm to do this. It worked fine. It was just a little too small. So I fiddled with an XML attribute and tried again. It force-closed. I changed the attribute back to the original and tried again. It again force-closed.
The LogCat follows(from package install to the OS killing it):
01-19 13:38:52.292: DEBUG/PackageManager(57): New package installed in /data/app/com.---.clock-2.apk
01-19 13:38:52.571: INFO/ActivityManager(57): Force stopping package com.---.clock uid=10043
01-19 13:38:52.571: INFO/Process(57): Sending signal. PID: 593 SIG: 9
01-19 13:38:52.612: INFO/ActivityManager(57): Force stopping package com.---.clock uid=10043
01-19 13:38:53.022: DEBUG/PhotoAppWidgetProvider(282): getPhoto query count=0
01-19 13:38:53.022: DEBUG/PhotoAppWidgetProvider(282): sending out views=null for id=0
01-19 13:38:53.131: INFO/ActivityManager(57): Start proc com.---.clock for broadcast com.---.clock/.Clock: pid=613 uid=10043 gids={1015}
01-19 13:38:53.713: DEBUG/Clock widget(613): updated
01-19 13:38:54.011: INFO/ActivityManager(57): Force stopping package com.---.clock uid=10043
01-19 13:38:54.021: INFO/Process(57): Sending signal. PID: 613 SIG: 9
01-19 13:38:54.301: DEBUG/dalvikvm(121): GC_EXPLICIT freed 13673 objects / 524360 bytes in 177ms
01-19 13:38:54.542: DEBUG/dalvikvm(125): GC_EXPLICIT freed 4956 objects / 200960 bytes in 440ms
01-19 13:38:54.801: WARN/RecognitionManagerService(57): no available voice recognition services found
01-19 13:38:55.032: DEBUG/dalvikvm(57): GC_EXPLICIT freed 4960 objects / 290104 bytes in 201ms
01-19 13:38:55.042: INFO/installd(35): unlink /data/dalvik-cache/data#app#com.---.clock-1.apk#classes.dex
01-19 13:38:55.131: DEBUG/AndroidRuntime(605): Shutting down VM
01-19 13:38:55.151: DEBUG/dalvikvm(605): Debugger has detached; object registry had 1 entries
01-19 13:38:55.212: INFO/AndroidRuntime(605): NOTE: attach of thread 'Binder Thread #3' failed
01-19 13:38:55.571: DEBUG/PhotoAppWidgetProvider(282): getPhoto query count=0
01-19 13:38:55.571: DEBUG/PhotoAppWidgetProvider(282): sending out views=null for id=0
01-19 13:38:55.762: INFO/ActivityManager(57): Start proc com.---.clock for broadcast com.---.clock/.Clock: pid=622 uid=10043 gids={1015}
01-19 13:38:56.332: WARN/asset(622): Asset path /data/app/com.---.clock-1.apk is neither a directory nor file (type=1).
01-19 13:38:56.373: DEBUG/AndroidRuntime(622): Shutting down VM
01-19 13:38:56.373: WARN/dalvikvm(622): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
01-19 13:38:56.722: DEBUG/PhotoAppWidgetProvider(282): getPhoto query count=0
01-19 13:38:56.732: DEBUG/PhotoAppWidgetProvider(282): sending out views=null for id=0
01-19 13:38:56.841: ERROR/AndroidRuntime(622): FATAL EXCEPTION: main
01-19 13:38:56.841: ERROR/AndroidRuntime(622): java.lang.RuntimeException: Unable to instantiate receiver com.---.clock.Clock: java.lang.ClassNotFoundException: com.---.clock.Clock in loader dalvik.system.PathClassLoader[/data/app/com.---.clock-1.apk]
01-19 13:38:56.841: ERROR/AndroidRuntime(622): at android.app.ActivityThread.handleReceiver(ActivityThread.java:2789)
01-19 13:38:56.841: ERROR/AndroidRuntime(622): at android.app.ActivityThread.access$3200(ActivityThread.java:125)
01-19 13:38:56.841: ERROR/AndroidRuntime(622): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2083)
01-19 13:38:56.841: ERROR/AndroidRuntime(622): at android.os.Handler.dispatchMessage(Handler.java:99)
01-19 13:38:56.841: ERROR/AndroidRuntime(622): at android.os.Looper.loop(Looper.java:123)
01-19 13:38:56.841: ERROR/AndroidRuntime(622): at android.app.ActivityThread.main(ActivityThread.java:4627)
01-19 13:38:56.841: ERROR/AndroidRuntime(622): at java.lang.reflect.Method.invokeNative(Native Method)
01-19 13:38:56.841: ERROR/AndroidRuntime(622): at java.lang.reflect.Method.invoke(Method.java:521)
01-19 13:38:56.841: ERROR/AndroidRuntime(622): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
01-19 13:38:56.841: ERROR/AndroidRuntime(622): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
01-19 13:38:56.841: ERROR/AndroidRuntime(622): at dalvik.system.NativeStart.main(Native Method)
01-19 13:38:56.841: ERROR/AndroidRuntime(622): Caused by: java.lang.ClassNotFoundException: com.---.clock.Clock in loader dalvik.system.PathClassLoader[/data/app/com.---.clock-1.apk]
01-19 13:38:56.841: ERROR/AndroidRuntime(622): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
01-19 13:38:56.841: ERROR/AndroidRuntime(622): at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
01-19 13:38:56.841: ERROR/AndroidRuntime(622): at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
01-19 13:38:56.841: ERROR/AndroidRuntime(622): at android.app.ActivityThread.handleReceiver(ActivityThread.java:2780)
01-19 13:38:56.841: ERROR/AndroidRuntime(622): ... 10 more
01-19 13:38:56.901: WARN/asset(57): Asset path /data/app/com.---.clock-1.apk is neither a directory nor file (type=1).
01-19 13:38:56.913: WARN/PackageManager(57): Failure retrieving resources forcom.---.clock
01-19 13:38:57.932: DEBUG/PhotoAppWidgetProvider(282): getPhoto query count=0
01-19 13:38:58.003: DEBUG/PhotoAppWidgetProvider(282): sending out views=null for id=0
01-19 13:39:05.101: INFO/Process(622): Sending signal. PID: 622 SIG: 9
01-19 13:39:05.151: INFO/ActivityManager(57): Process com.---.clock (pid 622) has died.
01-19 13:39:05.182: WARN/InputManagerService(57): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy#43ecc698
01-19 13:39:05.892: DEBUG/PhotoAppWidgetProvider(282): getPhoto query count=0
01-19 13:39:05.892: DEBUG/PhotoAppWidgetProvider(282): sending out views=null for id=0
01-19 13:39:06.011: INFO/ActivityManager(57): Start proc com.---.clock for broadcast com.---.clock/.Clock: pid=630 uid=10043 gids={1015}
01-19 13:39:06.413: WARN/asset(630): Asset path /data/app/com.---.clock-1.apk is neither a directory nor file (type=1).
01-19 13:39:06.472: DEBUG/AndroidRuntime(630): Shutting down VM
01-19 13:39:06.482: WARN/dalvikvm(630): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
01-19 13:39:06.901: ERROR/AndroidRuntime(630): FATAL EXCEPTION: main
01-19 13:39:06.901: ERROR/AndroidRuntime(630): java.lang.RuntimeException: Unable to instantiate receiver com.---.clock.Clock: java.lang.ClassNotFoundException: com.---.clock.Clock in loader dalvik.system.PathClassLoader[/data/app/com.---.clock-1.apk]
01-19 13:39:06.901: ERROR/AndroidRuntime(630): at android.app.ActivityThread.handleReceiver(ActivityThread.java:2789)
01-19 13:39:06.901: ERROR/AndroidRuntime(630): at android.app.ActivityThread.access$3200(ActivityThread.java:125)
01-19 13:39:06.901: ERROR/AndroidRuntime(630): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2083)
01-19 13:39:06.901: ERROR/AndroidRuntime(630): at android.os.Handler.dispatchMessage(Handler.java:99)
01-19 13:39:06.901: ERROR/AndroidRuntime(630): at android.os.Looper.loop(Looper.java:123)
01-19 13:39:06.901: ERROR/AndroidRuntime(630): at android.app.ActivityThread.main(ActivityThread.java:4627)
01-19 13:39:06.901: ERROR/AndroidRuntime(630): at java.lang.reflect.Method.invokeNative(Native Method)
01-19 13:39:06.901: ERROR/AndroidRuntime(630): at java.lang.reflect.Method.invoke(Method.java:521)
01-19 13:39:06.901: ERROR/AndroidRuntime(630): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
01-19 13:39:06.901: ERROR/AndroidRuntime(630): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
01-19 13:39:06.901: ERROR/AndroidRuntime(630): at dalvik.system.NativeStart.main(Native Method)
01-19 13:39:06.901: ERROR/AndroidRuntime(630): Caused by: java.lang.ClassNotFoundException: com.---.clock.Clock in loader dalvik.system.PathClassLoader[/data/app/com.---.clock-1.apk]
01-19 13:39:06.901: ERROR/AndroidRuntime(630): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
01-19 13:39:06.901: ERROR/AndroidRuntime(630): at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
01-19 13:39:06.901: ERROR/AndroidRuntime(630): at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
01-19 13:39:06.901: ERROR/AndroidRuntime(630): at android.app.ActivityThread.handleReceiver(ActivityThread.java:2780)
01-19 13:39:06.901: ERROR/AndroidRuntime(630): ... 10 more
01-19 13:39:06.901: DEBUG/PhotoAppWidgetProvider(282): getPhoto query count=0
01-19 13:39:06.922: DEBUG/PhotoAppWidgetProvider(282): sending out views=null for id=0
01-19 13:39:07.051: WARN/ActivityManager(57): Process com.---.clock has crashed too many times: killing!
01-19 13:39:07.062: INFO/Process(57): Sending signal. PID: 630 SIG: 9
01-19 13:39:07.151: WARN/ActivityManager(57): Unable to launch app com.---.clock/10043 for broadcast Intent { act=android.appwidget.action.APPWIDGET_UPDATE cmp=com.---.clock/.Clock (has extras) }: process is bad
01-19 13:39:07.151: WARN/ActivityManager(57): finishReceiver called but none active
I have never seen this error before and have no idea what's causing it or how to fix it. Can someone interpret this for me please?

For whatever reason, (MAGIC!) Rebooting the emulator worked. I still have no idea why it messed up in the first place, but the reboot worked.

Related

Debug android app termination

I am currently implementing my first Android app. Debugging and developing goes usually fine but sometimes I have problem when doing some changes in my code and then starting the app again from Eclipse environment (to virtual device).
As far as I understand it, new start terminates the currently running version of my app in the emulator, that's fine - but is this some correct termination? Is some event raised in my app which I should handle?
Why am I asking? My problem is that for most of the Activities being currently active in the emulator my app terminates (it's gone) correctly and new version starts fine. But for about 2 of my Activities when they are active and I "restart" my app from Eclipse I can see for a few seconds message box "Unfortunately APP has stopped" and that gives me an idea that these Activities have probably to do something in their destructor, uninitialize something or whatever because termination causes some kind of crash. How to detect this, how to debug this? When I start the app again, the old version debugger is disconnected so it's not helping. All I can see is logcat exception call stack info but it's not helping me too much:
01-19 11:19:16.352: E/AndroidRuntime(1424): FATAL EXCEPTION: main
01-19 11:19:16.352: E/AndroidRuntime(1424): java.lang.RuntimeException: Unable to instantiate application android.app.Application: java.lang.NullPointerException
01-19 11:19:16.352: E/AndroidRuntime(1424): at android.app.LoadedApk.makeApplication(LoadedApk.java:504)
01-19 11:19:16.352: E/AndroidRuntime(1424): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4364)
01-19 11:19:16.352: E/AndroidRuntime(1424): at android.app.ActivityThread.access$1300(ActivityThread.java:141)
01-19 11:19:16.352: E/AndroidRuntime(1424): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1294)
01-19 11:19:16.352: E/AndroidRuntime(1424): at android.os.Handler.dispatchMessage(Handler.java:99)
01-19 11:19:16.352: E/AndroidRuntime(1424): at android.os.Looper.loop(Looper.java:137)
01-19 11:19:16.352: E/AndroidRuntime(1424): at android.app.ActivityThread.main(ActivityThread.java:5039)
01-19 11:19:16.352: E/AndroidRuntime(1424): at java.lang.reflect.Method.invokeNative(Native Method)
01-19 11:19:16.352: E/AndroidRuntime(1424): at java.lang.reflect.Method.invoke(Method.java:511)
01-19 11:19:16.352: E/AndroidRuntime(1424): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
01-19 11:19:16.352: E/AndroidRuntime(1424): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
01-19 11:19:16.352: E/AndroidRuntime(1424): at dalvik.system.NativeStart.main(Native Method)
01-19 11:19:16.352: E/AndroidRuntime(1424): Caused by: java.lang.NullPointerException
01-19 11:19:16.352: E/AndroidRuntime(1424): at android.app.LoadedApk.initializeJavaContextClassLoader(LoadedApk.java:379)
01-19 11:19:16.352: E/AndroidRuntime(1424): at android.app.LoadedApk.getClassLoader(LoadedApk.java:322)
01-19 11:19:16.352: E/AndroidRuntime(1424): at android.app.LoadedApk.makeApplication(LoadedApk.java:496)
01-19 11:19:16.352: E/AndroidRuntime(1424): ... 11 more
Debugger problem, app terminated in bad way, not real issue.

Google Calendar API error: Class definition not found for Calendar class

Hello everybody,
I am developing a app which will download all the events from google calendar to android device.
I found this example:
http://code.google.com/p/google-api-java-client/source/browse/calendar-android-sample/?repo=samples
I also downloaded the required library from http://code.google.com/p/google-api-java-client/wiki/APIs
Also from here : "http://code.google.com/p/google-api-java-client/downloads/list"
But I am getting error as class definition not found. Please help me.
My Logcat is as follows:
***10-10 12:52:10.129: E/dalvikvm(551): Could not find class 'com.google.api.services.calendar.Calendar$Builder', referenced from method com.examples.gcalsync.CalendarSample.onCreate***
10-10 12:52:10.129: W/dalvikvm(551): VFY: unable to resolve new-instance 702 (Lcom/google/api/services/calendar/Calendar$Builder;) in Lcom/examples/gcalsync/CalendarSample;
10-10 12:52:10.129: D/dalvikvm(551): VFY: replacing opcode 0x22 at 0x0009
10-10 12:52:10.129: D/dalvikvm(551): VFY: dead code 0x000b-0060 in Lcom/examples/gcalsync/CalendarSample;.onCreate (Landroid/os/Bundle;)V
10-10 12:52:10.139: E/dalvikvm(551): Could not find class 'com.google.api.services.calendar.model.Calendar', referenced from method com.examples.gcalsync.CalendarSample.onOptionsItemSelected
10-10 12:52:10.139: W/dalvikvm(551): VFY: unable to resolve new-instance 710 (Lcom/google/api/services/calendar/model/Calendar;) in Lcom/examples/gcalsync/CalendarSample;
10-10 12:52:10.139: D/dalvikvm(551): VFY: replacing opcode 0x22 at 0x000b
10-10 12:52:10.139: D/dalvikvm(551): VFY: dead code 0x000d-0036 in Lcom/examples/gcalsync/CalendarSample;.onOptionsItemSelected (Landroid/view/MenuItem;)Z
10-10 12:52:10.179: D/AndroidRuntime(551): Shutting down VM
10-10 12:52:10.179: W/dalvikvm(551): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
10-10 12:52:10.199: E/AndroidRuntime(551): FATAL EXCEPTION: main
***10-10 12:52:10.199: E/AndroidRuntime(551): java.lang.NoClassDefFoundError: com.google.api.services.calendar.Calendar$Builder***
10-10 12:52:10.199: E/AndroidRuntime(551): at com.examples.gcalsync.CalendarSample.onCreate(CalendarSample.java:127)
10-10 12:52:10.199: E/AndroidRuntime(551): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
10-10 12:52:10.199: E/AndroidRuntime(551): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
10-10 12:52:10.199: E/AndroidRuntime(551): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
10-10 12:52:10.199: E/AndroidRuntime(551): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
10-10 12:52:10.199: E/AndroidRuntime(551): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
10-10 12:52:10.199: E/AndroidRuntime(551): at android.os.Handler.dispatchMessage(Handler.java:99)
10-10 12:52:10.199: E/AndroidRuntime(551): at android.os.Looper.loop(Looper.java:123)
10-10 12:52:10.199: E/AndroidRuntime(551): at android.app.ActivityThread.main(ActivityThread.java:4627)
10-10 12:52:10.199: E/AndroidRuntime(551): at java.lang.reflect.Method.invokeNative(Native Method)
10-10 12:52:10.199: E/AndroidRuntime(551): at java.lang.reflect.Method.invoke(Method.java:521)
10-10 12:52:10.199: E/AndroidRuntime(551): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
10-10 12:52:10.199: E/AndroidRuntime(551): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
10-10 12:52:10.199: E/AndroidRuntime(551): at dalvik.system.NativeStart.main(Native Method)
Issue got solved.
Just need to put all external libraries in libs folder....

Android Error when closing the application

I have an android programm which manage a database. It this database, I write the sensor values of my device.
When close the application with the home button, i have a force close error.
Here is my logcat, can you please help me, thank you.
`12-27 10:45:20.827: D/AndroidRuntime(1053): Shutting down VM
12-27 10:45:20.827: W/dalvikvm(1053): threadid=1: thread exiting with uncaught exception (group=0x40014760)
12-27 10:45:20.942: E/AndroidRuntime(1053): FATAL EXCEPTION: main
12-27 10:45:20.942: E/AndroidRuntime(1053): java.lang.NullPointerException
12-27 10:45:20.942: E/AndroidRuntime(1053): at android.database.sqlite.SQLiteStatement.releaseAndUnlock(SQLiteStatement.java:283)
12-27 10:45:20.942: E/AndroidRuntime(1053): at android.database.sqlite.SQLiteStatement.executeInsert(SQLiteStatement.java:116)
12-27 10:45:20.942: E/AndroidRuntime(1053): at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1732)
12-27 10:45:20.942: E/AndroidRuntime(1053): at android.database.sqlite.SQLiteDatabase.insert(SQLiteDatabase.java:1605)
12-27 10:45:20.942: E/AndroidRuntime(1053): at milos.stationdemesure.CapteursBDD.insertValeursCapteur(CapteursBDD.java:69)
12-27 10:45:20.942: E/AndroidRuntime(1053): at milos.stationdemesure.EssaisCapteurs.onProximityChanged(EssaisCapteurs.java:454)
12-27 10:45:20.942: E/AndroidRuntime(1053): at milos.stationdemesure.EssaisCapteurs.onSensorChanged(EssaisCapteurs.java:354)
12-27 10:45:20.942: E/AndroidRuntime(1053): at android.hardware.SensorManager$ListenerDelegate$1.handleMessage(SensorManager.java:529)
12-27 10:45:20.942: E/AndroidRuntime(1053): at android.os.Handler.dispatchMessage(Handler.java:99)
12-27 10:45:20.942: E/AndroidRuntime(1053): at android.os.Looper.loop(Looper.java:126)
12-27 10:45:20.942: E/AndroidRuntime(1053): at android.app.ActivityThread.main(ActivityThread.java:3997)
12-27 10:45:20.942: E/AndroidRuntime(1053): at java.lang.reflect.Method.invokeNative(Native Method)
12-27 10:45:20.942: E/AndroidRuntime(1053): at java.lang.reflect.Method.invoke(Method.java:491)
12-27 10:45:20.942: E/AndroidRuntime(1053): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
12-27 10:45:20.942: E/AndroidRuntime(1053): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
12-27 10:45:20.942: E/AndroidRuntime(1053): at dalvik.system.NativeStart.main(Native Method)
`
I feel the issue is either database instance or any other object became null but you are calling some method using that object. Always check for null before using any methods of any object. see the sample example
example
if(database != null){
database.close();
}
Looks similar to this issue: SQLiteDatabase close() function causing NullPointerException when multiple threads
You may not need to call database.close()

Amazon java.lang.VerifyError Android

I have been trying to submit 2 separate apps into the Amazon App store but they keep being rejected. Here is the stack trace for the first:
11-05 11:14:36.488 E/AndroidRuntime(28128): FATAL EXCEPTION: AsyncTask #1
11-05 11:14:36.488 E/AndroidRuntime(28128): java.lang.RuntimeException: An error occured while executing doInBackground()
11-05 11:14:36.488 E/AndroidRuntime(28128): at android.os.AsyncTask$3.done(AsyncTask.java:200)
11-05 11:14:36.488 E/AndroidRuntime(28128): at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273)
11-05 11:14:36.488 E/AndroidRuntime(28128): at java.util.concurrent.FutureTask.setException(FutureTask.java:124)
11-05 11:14:36.488 E/AndroidRuntime(28128): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307)
11-05 11:14:36.488 E/AndroidRuntime(28128): at java.util.concurrent.FutureTask.run(FutureTask.java:137)
11-05 11:14:36.488 E/AndroidRuntime(28128): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1068)
11-05 11:14:36.488 E/AndroidRuntime(28128): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561)
11-05 11:14:36.488 E/AndroidRuntime(28128): at java.lang.Thread.run(Thread.java:1096)
11-05 11:14:36.488 E/AndroidRuntime(28128): Caused by: java.lang.VerifyError: com.companionfree.WLThemeViewer.AmazonClientManager
11-05 11:14:36.488 E/AndroidRuntime(28128): at com.companionfree.WLThemeViewer.UpdateDBs.doInBackground(UpdateDBs.java)
11-05 11:14:36.488 E/AndroidRuntime(28128): at com.companionfree.WLThemeViewer.UpdateDBs.doInBackground(UpdateDBs.java)
11-05 11:14:36.488 E/AndroidRuntime(28128): at android.os.AsyncTask$2.call(AsyncTask.java:185)
11-05 11:14:36.488 E/AndroidRuntime(28128): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
11-05 11:14:36.488 E/AndroidRuntime(28128): ... 4 more
And the relevant logcat for the second
10-12 15:41:48.929 D/dalvikvm( 2451): GC_FOR_MALLOC freed 8099 objects / 524416 bytes in 34ms
10-12 15:41:49.327 I/RPC ( 1563): rx thread timeout (1 clients):
10-12 15:41:49.828 I/RPC ( 1563): rx thread timeout (1 clients):
10-12 15:41:50.089 I/ActivityManager( 1563): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.companionfree.pushup/.MainScreen }
10-12 15:41:50.099 D/SurfaceFlinger( 1563): Layer::setBuffers(this=0xeafa50), pid=1563, w=1, h=1
10-12 15:41:50.099 D/SurfaceFlinger( 1563): Layer::setBuffers(this=0xeafa50), pid=1563, w=1, h=1
10-12 15:41:50.139 D/SurfaceFlinger( 1563): Layer::requestBuffer(this=0xeafa50), index=0, pid=1563, w=480, h=800 success
10-12 15:41:50.189 I/ActivityManager( 1563): Start proc com.companionfree.pushup for activity com.companionfree.pushup/.MainScreen: pid=2644 uid=10129 gids={1015, 3003}
10-12 15:41:50.319 I/RPC ( 1563): rx thread timeout (1 clients):
10-12 15:41:50.359 W/dalvikvm( 2644): VFY: Lcom/companionfree/pushup/WorkoutDbAdapter; is not instance of Landroid/app/Activity;
10-12 15:41:50.369 W/dalvikvm( 2644): VFY: bad arg 0 (into Landroid/app/Activity;)
10-12 15:41:50.369 W/dalvikvm( 2644): VFY: rejecting call to Lcom/amazon/android/Kiwi;.onActivityResult (Landroid/app/Activity;IILandroid/content/Intent;)Z
10-12 15:41:50.369 W/dalvikvm( 2644): VFY: rejecting opcode 0x71 at 0x0000
10-12 15:41:50.369 W/dalvikvm( 2644): VFY: rejected Lcom/companionfree/pushup/WorkoutDbAdapter;.onActivityResult (IILandroid/content/Intent;)V
10-12 15:41:50.369 W/dalvikvm( 2644): Verifier rejected class Lcom/companionfree/pushup/WorkoutDbAdapter;
10-12 15:41:50.369 D/AndroidRuntime( 2644): Shutting down VM
10-12 15:41:50.369 W/dalvikvm( 2644): threadid=1: thread exiting with uncaught exception (group=0x40025a70)
10-12 15:41:50.369 E/AndroidRuntime( 2644): FATAL EXCEPTION: main
10-12 15:41:50.369 E/AndroidRuntime( 2644): java.lang.VerifyError: com.companionfree.pushup.WorkoutDbAdapter
10-12 15:41:50.369 E/AndroidRuntime( 2644): at com.companionfree.pushup.MainScreen.onCreateMainScreen(MainScreen.java)
10-12 15:41:50.369 E/AndroidRuntime( 2644): at com.companionfree.pushup.MainScreen.onCreate(MainScreen.java)
10-12 15:41:50.369 E/AndroidRuntime( 2644): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1088)
10-12 15:41:50.369 E/AndroidRuntime( 2644): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2802)
10-12 15:41:50.369 E/AndroidRuntime( 2644): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2859)
10-12 15:41:50.369 E/AndroidRuntime( 2644): at android.app.ActivityThread.access$2300(ActivityThread.java:136)
10-12 15:41:50.369 E/AndroidRuntime( 2644): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2179)
10-12 15:41:50.369 E/AndroidRuntime( 2644): at android.os.Handler.dispatchMessage(Handler.java:99)
10-12 15:41:50.369 E/AndroidRuntime( 2644): at android.os.Looper.loop(Looper.java:143)
10-12 15:41:50.369 E/AndroidRuntime( 2644): at android.app.ActivityThread.main(ActivityThread.java:5073)
10-12 15:41:50.369 E/AndroidRuntime( 2644): at java.lang.reflect.Method.invokeNative(Native Method)
10-12 15:41:50.369 E/AndroidRuntime( 2644): at java.lang.reflect.Method.invoke(Method.java:521)
10-12 15:41:50.369 E/AndroidRuntime( 2644): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
10-12 15:41:50.369 E/AndroidRuntime( 2644): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
10-12 15:41:50.369 E/AndroidRuntime( 2644): at dalvik.system.NativeStart.main(Native Method)
10-12 15:41:50.379 W/ActivityManager( 1563): Force finishing activity com.companionfree.pushup/.MainScreen
10-12 15:41:50.399 D/SurfaceFlinger( 1563): Layer::setBuffers(this=0xeff6b8), pid=1563, w=1, h=1
10-12 15:41:50.399 D/SurfaceFlinger( 1563): Layer::setBuffers(this=0xeff6b8), pid=1563, w=1, h=1
10-12 15:41:50.419 D/SurfaceFlinger( 1563): Layer::requestBuffer(this=0xeff6b8), index=0, pid=1563, w=480, h=337 success
10-12 15:41:50.469 D/dalvikvm( 2451): GC_FOR_MALLOC freed 7889 objects / 521072 bytes in 105ms
10-12 15:41:50.819 I/RPC ( 1563): rx thread timeout (1 clients):
I see the same verify error on both but I can't figure it out. The only common library used between the 2 apps is the FlurryAgent.jar for analytics.
For the top app I have
For the bottom app I have
in the manifests. The only information I have been able to find out is about libraries (GSON) and needing to use dx but I am using Eclipse so that doesn't help.
To make this more difficult, the error does NOT occur on the Android Market. Yet the testers at Amazon say that it FC 5/5 times on each of their devices (I tried using an emulator for their test devices and they worked fine). I know they use "wrapper" code around my app and I think it must be interfering in some way.
Does anyone have any experience with this?
I had a similar problem - resolved it by removing the non activity class from AndroidManifest.xml
Amazon injects their own code into your apps Activities life-cycle events. Knowing that and looking at the log you've provided:
10-12 15:41:50.359 W/dalvikvm( 2644): VFY: Lcom/companionfree/pushup/WorkoutDbAdapter; is not instance of Landroid/app/Activity;
It appears that Amazon's code tried to instrument a class (WorkoutDbAdapter) which is NOT an Activity (doesn't extends Activity), ending up being rejected by the JVM's verifier.
With my app this happened since the class was listed was listed an an Activity on AndroidManifest.xml. Removing this listing from AndroidManifest.xml resolved the issue and the app was admitted to the market.
Sarp wrote that renaming your class' packaged solved the issue, perhaps by doing so you've made your listing on AndroidManifest.xml no longer relevant. Thereby circumventing the problem.
I'd say this is the problem of the Amazon. Apparently they are injecting some DRM code into your apk: Injecting code into APK
Other people are seeing similar errors - Android app issue (Amazon)
In my case, the class that was causing a VerifyError was in a package called util. It was probably clashing with an injected package by Amazon, because renaming it to utils solved the problem.
Because our app was using Facebook SDK, it was given a "No, I will sign my binary" option when uploading a new binary. When you upload an unsigned APK this way, Amazon will let you download the processed binary (that includes their injected code) as Step 2 so that you can sign it. I was able to download a copy of my APK that crashes, and test my changes without going through the approval process this way.
I just solved my problem and may help to you
I just update the AS to 2.0 and ADT, and the verify issue come out
finally, be careful with the constructor like:
class abc {
abc(int x) {
....
}
abc(byte x) {
....
}
}

Android Tab Layout 2.1

Hi all I have looked at the tutorial for creating tab layout on android on here:
link
which didn't work so I looked on here to find that there where errors with it. So I applied these and still I'm not getting anywhere with it.
The app loads on 2.1 emulator on eclipse and also on my phone but the application force closes each time which leads me to think that its a manifest problem.
Here is my manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.Android.fitnessap"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="#drawable/icon" android:label="#string/app_name">
<activity android:name=".TabLayout"
android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".HomeActivity"/>
<activity android:name=".HistoryActivity"/>
<activity android:name=".SettingsActivity"/>
</application>
<uses-sdk android:minSdkVersion="7" />
</manifest>
I've been stuck on this for hours now.
Thanks.
edit logcat:
01-19 18:37:09.316: ERROR/AndroidRuntime(126): ERROR: thread attach failed
01-19 18:37:10.945: ERROR/MediaPlayerService(31): Couldn't open fd for content://settings/system/notification_sound
01-19 18:37:10.955: ERROR/MediaPlayer(52): Unable to to create media player
01-19 18:37:15.345: ERROR/AndroidRuntime(170): ERROR: thread attach failed
01-19 18:37:17.215: ERROR/AndroidRuntime(197): Uncaught handler: thread main exiting due to uncaught exception
01-19 18:37:17.315: ERROR/AndroidRuntime(197): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.Android.fitnessap/com.Android.fitnessap.TabLayout}: java.lang.ClassNotFoundException: com.Android.fitnessap.TabLayout in loader dalvik.system.PathClassLoader#43b868e0
01-19 18:37:17.315: ERROR/AndroidRuntime(197): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2417)
01-19 18:37:17.315: ERROR/AndroidRuntime(197): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)
01-19 18:37:17.315: ERROR/AndroidRuntime(197): at android.app.ActivityThread.access$2200(ActivityThread.java:119)
01-19 18:37:17.315: ERROR/AndroidRuntime(197): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
01-19 18:37:17.315: ERROR/AndroidRuntime(197): at android.os.Handler.dispatchMessage(Handler.java:99)
01-19 18:37:17.315: ERROR/AndroidRuntime(197): at android.os.Looper.loop(Looper.java:123)
01-19 18:37:17.315: ERROR/AndroidRuntime(197): at android.app.ActivityThread.main(ActivityThread.java:4363)
01-19 18:37:17.315: ERROR/AndroidRuntime(197): at java.lang.reflect.Method.invokeNative(Native Method)
01-19 18:37:17.315: ERROR/AndroidRuntime(197): at java.lang.reflect.Method.invoke(Method.java:521)
01-19 18:37:17.315: ERROR/AndroidRuntime(197): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
01-19 18:37:17.315: ERROR/AndroidRuntime(197): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
01-19 18:37:17.315: ERROR/AndroidRuntime(197): at dalvik.system.NativeStart.main(Native Method)
01-19 18:37:17.315: ERROR/AndroidRuntime(197): Caused by: java.lang.ClassNotFoundException: com.Android.fitnessap.TabLayout in loader dalvik.system.PathClassLoader#43b868e0
01-19 18:37:17.315: ERROR/AndroidRuntime(197): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
01-19 18:37:17.315: ERROR/AndroidRuntime(197): at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
01-19 18:37:17.315: ERROR/AndroidRuntime(197): at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
01-19 18:37:17.315: ERROR/AndroidRuntime(197): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
01-19 18:37:17.315: ERROR/AndroidRuntime(197): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2409)
01-19 18:37:17.315: ERROR/AndroidRuntime(197): ... 11 more
01-19 18:37:17.375: ERROR/dalvikvm(197): Unable to open stack trace file '/data/anr/traces.txt': Permission denied
http://developer.android.com/resources/tutorials/views/hello-tabwidget.html
for a template on tabview that will work out of the box. Your manifest seems ok (but I'm not that good at android yet), so I would suggest using logcat to figure out what's up. In Eclipse, Window > Show View > Other.. and Under Android select logcat. Now run your app again and watch the ouptut of logcat for errors. It is a very good way to debug your app, just look for red exceptions and follow the ones related to your source code.

Categories

Resources