ngageoint / geopackage-android

GeoPackage Android Library
http://ngageoint.github.io/geopackage-android
MIT License
94 stars 32 forks source link

Android 10+ scoped storage support #70

Closed eclectice closed 3 years ago

eclectice commented 3 years ago

Please fill out as much known and relevant information as possible.

Version Information:

Android Studio Arctic Fox | 2020.3.1
Build #AI-203.7717.56.2031.7583922, built on July 27, 2021
Runtime version: 11.0.10+0-b96-7249189 amd64
VM: OpenJDK 64-Bit Server VM by Oracle Corporation
Windows 10 10.0
GC: G1 Young Generation, G1 Old Generation
Memory: 1280M
Cores: 4
Registry: analyze.exceptions.on.the.fly=true, external.system.auto.import.disabled=true, ide.images.show.chessboard=true
Non-Bundled Plugins: com.alayouni.ansiHighlight, com.intellij.ideolog, JFormDesigner, idea.plugin.protoeditor, io.protostuff.protostuff-jetbrains-plugin, Dart, org.jetbrains.kotlin, io.flutter, org.intellij.plugins.markdown

Expected Results:

Observed Results:

Output:

2021-09-25 12:26:30.220 17694-17694/? E/SQLiteDatabase: Error inserting 
    android.database.sqlite.SQLiteException: near "null": syntax error (code 1 SQLITE_ERROR[1]): , while compiling: INSERT INTO "geopackage"(null) VALUES (NULL)
        at android.database.sqlite.SQLiteConnection.nativePrepareStatement(Native Method)
        at android.database.sqlite.SQLiteConnection.acquirePreparedStatement(SQLiteConnection.java:1463)
        at android.database.sqlite.SQLiteConnection.prepare(SQLiteConnection.java:901)
        at android.database.sqlite.SQLiteSession.prepare(SQLiteSession.java:590)
        at android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:62)
        at android.database.sqlite.SQLiteStatement.<init>(SQLiteStatement.java:33)
        at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:2217)
        at android.database.sqlite.SQLiteDatabase.insert(SQLiteDatabase.java:2088)
        at mil.nga.geopackage.db.GeoPackageDatabase.insert(GeoPackageDatabase.java:127)
        at mil.nga.geopackage.db.metadata.GeoPackageMetadataDataSource.create(GeoPackageMetadataDataSource.java:51)
        at mil.nga.geopackage.factory.GeoPackageManagerImpl.importGeoPackage(GeoPackageManagerImpl.java:1319)
        at mil.nga.geopackage.factory.GeoPackageManagerImpl.importGeoPackage(GeoPackageManagerImpl.java:658)
        at mil.nga.geopackage.factory.GeoPackageManagerImpl.importGeoPackage(GeoPackageManagerImpl.java:572)

Steps to Reproduce:

Just use any code sample that has GeoPackageFactory.importGeoPackage() calls or has made java.io.File calls to read/write database or files.

Relevant Code:

Just use any code sample that has GeoPackageFactory.importGeoPackage() calls or has made java.io.File calls to read/write database or files.

Test Files:

Additional Information:

eclectice commented 3 years ago

I've just noticed that the GeoPackageManager implementation class has support for the DocumentFile class which is good enough!

bosborn commented 3 years ago

Great, yes newly added as a result of ngageoint/geopackage-android-map#20