IllegalArgumentException in LoadedApk.forgetReceiverDispatcher() - android

I have an Android application in android market, I am getting the following error report,
I have used webView, zoom controls, these are all working fine, when ever I test it on OS 2.2,2.3,4.04,4.1,4.2. I don't know when this crash occur, either on zoom control or in loading .apk file from the market.
I am getting these error reports from several users, Please let me know what is this problem and how i can resolve this issue,
Thanks in advance.
java.lang.IllegalArgumentException: Receiver not registered: android.widget.ZoomButtonsController$1#43335900
at android.app.LoadedApk.forgetReceiverDispatcher(LoadedApk.java:628)
at android.app.ContextImpl.unregisterReceiver(ContextImpl.java:1178)
at android.content.ContextWrapper.unregisterReceiver(ContextWrapper.java:361)
at android.widget.ZoomButtonsController.setVisible(ZoomButtonsController.java:405)
at android.widget.ZoomButtonsController$2.handleMessage(ZoomButtonsController.java:179)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4517)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:980)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:747)
at dalvik.system.NativeStart.main(Native Method)

I had the same problem, and successfully used this workaround:
ViewFlipper : Receiver not registered
You should basically create your own ViewFlipper subclass, and override it's onDetachedFromWindow function to stop flipping instead of crushing.
Than use that subclass in your layout.

Related

java.lang.RuntimeException from Adobe AIR app

I have an app on Amazon that sometimes (less than 1% of installations) crashes, which is reflected in Crash Reports. Obviously, I don't have access to the actual devices where the app crashed. Below is one of the crash reports. Can anything be done to identify the cause of the crashes?
java.lang.RuntimeException
at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:2672)
at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:2690)
at android.app.ActivityThread.access$2100(ActivityThread.java:117)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:964)
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:850)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:608)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.IllegalArgumentException
at android.app.Activity.missingDialog(Activity.java:2636)
at android.app.Activity.dismissDialog(Activity.java:2621)
at com.amazon.android.framework.prompt.Prompt.dismissDialog(Unknown Source)
at com.amazon.android.framework.prompt.Prompt.dismiss(Unknown Source)
at com.amazon.android.framework.prompt.PromptManagerImpl.finish(Unknown Source)
at com.amazon.android.framework.prompt.PromptManagerImpl.a(Unknown Source)
at com.amazon.android.framework.prompt.i.a(Unknown Source)
at com.amazon.android.n.e.a(Unknown Source)
at com.amazon.android.n.b.a(Unknown Source)
at com.amazon.android.framework.context.d.a(Unknown Source)
at com.amazon.android.framework.context.d.onDestroy(Unknown Source)
at com.amazon.android.Kiwi.onDestroy(Unknown Source)
at air.com.sierravistasoftware.SightWordsSB1.AppEntry.onDestroy(AppEntry.java)
at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:2659)
... 11 more
You are having problems dismissing a dialog. Maybe the problem comes when the dialog is started, the device orientation is changed and the activity is recreated without the dialog. In this case, if you try to dismiss the dialog, the app will crash.
Try replicating it to see if this is the problem.
You may prefer using DialogFragment to avoid this problem or simply catch the exception and move on, as you got what you were looking for (your dialog dismissed).
UPDATE:
Your error log states that it's trying to dismiss a missing dialog when the activity is being destroyed. It could be an issue in the com.amazon.android.framework source code, and maybe the users get prompted for something before the crash.
You could try to replicate situations when your Activity is destroyed.
Following our chat via the comments, I can't think in anything else without seeing the code, so I encourage you to use a bug tracking system to help you find under what conditions is your app crashing.
Try ACRA:
ACRA is a library enabling Android Application to automatically post their
crash reports to a GoogleDoc form. It is targetted to android
applications developers to help them get data from their applications
when they crash or behave erroneously.

Class extending Application throws ClassNotFoundException

I have a class that extends the application class and sometimes in my developer console I see an error saying ClassNotFoundException
java.lang.RuntimeException: Unable to instantiate application ecm2.android.ActiveStore: java.lang.ClassNotFoundException: ecm2.android.ActiveStore
at android.app.LoadedApk.makeApplication(LoadedApk.java:501)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4221)
at android.app.ActivityThread.access$1400(ActivityThread.java:139)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1284)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4918)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1004)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:771)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: ecm2.android.ActiveStore
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
at android.app.Instrumentation.newApplication(Instrumentation.java:982)
at android.app.LoadedApk.makeApplication(LoadedApk.java:496)
... 11 more
This is how I declare it in my manifest
<application
android:name=".ActiveStore"
android:icon="#drawable/icon"
android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar" >
ActiveStore is just a class that holds an application context to start and cancel alrams so why would I get this error?
Update:
I am still seeing this error from time to time in my developer page even after putting a . infront of the class name. It seems to only happen on an update or new install
Probably because you're missing the dot in front of the class name (which helps to tell Dalvik that your class belongs to the package of your app)
.ActiveStore
But if in doubt, post both the whole Manifest file and your .java
In your manifest you should either have something like:
package="path.to.project.root"
...
<application
android:name=".MyApplication"
or as has been mentioned already
<application
android:name="path.to.project.root.MyApplication"
Also make sure the constructor of your MyApplication class is public.
I'm also seeing this problem a lot and have no explanation.
I've seen people saying that it can happen AFTER a crash. Supposedly, after a crash, the ClassLoader could be in a "bad" state and not be able to load classes.
Basically this would mean that a prior bug is the real source of this problem.
Sorry to be vague, please update if you find a more precise explanation.
If you have code that needs to run on startup (e.g. a BroadcastReceiver on BOOT_COMPLETED or an AppWidget), you can get this if the user has installed your app on an external SD card. At this point the SD card may not have been mounted yet, thus your Application class can't be loaded. You can solve this by setting the installation mode to internalOnly or in the case of the BroadcastReceiver wait for the broadcast of ACTION_MEDIA_MOUNTED. See android intent for sdcard ready
I have experienced this before when I extended or implemented one of the classes/interfaces that was not available in a particular api level.
It doesn't tell this in a proper way.
I have seen this when there are verify errors for a different class the class in question depends on. Scroll back and see if there are any verification errors in the full logcat output.
If ecm2.android.ActiveStore depends on a class that fails verification, then you would get a class not found for ecm2.android.ActiveStore, not for the class ecm2.android.ActiveStore depends on.
Have you tried using the fully qualified package name to reference your class in your manifest?
.ActiveStore
would become
com.myapp.package.ActiveStore
By any chance are you using ProGuard or anything similar to obfuscate your code?

android developer crash report

I have an application on google play.
I made a new version with a higher versioncode and different name.
Tested it on my own android device (v2.3.3) and an emulator (v4.0.3).
No errors so far, so i put the update on the market.
Now the first error reports come in!!!!! (see below)
I dont know what it means.
The new update was a little change in the permissions and i removed two libraries (jumptap SDK and jumptap adapter for admob mediation).
The removed permissions were:
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
Leaving these two for admob ads:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
The error code:
java.lang.RuntimeException: Unable to start activity
ComponentInfo{com.masked.app/com.masked.app.mainjava}:java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2705)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2721)
at android.app.ActivityThread.access$2300(ActivityThread.java:132)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2071)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4669)
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)
Caused by: java.lang.NullPointerException
at com.masked.app.mainjava.onCreate(mainjava.java:53)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2669)
At line 132 there is "adblockcheck();" that can be found here
How to prevent ad blocker from blocking ads on an app ;
line 123 is also within this code.
At line 53 a mediaplayer is started (mp.start();) with a starting sound.
What is the problem exactly, and why don't i get the error on my devices?
This is my first error report through google play, is one error problematic or are there more developers that experience errors and don't always care about them?
Full Mainjava.java can be downloaded here http://homepage.tudelft.nl/78u5u/main.zip
EDIT:
R.raw.start is a mp3 file.
Obviously, your MediaPlayer mp instance is null. It means that MediaPlayer.create method returned null.
As said in android documenation for create method:
Returns
a MediaPlayer object, or null if creation failed
I think, android can't create MediaPlayer for you beacuse of lack required codecs or so on. What is format of your R.raw.start file? You can try to play with formats.
Whatever, you need to gracefuly handle this exception.
Also, as just said before, I advice you to use ACRA. It can help you resolve problems quickly. By my expirence, Android users don't like to send error reports. Less than 10% of errors are reported to the google play.
UPDATE:
ACRA is good enough, but not perfect, because of blocking. It means that if app is just crashed and user have slow internet connection, you can get the ANR message. Let imagine: User thinks that app is just hang, and decided to wait for app response and then gets "Sorry, app crashed" message. You must find the way to send reports via background service or so on before using ACRA.
Also, Google Docs - default backend for sending errors - is awful. It is highly recommended to use another backend. If your app is small enough and you think you will receive less 500 error reports in a month you can try proprietary BugSense, it is supports ACRA.
It's going to be hard to tell what is really going on without seeing (at least) your whole onCreate() method in com.masked.app.mainjava. It sounds like you didn't initialize your media player.
If anyone else is having trouble with crash reports, this is an AMAZING way to get better feedback on Android is this project: http://code.google.com/p/acra/
EDIT:
Your problem is almost certainly caused by the a codec issue (your device cannot play the given resource due to its filetype/format). What type of sound file is it?
You can get around your issue by changing this block:
if (startsoundint == 1){
MediaPlayer mp = MediaPlayer.create(Mainjava.this, R.raw.start);
if (mp != null) // null check
{
mp.start();
}
}
And yes, this means it's probably not a new bug, unless you changed the sound file.

Android error log after app crash

I received >>>THIS<<< error log from a client. I replaced the app name with: APP_NAME. Can you help me determine if it was my app's fault? It seems to me that something went wrong outside my app and caused the error in a service:
06-30 15:54:51.059 W/ActivityManager( 427): Scheduling restart of
crashed service
com..android/.services.periodic.GpsLoggerService
But I'm not sure if it was the real cause of the error message. Was it?
The log was taken and sent by an external tool. Log collector. So it's not just a log from my app, but from whole system.
Looking at the pastebin, I can definitely say for certain is seems your app has b0rk3d up. Look at lines 457-465 which shows the
java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:693)
06-30 15:54:51.049 D/Process (11724): java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:690)
06-30 15:54:51.049 D/Process (11724): dalvik.system.NativeStart.main(Native Method)
Something happened in the thread there, perhaps, mishandling the thread management, also at line 804 your broadcast receiver, perhaps received some intent, which is causing your app to crash as a whole.
I know its not much help but hope it helps you in the right direction.

Widget Exception on Power On

My app has a home screen widget. When I power on the phone (from off, not sleep) I get a fatal exception.
04-06 14:33:59.739: ERROR/AndroidRuntime(271): java.lang.RuntimeException: Unable to instantiate receiver com.mytest.myapp.AppWidget: java.lang.ClassNotFoundException: com.mytest.myapp.AppWidget in loader dalvik.system.PathClassLoader[/data/app/com.mytest.myapp-2.apk]
04-06 14:33:59.832: ERROR/AndroidRuntime(269): Caused by: java.lang.ClassNotFoundException: com.mytest.myapp.AppWidget in loader dalvik.system.PathClassLoader[/data/app/com.mytest.myapp-2.apk]
If I click the app to start it again, it works fine. Any idea on what is happening?
It would be useful to see the Manifest.mf, just in case there's a typo lurking in there.
Failing that, the only explanation that leaps to mind is that the phone is trying to launch the app before /data is mounted. Can you reproduce in the emulator?
Phil Lello

Categories

Resources