Android intermittent class not found run time exception - android

One or two of my users experience the above class not found run time exception when trying to run my app.
How can that happen and how can I fix it? Is it a bad install?
Thanks
Paul
Stack trace received through Android Publishers site. I cannot replicate this myself.
(com.android.app.app.app) is the name of the app/activity as defined in the manifest.
java.lang.RuntimeException: Unable to
instantiate activity
ComponentInfo{my,app.app.app/com.android.app.app.app}:
java.lang.ClassNotFoundException:
com.android.app.app.app in loader
dalvik.system.PathClassLoader[/mnt/asec/my,app.app.app-1/pkg.apk]
at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2659)
at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2753)
at
android.app.ActivityThread.access$2500(ActivityThread.java:129)
at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:2107)
at
android.os.Handler.dispatchMessage(Handler.java:99)
at
android.os.Looper.loop(Looper.java:143)
at
android.app.ActivityThread.main(ActivityThread.java:4701)
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:868)
at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
at
dalvik.system.NativeStart.main(Native
Method) Caused by:
java.lang.ClassNotFoundException:
com.android.app.app.app in loader
dalvik.system.PathClassLoader[/mnt/asec/my,app.app.app-1/pkg.apk]
at
dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
at
java.lang.ClassLoader.loadClass(ClassLoader.java:573)
at
java.lang.ClassLoader.loadClass(ClassLoader.java:532)
at
android.app.Instrumentation.newActivity(Instrumentation.java:1021)
at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2651)
... 11 more

I'd check to see if these users are installing the app on an SD card: if the app is installed the app icon might be visible in the application list (since that is stored on-device) but if the SD card is unavailable (removed or maybe mounted for reading by a PC over USB) when the user taps the application icon the attempts to load will fail. You will notice:
ComponentInfo{my,app.app.app/com.android.app.app.app}: java.lang.ClassNotFoundException: com.android.app.app.app in loader dalvik.system.PathClassLoader[/mnt/asec/my,app.app.app-1/pkg.apk] at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2659) at
in your stack trace above: is /mnt/asec the SD card storage path on the device?

Related

AnalyticsService: java.lang.SecurityException: attempting to read gservices without permission

I've spent the entire day attempting to fix this, please find the stack trace below, coming from the Google Play Services lib. I changed nothing, i rebuilt the app today and ever since have been given this error. I've tried upgrading GPS to the latest version, rebuilding GPS, downgrading GPS to a previous version, removing various other libraries, explicitly adding the permission it requests and other such niceties... but NOTHING.
if ANYONE can please lend some advice i'd be forever grateful.
java.lang.RuntimeException: Unable to instantiate service
com.google.android.gms.analytics.service.AnalyticsService: java.lang.SecurityException: attempting to
read gservices without permission: Neither user 10064 nor current process has
com.google.android.providers.gsf.permission.READ_GSERVICES. at
android.app.ActivityThread.handleCreateService(ActivityThread.java:1929) at
android.app.ActivityThread.access$2500(ActivityThread.java:117) at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:985) 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:895) at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:653) at dalvik.system.NativeStart.main(Native
Method) Caused by: java.lang.SecurityException: attempting to read gservices without permission:
Neither user 10064 nor current process has
com.google.android.providers.gsf.permission.READ_GSERVICES. at
android.app.ContextImpl.enforce(ContextImpl.java:1289) at
android.app.ContextImpl.enforceCallingOrSelfPermission(ContextImpl.java:1318) at
android.content.ContextWrapper.enforceCallingOrSelfPermission(ContextWrapper.java:395) at
imq.c(SourceFile:107) at imq.a(SourceFile:121) at blw.a(SourceFile:276) at blu.b(SourceFile:203) at
blo.c(SourceFile:135) at com.google.android.gms.analytics.service.AnalyticsService.<init
(SourceFile:53) at java.lang.Class.newInstanceImpl(Native Method) at
java.lang.Class.newInstance(Class.java:1409) at
android.app.ActivityThread.handleCreateService(ActivityThread.java:1926) ... 10 more

Classnotfound exception for working app

I have a strange issue.I developed an android application with scan functionality.I reused some zxing code code for the scanning section. My app is working fine for all the device and emulater too.But after I uploaded it in market I am getting error on scan portion.My error report is
java.lang.IllegalStateException: Could not execute method of the activity
at android.view.View$1.onClick(View.java:2191)
at android.view.View.performClick(View.java:2532)
at android.view.View$PerformClick.run(View.java:9291)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:150)
at android.app.ActivityThread.main(ActivityThread.java:4293)
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:849)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:607)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at android.view.View$1.onClick(View.java:2186)
... 11 more
Caused by: java.lang.ExceptionInInitializerError
at com.imotiva.Menu1.points(Menu1.java:46)
... 14 more
Caused by: java.lang.NoClassDefFoundError: com.qr.decoding.ResultMetadataType
at com.qr.scanning.CaptureActivity.<clinit>(CaptureActivity.java:92)
... 15 more
Still my code code is working in device but the same app in the market don't. Please help me friends...
At last I found the solution for my problem.gtumca-MAC's solution Android update 17 seems incompatible with external Jars worked for me.Created one folder named libs and add my core.jar .Now it's working fine.Thanks all.

Android - Force close when no sd card is present

So I have an application which stores files in directories that I create when the user gets within a certain distance of a geographic location. Everything works fine except for when certain devices that usually use an sd card have it removed and then the app crashes when a user logs in. I tried on a droid x and I was able to replicate the crash. When I have the sd card in it works fine but when the sd card is removed I get a nullpointer exception and force close.
Heres the log dump from the market:
java.lang.RuntimeException: Unable to resume activity {graffit.cores/graffit.cores.GraffView}: java.lang.NullPointerException
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2208)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2228)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1721)
at android.app.ActivityThread.access$1500(ActivityThread.java:124)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:968)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3806)
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 graffit.cores.GraffView.onResume(GraffView.java:1201)
at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1150)
at android.app.Activity.performResume(Activity.java:3882)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2191)
... 12 more
java.lang.NullPointerException
at graffit.cores.GraffView.onResume(GraffView.java:1201)
at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1150)
at android.app.Activity.performResume(Activity.java:3882)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2191)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2228)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1721)
at android.app.ActivityThread.access$1500(ActivityThread.java:124)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:968)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3806)
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)
Being that the logdump says something about failing on instrumentation Im guessing that I should catch that or look for if an sd card is available.
Im sure I can find out how to look for an sd card but how can I catch this crash and use internal storage in place of a missing sd card.
Any help would be much appreciated.
Before you do any work with the external storage, you should always call getExternalStorageState() to check whether the media is available. The media might not always be available, such as in your case. The Android Docs give an example on how to deal with this: http://developer.android.com/guide/topics/data/data-storage.html#filesExternal
The best thing to do is probably do this check in a function that returns a Boolean value on whether you can get to the external storage and then check it each time you need to get data from the card.
if (sdCardAvalableForRead())
{
// get file.
}
else
{
// show warning or message to user.
}

Got a stacktrace from Android Market that mentions a competitor's app

Does anyone know what this could possibly mean? Apparently someone else's app caused mine to crash? And it happens to be an app that directly competes with mine:
java.lang.RuntimeException: Unable to create BackupAgent com.MY_COMPEITOR'S_APP.backup.BackupAgent: java.lang.NullPointerException
at android.app.ActivityThread.handleCreateBackupAgent(ActivityThread.java:2905)
at android.app.ActivityThread.access$4000(ActivityThread.java:125)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2128)
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 android.app.ActivityThread$PackageInfo.initializeJavaContextClassLoader(ActivityThread.java:529)
at android.app.ActivityThread$PackageInfo.getClassLoader(ActivityThread.java:474)
at android.app.ActivityThread.handleCreateBackupAgent(ActivityThread.java:2873)
... 10 more
TenFour I would bet since you are talking about a competing App that there must be some INtent Handling going on that led to this. Maybe the Competitor app was actually trying to do something at the same time your app was trying to do something and they clashed. Without knowing more it's hard to provide a more detailed answer

Android force-close on Google maps: java.lang.NoSuchFieldException: loading_tile_android

One of my Android users is getting a force-close when launching Google Map (MapActivity class) inside my application. He gets a MissingResourceException. He's the only one complaining so far, and he is using Vanilla Tazz phone. The Google maps application itself works well on his device. It looks like it's something specific to Vanilla Tazz. I tried to find a fix online but have not been successful. Here's the Android error log:
java.lang.ExceptionInInitializerError
at ...
at android.view.View.performClick(View.java:2449)
at android.view.View$PerformClick.run(View.java:9027)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
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:868)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ExceptionInInitializerError
at com.google.android.maps.MapActivity.<clinit>(MapActivity.java:295)
... 14 more
Caused by: java.util.MissingResourceException: Could not find required resource
com.android.internal.R$drawable.loading_tile_android (java.lang.NoSuchFieldException: loading_tile_android)
at com.google.android.maps.InternalR.getField(InternalR.java:65)
at com.google.android.maps.InternalR.get(InternalR.java:39)
at com.google.android.maps.InternalR.access$000(InternalR.java:28)
at com.google.android.maps.InternalR$drawable.get(InternalR.java:112)
at com.google.android.maps.InternalR$drawable.<clinit>(InternalR.java:119)
... 15 more
I would appreciate if anyone can suggest anything to fix this.
Not sure you'll find a fix for this: it sounds like the ROM was built without that resource as part of the OS image. They'll probably need a new ROM to get around that.

Categories

Resources