hauke96 / GeoNotes

A simple app to create georeferences notes.
GNU General Public License v3.0
58 stars 10 forks source link

GeoNotes crash on start #94

Closed opk12 closed 1 year ago

opk12 commented 1 year ago

Launch version 1.5.1, it crashes without showing itself. Version 1.4.5 did not crash. I am using the F-droid version on Android 7.1.

FATAL EXCEPTION: main
Process: de.hauke_stieler.geonotes, PID: 27884
java.lang.RuntimeException: Unable to start activity ComponentInfo{de.hauke_stieler.geonotes/de.hauke_stieler.geonotes.MainActivity}: android.database.sqlite.SQLiteCantOpenDatabaseException: unable to open database file (code 2062)
#################################################################
Error Code : 2062 (SQLITE_CANTOPEN_EMFILE)
Caused By : Application has opened two many files. Maximum of available file descriptors in one process is 1024 in default.
        (unable to open database file (code 2062))
#################################################################
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3003)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3064)
        at android.app.ActivityThread.-wrap14(ActivityThread.java)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1659)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at android.os.Looper.loop(Looper.java:154)
        at android.app.ActivityThread.main(ActivityThread.java:6816)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1563)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1451)
Caused by: android.database.sqlite.SQLiteCantOpenDatabaseException: unable to open database file (code 2062)
#################################################################
Error Code : 2062 (SQLITE_CANTOPEN_EMFILE)
Caused By : Application has opened two many files. Maximum of available file descriptors in one process is 1024 in default.
        (unable to open database file (code 2062))
#################################################################
        at android.database.sqlite.SQLiteConnection.nativeExecuteForCursorWindow(Native Method)
        at android.database.sqlite.SQLiteConnection.executeForCursorWindow(SQLiteConnection.java:995)
        at android.database.sqlite.SQLiteSession.executeForCursorWindow(SQLiteSession.java:836)
        at android.database.sqlite.SQLiteQuery.fillWindow(SQLiteQuery.java:62)
        at android.database.sqlite.SQLiteCursor.fillWindow(SQLiteCursor.java:143)
        at android.database.sqlite.SQLiteCursor.getCount(SQLiteCursor.java:132)
        at android.database.AbstractCursor.moveToPosition(AbstractCursor.java:219)
        at android.database.AbstractCursor.moveToFirst(AbstractCursor.java:258)
        at de.hauke_stieler.geonotes.photo.PhotoStore.getPhotos(PhotoStore.java:45)
        at de.hauke_stieler.geonotes.database.Database.getPhotos(Database.java:96)
        at de.hauke_stieler.geonotes.database.Database.hasPhotos(Database.java:104)
        at de.hauke_stieler.geonotes.map.Map.setIcon(Map.java:407)
        at de.hauke_stieler.geonotes.map.Map.createMarker(Map.java:438)
        at de.hauke_stieler.geonotes.map.Map.reloadAllNotes(Map.java:131)
        at de.hauke_stieler.geonotes.map.Map.<init>(Map.java:116)
        at de.hauke_stieler.geonotes.Injector.buildMap(Injector.java:87)
        at de.hauke_stieler.geonotes.Injector.lambda$static$5(Injector.java:39)
        at de.hauke_stieler.geonotes.-$$Lambda$Injector$N9v5aWOcswm1T9A3ZMrmISx8E5U.build(lambda)
        at de.hauke_stieler.geonotes.Injector.get(Injector.java:55)
        at de.hauke_stieler.geonotes.MainActivity.createMap(MainActivity.java:112)
        at de.hauke_stieler.geonotes.MainActivity.onCreate(MainActivity.java:97)
        at android.app.Activity.performCreate(Activity.java:6977)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1126)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2946)
        ... 9 more
hauke96 commented 1 year ago

Hi, thanks for the bug report and strack traces. I'm aware of this (I experience this bug myself) and thought I fixed it with 1.5.1 but apparently I missed something. I'm currently on vacation but I'll work on this when I'm back and find the time for it.

hauke96 commented 1 year ago

I took a look into this and unfortunately I'm not able to reproduce your exact behavior with that stack trace. Personally I had a different issue that I fixed. Maybe that helps you as well. The next version 1.5.2 will (hopefully) come soon.

Have you tried to clear the apps cache/storage or move it between internal and external storage?

opk12 commented 1 year ago

Clearing the app data in the settings solved it. I have a temporary backup of the private app directory, let me know if you need it