Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Null Pointer Exception on running the application #1

Open
adhbheltropy opened this issue Oct 4, 2015 · 3 comments
Open

Null Pointer Exception on running the application #1

adhbheltropy opened this issue Oct 4, 2015 · 3 comments

Comments

@adhbheltropy
Copy link

0-04 20:32:43.007  11731-11731/alicrow.opencvtour E/AndroidRuntime﹕ FATAL EXCEPTION: main
    Process: alicrow.opencvtour, PID: 11731
    java.lang.NullPointerException
            at alicrow.opencvtour.Tour.loadTours(Tour.java:82)
            at alicrow.opencvtour.Tour.getTours(Tour.java:70)
            at alicrow.opencvtour.TourListFragment$1.onManagerConnected(TourListFragment.java:73)
            at org.opencv.android.AsyncServiceHelper$3.onServiceConnected(AsyncServiceHelper.java:319)
            at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java)
            at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java)
            at android.os.Handler.handleCallback(Handler.java)
            at android.os.Handler.dispatchMessage(Handler.java)
            at android.os.Looper.loop(Looper.java)
            at android.app.ActivityThread.main(ActivityThread.java)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:515)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:609)
            at dalvik.system.NativeStart.main(Native Method)
@Alibirb
Copy link
Owner

Alibirb commented Oct 4, 2015

Yay, first bug report!

Thanks for the stack trace. It looks like external storage couldn't be mounted for some reason. The problem is most likely due to your device, not the app itself (but I should add an error screen to handle it).

If you set the logcat log level to "info", you should see a line with the tag "Tour", that says something like "unknown", "removed", "unmounted", "bad_removal", et cetera, which will give an idea of what's wrong.

@adhbheltropy
Copy link
Author

Hey WOA,

Thanks for the quick reply. it says:

10-05 19:19:49.391    6188-6188/? I/Tour﹕ mounted
10-05 19:19:49.391    6188-6188/? W/ContextImpl﹕ Failed to ensure directory: /storage/emulated/0/Android/data/alicrow.opencvtour/files
10-05 19:19:49.391    6188-6188/? W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0x41762d58)

Can you share alicrow.opencvtour/files folder so that i can manually add it to my phone and test it?

@adhbheltropy
Copy link
Author

Fixed it:

public static File getToursDirectory(Context context) {
        Log.i(TAG, Environment.getExternalStorageState());

        if(_tours_directory == null)
            _tours_directory = Environment.getExternalStorageDirectory();

        return _tours_directory;
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants