2

When my app stats up, i'm getting this error as shows below (not every time, just every now and then). Is there anyone that can tell me where i can search the problem of this error? I don't even know which part of my code is causing the nulpointerexception error.

The app is showing a crash, saying the app stopped, but it's still moving on the the menu..

11-14 15:16:13.972: D/AbsListView(23147): Get MotionRecognitionManager
11-14 15:16:15.424: D/AbsListView(23147): Get MotionRecognitionManager
11-14 15:16:17.566: W/InputEventReceiver(23147): Attempted to finish an input event but the input event receiver has already been disposed.
11-14 15:16:18.597: D/AbsListView(23147): Get MotionRecognitionManager
11-14 15:16:20.148: D/AbsListView(23147): Get MotionRecognitionManager
11-14 15:16:23.041: D/AbsListView(23147): Get MotionRecognitionManager
11-14 15:16:25.684: D/AbsListView(23147): Get MotionRecognitionManager
11-14 15:16:28.156: D/AbsListView(23147): Get MotionRecognitionManager
11-14 15:16:28.877: W/InputEventReceiver(23147): Attempted to finish an input event but the input event receiver has already been disposed.
11-14 15:16:32.430: D/AbsListView(23147): Get MotionRecognitionManager
11-14 15:16:33.622: D/AbsListView(23147): Get MotionRecognitionManager
11-14 15:16:39.848: D/AbsListView(23147): Get MotionRecognitionManager
11-14 15:16:41.259: W/InputEventReceiver(23147): Attempted to finish an input event but the input event receiver has already been disposed.
11-14 15:16:41.639: D/AbsListView(23147): Get MotionRecognitionManager
11-14 15:16:43.651: D/AbsListView(23147): Get MotionRecognitionManager
11-14 15:17:46.014: D/AbsListView(23147): Get MotionRecognitionManager
11-14 15:17:49.617: W/IInputConnectionWrapper(23147): getSelectedText on inactive InputConnection
11-14 15:17:49.617: W/IInputConnectionWrapper(23147): setComposingText on inactive InputConnection
11-14 15:17:49.617: W/IInputConnectionWrapper(23147): getExtractedText on inactive InputConnection
11-14 15:17:51.389: E/SpannableStringBuilder(23147): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
11-14 15:17:51.389: E/SpannableStringBuilder(23147): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
11-14 15:17:54.572: D/AbsListView(23147): Get MotionRecognitionManager
11-14 15:17:55.803: W/IInputConnectionWrapper(23147): getSelectedText on inactive InputConnection
11-14 15:17:55.803: W/IInputConnectionWrapper(23147): setComposingText on inactive InputConnection
11-14 15:17:55.803: W/IInputConnectionWrapper(23147): getExtractedText on inactive InputConnection
11-14 15:17:57.955: E/SpannableStringBuilder(23147): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
11-14 15:17:57.955: E/SpannableStringBuilder(23147): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
11-14 15:17:59.147: D/AbsListView(23147): Get MotionRecognitionManager
11-14 15:18:00.550: D/AbsListView(23147): Get MotionRecognitionManager
11-14 15:18:02.461: D/AbsListView(23147): Get MotionRecognitionManager
11-14 15:18:05.184: D/AbsListView(23147): Get MotionRecognitionManager
11-14 15:18:05.244: W/ResourceType(23147): Failure getting entry for 0x010802c9 (t=7 e=713) in package 0 (error -75)
11-14 15:18:05.444: E/SpannableStringBuilder(23147): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
11-14 15:18:05.444: E/SpannableStringBuilder(23147): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
11-14 15:18:10.479: E/SpannableStringBuilder(23147): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
11-14 15:18:10.479: E/SpannableStringBuilder(23147): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
11-14 15:18:11.540: D/dalvikvm(23147): GC_CONCURRENT freed 1166K, 15% free 14468K/16839K, paused 13ms+13ms, total 58ms
11-14 15:18:11.540: D/AbsListView(23147): [unregisterDoubleTapMotionListener]
11-14 15:18:11.540: I/MotionRecognitionManager(23147):   .unregisterListener : / listener count = 0->0, ubvf 9budiwrd5ordgfl5BakTrklMrfo$,@,)*b:a88
11-14 15:18:11.540: D/AbsListView(23147): [unregisterDoubleTapMotionListener]
11-14 15:18:11.550: I/MotionRecognitionManager(23147):   .unregisterListener : / listener count = 0->0, ubvf 9budiwrd5ordgfl5BakTrklMrfo$,@,)(de.+8
11-14 15:18:11.550: D/AbsListView(23147): [unregisterDoubleTapMotionListener]
11-14 15:18:11.550: I/MotionRecognitionManager(23147):   .unregisterListener : / listener count = 0->0, ubvf 9budiwrd5ordgfl5BakTrklMrfo$,@,)*8fc:(
11-14 15:18:11.550: D/AbsListView(23147): [unregisterDoubleTapMotionListener]
11-14 15:18:11.550: I/MotionRecognitionManager(23147):   .unregisterListener : / listener count = 0->0, ubvf 9budiwrd5ordgfl5BakTrklMrfo$,@,)(**:-8
11-14 15:18:11.560: D/AbsListView(23147): [unregisterDoubleTapMotionListener]
11-14 15:18:11.570: I/MotionRecognitionManager(23147):   .unregisterListener : / listener count = 0->0, ubvf 9budiwrd5ordgfl5BakTrklMrfo$,@,*ec.*8(
11-14 15:18:11.570: D/AbsListView(23147): [unregisterDoubleTapMotionListener]
11-14 15:18:11.570: I/MotionRecognitionManager(23147):   .unregisterListener : / listener count = 0->0, ubvf 9budiwrd5ordgfl5BakTrklMrfo$,@,)(.*:d8
11-14 15:18:11.570: D/AbsListView(23147): [unregisterDoubleTapMotionListener]
11-14 15:18:11.570: I/MotionRecognitionManager(23147):   .unregisterListener : / listener count = 0->0, ubvf 9budiwrd5ordgfl5BakTrklMrfo$,@,)((c*d8
11-14 15:18:11.570: D/AbsListView(23147): [unregisterDoubleTapMotionListener]
11-14 15:18:11.570: I/MotionRecognitionManager(23147):   .unregisterListener : / listener count = 0->0, ubvf 9budiwrd5ordgfl5BakTrklMrfo$,@,)(-be-(
11-14 15:18:11.570: D/AbsListView(23147): [unregisterDoubleTapMotionListener]
11-14 15:18:11.570: I/MotionRecognitionManager(23147):   .unregisterListener : / listener count = 0->0, ubvf 9budiwrd5ordgfl5BakTrklMrfo$,@,)(-a-:8
11-14 15:18:11.580: D/AbsListView(23147): [unregisterDoubleTapMotionListener]
11-14 15:18:11.580: I/MotionRecognitionManager(23147):   .unregisterListener : / listener count = 0->0, ubvf 9budiwrd5ordgfl5BakTrklMrfo$,@,)**ba+(
11-14 15:18:11.580: D/AbsListView(23147): [unregisterDoubleTapMotionListener]
11-14 15:18:11.580: I/MotionRecognitionManager(23147):   .unregisterListener : / listener count = 0->0, ubvf 9budiwrd5ordgfl5BakTrklMrfo$,@,*ed+)f(
11-14 15:18:11.580: D/AbsListView(23147): [unregisterDoubleTapMotionListener]
11-14 15:18:11.580: I/MotionRecognitionManager(23147):   .unregisterListener : / listener count = 0->0, ubvf 9budiwrd5ordgfl5BakTrklMrfo$,@,)(8(+*(
11-14 15:18:11.580: D/AbsListView(23147): [unregisterDoubleTapMotionListener]
11-14 15:18:11.580: I/MotionRecognitionManager(23147):   .unregisterListener : / listener count = 0->0, ubvf 9budiwrd5ordgfl5BakTrklMrfo$,@,)(.b*c8
11-14 15:18:11.590: D/AbsListView(23147): [unregisterDoubleTapMotionListener]
11-14 15:18:11.590: I/MotionRecognitionManager(23147):   .unregisterListener : / listener count = 0->0, ubvf 9budiwrd5ordgfl5BakTrklMrfo$,@,)*./,:(
11-14 15:18:11.590: D/AbsListView(23147): [unregisterDoubleTapMotionListener]
11-14 15:18:11.590: I/MotionRecognitionManager(23147):   .unregisterListener : / listener count = 0->0, ubvf 9budiwrd5ordgfl5BakTrklMrfo$,@,)(b:eb(
11-14 15:18:11.590: D/AbsListView(23147): [unregisterDoubleTapMotionListener]
11-14 15:18:11.590: I/MotionRecognitionManager(23147):   .unregisterListener : / listener count = 0->0, ubvf 9budiwrd5ordgfl5BakTrklMrfo$,@,)(c**b(
11-14 15:18:11.590: D/AbsListView(23147): [unregisterDoubleTapMotionListener]
11-14 15:18:11.590: I/MotionRecognitionManager(23147):   .unregisterListener : / listener count = 0->0, ubvf 9budiwrd5ordgfl5BakTrklMrfo$,@,)(8:a((
11-14 15:18:11.600: D/AbsListView(23147): [unregisterDoubleTapMotionListener]
11-14 15:18:11.600: I/MotionRecognitionManager(23147):   .unregisterListener : / listener count = 0->0, ubvf 9budiwrd5ordgfl5BakTrklMrfo$,@,)(::a.8
11-14 15:18:11.600: D/AbsListView(23147): [unregisterDoubleTapMotionListener]
11-14 15:18:11.600: I/MotionRecognitionManager(23147):   .unregisterListener : / listener count = 0->0, ubvf 9budiwrd5ordgfl5BakTrklMrfo$,@,)(dd,88
11-14 15:18:11.600: D/AbsListView(23147): [unregisterDoubleTapMotionListener]
11-14 15:18:11.600: I/MotionRecognitionManager(23147):   .unregisterListener : / listener count = 0->0, ubvf 9budiwrd5ordgfl5BakTrklMrfo$,@,)*::/a(
11-14 15:18:11.600: D/AbsListView(23147): [unregisterDoubleTapMotionListener]
11-14 15:18:11.610: I/MotionRecognitionManager(23147):   .unregisterListener : / listener count = 0->0, ubvf 9budiwrd5ordgfl5BakTrklMrfo$,@,)*b):8(
11-14 15:18:11.840: E/SpannableStringBuilder(23147): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
11-14 15:18:11.840: E/SpannableStringBuilder(23147): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
11-14 15:18:13.452: W/IInputConnectionWrapper(23147): getSelectedText on inactive InputConnection
11-14 15:18:13.452: W/IInputConnectionWrapper(23147): setComposingText on inactive InputConnection
11-14 15:18:13.452: W/IInputConnectionWrapper(23147): getExtractedText on inactive InputConnection
11-14 15:18:16.695: W/Resources(23147): Converting to string: TypedValue{t=0x12/d=0x0 a=3 r=0x7f090042}
11-14 15:18:17.005: I/dalvikvm(23147): Jit: resizing JitTable from 4096 to 8192
11-14 15:18:17.065: W/IInputConnectionWrapper(23147): getSelectedText on inactive InputConnection
11-14 15:18:17.206: W/IInputConnectionWrapper(23147): setComposingText on inactive InputConnection
11-14 15:18:17.206: W/IInputConnectionWrapper(23147): getExtractedText on inactive InputConnection
11-14 15:19:26.785: E/SpannableStringBuilder(23147): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
11-14 15:19:26.785: E/SpannableStringBuilder(23147): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
11-14 15:21:28.947: E/AndroidRuntime(16132): FATAL EXCEPTION: main
11-14 15:21:28.947: E/AndroidRuntime(16132): java.lang.RuntimeException: Unable to instantiate application android.app.Application: java.lang.NullPointerException
11-14 15:21:28.947: E/AndroidRuntime(16132):    at android.app.LoadedApk.makeApplication(LoadedApk.java:501)
11-14 15:21:28.947: E/AndroidRuntime(16132):    at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4170)
11-14 15:21:28.947: E/AndroidRuntime(16132):    at android.app.ActivityThread.access$1400(ActivityThread.java:134)
11-14 15:21:28.947: E/AndroidRuntime(16132):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
11-14 15:21:28.947: E/AndroidRuntime(16132):    at android.os.Handler.dispatchMessage(Handler.java:99)
11-14 15:21:28.947: E/AndroidRuntime(16132):    at android.os.Looper.loop(Looper.java:137)
11-14 15:21:28.947: E/AndroidRuntime(16132):    at android.app.ActivityThread.main(ActivityThread.java:4867)
11-14 15:21:28.947: E/AndroidRuntime(16132):    at java.lang.reflect.Method.invokeNative(Native Method)
11-14 15:21:28.947: E/AndroidRuntime(16132):    at java.lang.reflect.Method.invoke(Method.java:511)
11-14 15:21:28.947: E/AndroidRuntime(16132):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1007)
11-14 15:21:28.947: E/AndroidRuntime(16132):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:774)
11-14 15:21:28.947: E/AndroidRuntime(16132):    at dalvik.system.NativeStart.main(Native Method)
11-14 15:21:28.947: E/AndroidRuntime(16132): Caused by: java.lang.NullPointerException
11-14 15:21:28.947: E/AndroidRuntime(16132):    at android.app.LoadedApk.initializeJavaContextClassLoader(LoadedApk.java:377)
11-14 15:21:28.947: E/AndroidRuntime(16132):    at android.app.LoadedApk.getClassLoader(LoadedApk.java:320)
11-14 15:21:28.947: E/AndroidRuntime(16132):    at android.app.LoadedApk.makeApplication(LoadedApk.java:493)

This is the AndroidManifest.xml:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.emmtec"
android:versionCode="1"
android:versionName="1.0" xmlns:tools="http://schemas.android.com/tools">

<uses-sdk
    android:minSdkVersion="14"
    android:targetSdkVersion="16" 
    tools:ignore="OldTargetApi"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name="com.example.emmtec.IntroScreen"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

    <activity
        android:name="com.example.emmtec.MenuScreen"
        android:label="@string/title_activity_menu_screen"
        android:screenOrientation="portrait" 
        android:configChanges="orientation|keyboardHidden"
        >
    </activity>
    <activity
        android:name="com.example.emmtec.FirstScreen"
        android:label="@string/title_activity_first_screen"  
        android:windowSoftInputMode="adjustResize|stateHidden"
        android:screenOrientation="portrait" 
        android:configChanges="orientation|keyboardHidden">
    </activity>
    <activity
        android:name="com.example.emmtec.SecondScreen"
        android:label="@string/title_activity_second_screen"
        android:screenOrientation="portrait" 
        android:configChanges="orientation|keyboardHidden"
        android:windowSoftInputMode="stateHidden">
    </activity>
    <activity
        android:name="com.example.emmtec.FinalScreen"
        android:label="@string/title_activity_final_screen"
        android:screenOrientation="portrait" 
        android:configChanges="orientation|keyboardHidden"
        android:windowSoftInputMode="stateHidden">
    </activity>
    <activity
        android:name="com.example.emmtec.ThirdScreen"
        android:label="@string/title_activity_third_screen"
        android:screenOrientation="portrait" 
        android:configChanges="orientation|keyboardHidden">
    </activity>
    <activity
        android:name="com.example.emmtec.CaptureSignature"
        android:label="@string/title_activity_capture_signature" >
    </activity>

</application>

The order of appearing should be: IntroScreen (splashscreen for 3 sec) - MenuScreen with options to go to other screens.

Introscreen.java:

public class IntroScreen extends Activity {

private final int SPLASH_DISPLAY_LENGHT = 3000; 
public final static String EXTRA_MESSAGE = "com.example.emmtec.MESSAGE";

@Override
public void onCreate(Bundle icicle) {
    super.onCreate(icicle);
    setContentView(R.layout.activity_intro_screen);


    new Handler().postDelayed(new Runnable(){
        @Override 
        public void run() {
            Intent mainIntent = new Intent(IntroScreen.this,MenuScreen.class);
            mainIntent.putExtra(EXTRA_MESSAGE, "begin");
            IntroScreen.this.startActivity(mainIntent); //start menu scherm
            IntroScreen.this.finish(); //stop intro scherm
        }
    }, SPLASH_DISPLAY_LENGHT); //na 3000 ms.
}
}

Thanks in advance

GeertG
  • 158
  • 2
  • 12
  • Are there any more `Caused by:`'s? – PurkkaKoodari Nov 14 '13 at 14:28
  • I'll post everything that happens before the error. @barwnikk the code is 8000 lines, I dont know what part to post.. You want to see the splashscreen or menuscreen maybe? – GeertG Nov 14 '13 at 14:33
  • Wow. this is one file? I don't recommend to use all in one file 8000 lines. – barwnikk Nov 14 '13 at 14:34
  • haha no ;), i got about 25 classes, but i dont know where to seach the error. – GeertG Nov 14 '13 at 14:36
  • I forgot to tell in first question: The app shows a crash message, but it is still moving on and the rest of the app is working fine – GeertG Nov 14 '13 at 14:37
  • Your problem could be related to your Manifest... what did you set for the application name? Ex. did you specify a custom class? That class is in the correct package? Please post your Manifest. – fasteque Nov 14 '13 at 14:37
  • I suspect Eclipse plugin causes this ... Just tap CTRL+F11 and move along, next time it might not crash – gunar Nov 14 '13 at 14:38
  • @fasteque editted the post, now with manifest. – GeertG Nov 14 '13 at 14:41
  • I've been getting the same error for awhile now but no luck on a solution. Anyway, [here is a similar post](http://stackoverflow.com/questions/9039017/android-app-application-cannot-be-instantiated-due-to-nullpointerexception) hasn't helped me yet but maybe you can find a similarity in yours – codeMagic Nov 14 '13 at 14:41
  • @codeMagic Yeah, I've seen that post too, it's kinda telling us that it's only happening when developing with Eclipse, and never for normal users.. Still i hoped someone really found an awnser to the problem;) – GeertG Nov 14 '13 at 14:43
  • Yeah, I agree, I would like to know exactly what the issue is also. [I had also found this one](http://stackoverflow.com/questions/10150899/runtimeexception-unable-to-instantiate-application), I don't know if you've seen it but explains a little more (not much) but I so far have found the same thing that it only happens on devices 4.0 and newer. – codeMagic Nov 14 '13 at 14:45
  • could you please post at least the onCreate method for com.example.emmtec.IntroScreen activity? Thanks. – fasteque Nov 14 '13 at 14:48
  • http://stackoverflow.com/questions/10399789/java-lang-runtimeexception-unable-to-instantiate-application-android-app-applic – jpm Nov 14 '13 at 15:00
  • are you extending an `Application` class – SathMK Nov 14 '13 at 15:08
  • @SathMK no.. only Activity class, should I? – GeertG Nov 14 '13 at 15:09
  • is the app is working after the splash screen ?? – SathMK Nov 14 '13 at 15:14
  • @SathMK Yes, for the rest everything is working fine, it just shows that error message (app.... has stopped) once, but it doesn't actually stop, just moves on and works fine. – GeertG Nov 14 '13 at 15:17

1 Answers1

0

You can find the problem in:

11-14 15:21:28.947: E/AndroidRuntime(16132): Caused by: java.lang.NullPointerException
11-14 15:21:28.947: E/AndroidRuntime(16132):    at android.app.LoadedApk.initializeJavaContextClassLoader(LoadedApk.java:377)
11-14 15:21:28.947: E/AndroidRuntime(16132):    at android.app.LoadedApk.getClassLoader(LoadedApk.java:320)
11-14 15:21:28.947: E/AndroidRuntime(16132):    at android.app.LoadedApk.makeApplication(LoadedApk.java:493)

Maybe the parameter to initialize the Handler

Benjamin RD
  • 11,516
  • 14
  • 87
  • 157