ngageoint / geopackage-mapcache-android

GeoPackage MapCache Android App
https://ngageoint.github.io/geopackage-mapcache-android
MIT License
40 stars 16 forks source link

MapCache crashes #40

Closed securedimensions closed 2 years ago

securedimensions commented 3 years ago

Version Information:

Expected Results:

Observed Results:

Output:


E/AndroidRuntime: FATAL EXCEPTION: main
    Process: mil.nga.mapcache.test, PID: 26768
    java.lang.RuntimeException: Unable to start activity ComponentInfo{mil.nga.mapcache.test/mil.nga.mapcache.view.map.feature.FeatureViewActivity}: java.lang.IllegalStateException: attempt to re-open an already-closed object: SQLiteDatabase: /data/user/0/mil.nga.mapcache.test/databases/example
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
        at android.app.ActivityThread.-wrap11(ActivityThread.java)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at android.os.Looper.loop(Looper.java:148)
        at android.app.ActivityThread.main(ActivityThread.java:5417)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
     Caused by: java.lang.IllegalStateException: attempt to re-open an already-closed object: SQLiteDatabase: /data/user/0/mil.nga.mapcache.test/databases/example
        at android.database.sqlite.SQLiteClosable.acquireReference(SQLiteClosable.java:55)
        at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1312)
        at android.database.sqlite.SQLiteDatabase.rawQuery(SQLiteDatabase.java:1255)
        at com.j256.ormlite.android.compat.JellyBeanApiCompatibility.rawQuery(JellyBeanApiCompatibility.java:21)
        at com.j256.ormlite.android.AndroidCompiledStatement.getCursor(AndroidCompiledStatement.java:198)
        at com.j256.ormlite.android.AndroidCompiledStatement.runQuery(AndroidCompiledStatement.java:72)
        at com.j256.ormlite.stmt.SelectIterator.<init>(SelectIterator.java:56)
        at com.j256.ormlite.stmt.StatementExecutor.buildIterator(StatementExecutor.java:254)
        at com.j256.ormlite.stmt.StatementExecutor.query(StatementExecutor.java:203)
        at com.j256.ormlite.dao.BaseDaoImpl.query(BaseDaoImpl.java:281)
        at com.j256.ormlite.stmt.QueryBuilder.query(QueryBuilder.java:384)
        at com.j256.ormlite.dao.BaseDaoImpl.queryForFieldValues(BaseDaoImpl.java:1171)
        at com.j256.ormlite.dao.BaseDaoImpl.queryForFieldValues(BaseDaoImpl.java:296)
        at mil.nga.geopackage.extension.schema.columns.DataColumnsDao.queryForId(DataColumnsDao.java:77)
        at mil.nga.geopackage.extension.schema.columns.DataColumnsDao.getDataColumn(DataColumnsDao.java:232)
        at mil.nga.mapcache.view.map.feature.FeatureViewActivity.setFieldData(FeatureViewActivity.java:303)
        at mil.nga.mapcache.view.map.feature.FeatureViewActivity.onCreate(FeatureViewActivity.java:172)
        at android.app.Activity.performCreate(Activity.java:6251)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) 
        at android.app.ActivityThread.-wrap11(ActivityThread.java) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) 
        at android.os.Handler.dispatchMessage(Handler.java:102) 
        at android.os.Looper.loop(Looper.java:148) 
        at android.app.ActivityThread.main(ActivityThread.java:5417) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 
I/Process: Sending signal. PID: 26768 SIG: 9

Steps to Reproduce:

  1. Build from source (Github master) and run in device (Nexus 7)
  2. Download example GeoPackage from NGA: https://github.com/ngageoint/GeoPackage/blob/master/docs/examples/android/example.gpkg
  3. New GeoPackage: Import from file "example"
  4. Enable "example" and select "geometry1"
  5. Tab on any symbol (see figure below for details)
  6. MapCache crashes

Test Files:

Additional Information:

Tab on screen inside any of the red circles to crash MapCache

device-2021-10-13-092110

Result

device-2021-10-13-093106

jclark118 commented 3 years ago

Noted, working on a fix for the next release