Thread runtime exception - android

synchronized (this.childrenGroupsLock) {
for (int i = 0; i < numGroups; i++) {
suspendCurrent |= this.childrenGroups[i].suspendHelper();
}
}
return suspendCurrent;
This is the thread that force closes my application(any android application). I dunno how to handle it.
Can anyone please help me?
The application just force closes after it reaches this point.
05-12 10:22:28.582: ERROR/AndroidRuntime(352): FATAL EXCEPTION: main
05-12 10:22:28.582: ERROR/AndroidRuntime(352): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.android/com.android.GraphicsActivity}: java.lang.IllegalAccessException: access to class not allowed
05-12 10:22:28.582: ERROR/AndroidRuntime(352): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1544)
05-12 10:22:28.582: ERROR/AndroidRuntime(352): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1638)
05-12 10:22:28.582: ERROR/AndroidRuntime(352): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
05-12 10:22:28.582: ERROR/AndroidRuntime(352): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:928)
05-12 10:22:28.582: ERROR/AndroidRuntime(352): at android.os.Handler.dispatchMessage(Handler.java:99)
05-12 10:22:28.582: ERROR/AndroidRuntime(352): at android.os.Looper.loop(Looper.java:123)
05-12 10:22:28.582: ERROR/AndroidRuntime(352): at android.app.ActivityThread.main(ActivityThread.java:3647)
05-12 10:22:28.582: ERROR/AndroidRuntime(352): at java.lang.reflect.Method.invokeNative(Native Method)
05-12 10:22:28.582: ERROR/AndroidRuntime(352): at java.lang.reflect.Method.invoke(Method.java:507)
05-12 10:22:28.582: ERROR/AndroidRuntime(352): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
05-12 10:22:28.582: ERROR/AndroidRuntime(352): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
05-12 10:22:28.582: ERROR/AndroidRuntime(352): at dalvik.system.NativeStart.main(Native Method)
05-12 10:22:28.582: ERROR/AndroidRuntime(352): Caused by: java.lang.IllegalAccessException: access to class not allowed
05-12 10:22:28.582: ERROR/AndroidRuntime(352): at java.lang.Class.newInstanceImpl(Native Method)
05-12 10:22:28.582: ERROR/AndroidRuntime(352): at java.lang.Class.newInstance(Class.java:1409)
05-12 10:22:28.582: ERROR/AndroidRuntime(352): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
05-12 10:22:28.582: ERROR/AndroidRuntime(352): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1536)
This is the error I am getting in the LogCat

Related

App crashes when instantiating HelpStackSDK

We tried integrating HelpStack by following steps given on GitHub, but we kept getting the following errors:
04-03 13:54:22.054 4638-4638/com.playerline.android E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.playerline.android/com.tenmiles.helpstack.activities.HomeActivity}: java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1967)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1992)
at android.app.ActivityThread.access$600(ActivityThread.java:127)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1158)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4448)
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:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at com.tenmiles.helpstack.activities.HSActivityParent.onCreate(HSActivityParent.java:48)
at com.tenmiles.helpstack.activities.HomeActivity.onCreate(HomeActivity.java:46)
at android.app.Activity.performCreate(Activity.java:4465)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1931)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1992)
at android.app.ActivityThread.access$600(ActivityThread.java:127)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1158)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4448)
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:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)
I'm guessing it has something to do with the App Theme, which in our case is is Theme.AppCompat.NoActionBar.

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

Unable to start activity NullPointerException-onActivityCreated

My App crash rarely
i want to get off this bug for ever.
this is the log that users Report
i tried so long on this but nothing helps
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.xxx.xxx/com.xxx.xxx.Master_}: java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2072)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2097)
at android.app.ActivityThread.access$600(ActivityThread.java:136)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1207)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4787)
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:789)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:556)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at com.xxx.xxx.HomeFragment.onActivityCreated(HomeFragment.java:140)
at android.support.v4.app.Fragment.performActivityCreated(Fragment.java:1508)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:958)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1115)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1097)
at android.support.v4.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManager.java:1895)
at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:566)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1163)
at android.app.Activity.performStart(Activity.java:5018)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2045)
... 11 more

findViewById on an ImageView why does setBackgroundColor give NullPointerException

I have a very basic activity with an ImageView of android:id="#+id/imageViewTest"
and then in the OnCreate method calling:
ImageView imageView = (ImageView)findViewById(R.id.imageViewTest);
// Set the background color to white
imageView.setBackgroundColor(Color.WHITE);
this gives error:
10-15 16:36:27.552 29097-29097/org.explore.self.beginner D/dalvikvm﹕ Late-enabling CheckJNI
10-15 16:36:28.017 29097-29097/org.explore.self.beginner D/AndroidRuntime﹕ Shutting down VM
10-15 16:36:28.017 29097-29097/org.explore.self.beginner W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0x41d9b2a0)
10-15 16:36:28.042 29097-29097/org.explore.self.beginner E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to start activity ComponentInfo{org.explore.self.beginner/org.selfexplore.android.view.activity.TestActivity}: java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2110)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2135)
at android.app.ActivityThread.access$700(ActivityThread.java:140)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1237)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4921)
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:1038)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:805)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at org.selfexplore.android.view.activity.TestActivity.onCreate(TestActivity.java:37)
at android.app.Activity.performCreate(Activity.java:5188)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2074)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2135)
            at android.app.ActivityThread.access$700(ActivityThread.java:140)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1237)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:137)
            at android.app.ActivityThread.main(ActivityThread.java:4921)
            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:1038)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:805)
            at dalvik.system.NativeStart.main(Native Method)
10-15 16:36:28.062 29097-29097/org.explore.self.beginner I/Process﹕ Sending signal. PID: 29097 SIG: 9
But when I do a
ImageView imageView = new ImageView(this);
it works fine, Why?
PS: I am not able to add the layout code here, so sharing it in this doc: https://docs.google.com/document/d/1fbi3B_hAYUh_C2IwPfInvZ-BG2bgsa4pZoJKj8NBT9o/edit?usp=sharing
Your layout you've set with setContentView() doesn't have a view with id imageViewTest and findViewById() returns null, or you haven't called setContentView() at all.

the application myapp(process com.example.package) has stopped unexpectedly please try again

I had so many troubles with my android app. it can't run but now I could make it, unfortunately, I receive the error" the application myapp(process com.example.package) has stopped unexpectedly please try again)
here is my log file
12-02 11:25:11.980: E/MediaPlayer(278): Unable to to create media player
12-02 11:25:12.290: D/MediaPlayer(278): create failed:
12-02 11:25:12.290: D/MediaPlayer(278): java.io.IOException: setDataSourceFD failed.: status=0x80000000
12-02 11:25:12.290: D/MediaPlayer(278): at android.media.MediaPlayer.setDataSource(Native Method)
12-02 11:25:12.290: D/MediaPlayer(278): at android.media.MediaPlayer.create(MediaPlayer.java:645)
12-02 11:25:12.290: D/MediaPlayer(278): at com.mohammed.watzIslam.Mymain.onCreate(Mymain.java:27)
12-02 11:25:12.290: D/MediaPlayer(278): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
12-02 11:25:12.290: D/MediaPlayer(278): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
12-02 11:25:12.290: D/MediaPlayer(278): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
12-02 11:25:12.290: D/MediaPlayer(278): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
12-02 11:25:12.290: D/MediaPlayer(278): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
12-02 11:25:12.290: D/MediaPlayer(278): at android.os.Handler.dispatchMessage(Handler.java:99)
12-02 11:25:12.290: D/MediaPlayer(278): at android.os.Looper.loop(Looper.java:123)
12-02 11:25:12.290: D/MediaPlayer(278): at android.app.ActivityThread.main(ActivityThread.java:4627)
12-02 11:25:12.290: D/MediaPlayer(278): at java.lang.reflect.Method.invokeNative(Native Method)
12-02 11:25:12.290: D/MediaPlayer(278): at java.lang.reflect.Method.invoke(Method.java:521)
12-02 11:25:12.290: D/MediaPlayer(278): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
12-02 11:25:12.290: D/MediaPlayer(278): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
12-02 11:25:12.290: D/MediaPlayer(278): at dalvik.system.NativeStart.main(Native Method)
12-02 11:25:12.290: D/AndroidRuntime(278): Shutting down VM
12-02 11:25:12.290: W/dalvikvm(278): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
12-02 11:25:12.300: E/AndroidRuntime(278): FATAL EXCEPTION: main
12-02 11:25:12.300: E/AndroidRuntime(278): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mohammed.watzIslam/com.mohammed.watzIslam.Mymain}: java.lang.NullPointerException
12-02 11:25:12.300: E/AndroidRuntime(278): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
12-02 11:25:12.300: E/AndroidRuntime(278): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
12-02 11:25:12.300: E/AndroidRuntime(278): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
12-02 11:25:12.300: E/AndroidRuntime(278): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
12-02 11:25:12.300: E/AndroidRuntime(278): at android.os.Handler.dispatchMessage(Handler.java:99)
12-02 11:25:12.300: E/AndroidRuntime(278): at android.os.Looper.loop(Looper.java:123)
12-02 11:25:12.300: E/AndroidRuntime(278): at android.app.ActivityThread.main(ActivityThread.java:4627)
12-02 11:25:12.300: E/AndroidRuntime(278): at java.lang.reflect.Method.invokeNative(Native Method)
12-02 11:25:12.300: E/AndroidRuntime(278): at java.lang.reflect.Method.invoke(Method.java:521)
12-02 11:25:12.300: E/AndroidRuntime(278): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
12-02 11:25:12.300: E/AndroidRuntime(278): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
12-02 11:25:12.300: E/AndroidRuntime(278): at dalvik.system.NativeStart.main(Native Method)
12-02 11:25:12.300: E/AndroidRuntime(278): Caused by: java.lang.NullPointerException
12-02 11:25:12.300: E/AndroidRuntime(278): at com.mohammed.watzIslam.Mymain.onCreate(Mymain.java:28)
12-02 11:25:12.300: E/AndroidRuntime(278): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
12-02 11:25:12.300: E/AndroidRuntime(278): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
12-02 11:25:12.300: E/AndroidRuntime(278): ... 11 more
12-02 11:25:11.980: E/MediaPlayer(278): Unable to to create media player
12-02 11:25:12.290: D/MediaPlayer(278): create failed:
12-02 11:25:12.290: D/MediaPlayer(278): java.io.IOException: setDataSourceFD failed.: status=0x80000000
12-02 11:25:12.290: D/MediaPlayer(278): at android.media.MediaPlayer.setDataSource(Native Method)
My guess is that you're trying to load a media file that's not there, or the file name is just incorrect.

Categories

Resources