Peculiar android RuntimeException - android

I just received the wierdest looking stack trace on my Developer Console. What puzzles me is where "MArcos" came from? This was the app: https://play.google.com/store/apps/details?id=genius.mohammad.accelerometer.mouse
Try recreating the exception if you want and explain to me what it is if you can. Thanks!
java.lang.RuntimeException: Unable to start activity ComponentInfo{genius.mohammad.accelerometer.mouse/genius.mohammad.accelerometermouse.MainActivity}: java.lang.NumberFormatException: unable to parse 'MArcos' as integer
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1651)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
at android.app.ActivityThread.access$1500(ActivityThread.java:117)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3687)
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:867)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NumberFormatException: unable to parse 'MArcos' as integer
at java.lang.Integer.parse(Integer.java:383)
at java.lang.Integer.parseInt(Integer.java:372)
at java.lang.Integer.parseInt(Integer.java:332)
at genius.mohammad.accelerometermouse.MainActivity.updatePrefs(MainActivity.java:85)
at genius.mohammad.accelerometermouse.MainActivity.onCreate(MainActivity.java:51)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1615)
... 11 more

Caused by: java.lang.NumberFormatException: unable to parse 'MArcos' as integer
It seems in your code (MainActivity.java: line number 85) you are trying to parse String as Integer.

Related

Firebase Analytics - NPE in CrashReport

I've just migrated to Firebase Analytics 9.0.0 and when tried to launch the app on emulator api10/x86, then the following exception is thrown by the services. Any ideas how to work around that?
05-23 15:36:44.371 1280-1280/? E/AndroidRuntime: FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.szyk.myheart/com.szyk.myheart.MyHeartActivity}: 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.google.android.gms.flags.impl.FlagProviderImpl.getBooleanFlagValue(Unknown Source)
at com.google.android.gms.internal.zzsd$zza.zzb(Unknown Source)
at com.google.android.gms.internal.zzsd$zza.zza(Unknown Source)
at com.google.android.gms.internal.zzsf.zzb(Unknown Source)
at com.google.android.gms.internal.zzsd.get(Unknown Source)
at com.google.firebase.crash.FirebaseCrash.getInstance(Unknown Source)
at com.google.firebase.crash.FirebaseCrash.zzOW(Unknown Source)
at com.google.firebase.crash.FirebaseCrash.log(Unknown Source)
at com.szyk.extras.activities.UniversalActionBarActivity.onCreate(UniversalActionBarActivity.java:46)
at com.szyk.myheart.MyHeartActivity.onCreate(MyHeartActivity.java:99)
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 code is nothing more than activity with:
#Override
protected void onCreate(#Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
FirebaseCrash.log("onCreate: " + getClass().getSimpleName());
}
Unfortunately, using Firebase on devices or emulators without Play Services isn't a supported use case. Crash Reporting will fail to initialize, and you will see a message to that effect in logcat when the app launches. However, if you are also seeing a crash when calling a method after failed init, that seems like a problem we should correct.
It sounds like you are doing the best thing you can by suppressing the exception, but I'd rather not make you go through that, so I'll pass it on as feedback to the team.
Just small correction on what Doug mentioned. Firebase Crash Reporting is not supported on non-play devices. Firebase Analytics in particular and some of the other Firebase product do support non-play devices.

google app invites(beta) not working in android 2.3.6

Google App Invites(Beta) is not working in android 2.3.6 devices.
I tried out in a 4 devices of different versions & it failed only in 2.3.6.
Kindly point me to resources to resolve this error!
Below is the stacktrace
06-16 08:49:13.939 6396-6396/? E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.google.android.gms/com.google.android.gms.appinvite.AppInviteActivity}: java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1651)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
at android.app.ActivityThread.access$1500(ActivityThread.java:117)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3687)
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:867)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at com.google.android.gms.appinvite.ui.widget.g.<init>(SourceFile:167)
at com.google.android.gms.appinvite.ui.widget.s.b(SourceFile:80)
at com.google.android.gms.appinvite.ui.widget.d.a(SourceFile:76)
at com.google.android.gms.appinvite.ui.context.h.a(SourceFile:409)
at android.support.v4.app.Fragment.b(SourceFile:1786)
at android.support.v4.app.s.a(SourceFile:953)
at android.support.v4.app.s.a(SourceFile:1136)
at android.support.v4.app.a.run(SourceFile:739)
at android.support.v4.app.s.h(SourceFile:1499)
at android.support.v4.app.l.onStart(SourceFile:548)
at com.google.android.gms.appinvite.AppInviteActivity.onStart(SourceFile:270)

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

When people download my app from the google play i get this error: java.lang.RuntimeException: Unable to instantiate activity

my name is Walid.
im having this error when people download my app from google play i get this error
i think its when certain devices download the app it causes the app to crash .
this is the sdk in the manifest.
please if anyone knows how to fix this please let me know .
Thank you.
<uses-sdk
android:minSdkVersion="2"
android:targetSdkVersion="17" />
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{tigris.code.oneallah.walid/tigris.code.oneallah.walid.MenuPage}: java.lang.ClassNotFoundException: tigris.code.oneallah.walid.MenuPage in loader dalvik.system.PathClassLoader[/data/app/tigris.code.oneallah.walid-1.apk]
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1573)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
at android.app.ActivityThread.access$1500(ActivityThread.java:117)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3693)
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:907)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:665)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: tigris.code.oneallah.walid.MenuPage in loader dalvik.system.PathClassLoader[/data/app/tigris.code.oneallah.walid-1.apk]
at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1565)
... 11 more
Your APK file does not contain a class named tigris.code.oneallah.walid.MenuPage. Either the APK is missing the class, or ProGuard renamed it.

NullPointerException in com.reg.project

I have no Idea why I get this error :/
Exception class java.lang.NullPointerException
Source method Jax$7.onClick()
java.lang.NullPointerException
at com.reg.lolsoundboard.Jax$7.onClick(Jax.java:83)
at android.view.View.performClick(View.java:2485)
at android.view.View$PerformClick.run(View.java:9089)
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: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)
Obviously you are dereferencing a variable in line 83 of the file Jax.java where the variable is null.
java.lang.NullPointerException
at com.reg.lolsoundboard.Jax$7.onClick(Jax.java:83)
If show the relevant code, people may be able to help you.

Categories

Resources