1

我在尝试使用 OSMDroid 时遇到问题。我在这里使用示例:

OSMDroid 示例

然后我使用这个视频来创建和下载 mbtiles 地图。

视频

在我的程序中我有错误:

    05-27 15:11:46.123: E/AndroidRuntime(22401): FATAL EXCEPTION: main
    05-27 15:11:46.123: E/AndroidRuntime(22401): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.osmdroidtestproject/com.example.osmdroidtestproject.MainActivity}: android.database.sqlite.SQLiteException: no such table: images (code 1): , while compiling: SELECT tile_data FROM images LIMIT 0,1
    05-27 15:11:46.123: E/AndroidRuntime(22401):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java)
    05-27 15:11:46.123: E/AndroidRuntime(22401):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java)
    05-27 15:11:46.123: E/AndroidRuntime(22401):    at android.app.ActivityThread.access$600(ActivityThread.java)
    05-27 15:11:46.123: E/AndroidRuntime(22401):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java)
    05-27 15:11:46.123: E/AndroidRuntime(22401):    at android.os.Handler.dispatchMessage(Handler.java)
    05-27 15:11:46.123: E/AndroidRuntime(22401):    at android.os.Looper.loop(Looper.java)
    05-27 15:11:46.123: E/AndroidRuntime(22401):    at android.app.ActivityThread.main(ActivityThread.java)
    05-27 15:11:46.123: E/AndroidRuntime(22401):    at java.lang.reflect.Method.invokeNative(Native Method)
    05-27 15:11:46.123: E/AndroidRuntime(22401):    at java.lang.reflect.Method.invoke(Method.java)
    05-27 15:11:46.123: E/AndroidRuntime(22401):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java)
    05-27 15:11:46.123: E/AndroidRuntime(22401):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java)
    05-27 15:11:46.123: E/AndroidRuntime(22401):    at dalvik.system.NativeStart.main(Native Method)
    05-27 15:11:46.123: E/AndroidRuntime(22401): Caused by: android.database.sqlite.SQLiteException: no such table: images (code 1): , while compiling: SELECT tile_data FROM images LIMIT 0,1
    05-27 15:11:46.123: E/AndroidRuntime(22401):    at android.database.sqlite.SQLiteConnection.nativePrepareStatement(Native Method)
    05-27 15:11:46.123: E/AndroidRuntime(22401):    at android.database.sqlite.SQLiteConnection.acquirePreparedStatement(SQLiteConnection.java)
    05-27 15:11:46.123: E/AndroidRuntime(22401):    at android.database.sqlite.SQLiteConnection.prepare(SQLiteConnection.java)
    05-27 15:11:46.123: E/AndroidRuntime(22401):    at android.database.sqlite.SQLiteSession.prepare(SQLiteSession.java)
    05-27 15:11:46.123: E/AndroidRuntime(22401):    at android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java)
    05-27 15:11:46.123: E/AndroidRuntime(22401):    at android.database.sqlite.SQLiteQuery.<init>(SQLiteQuery.java)
    05-27 15:11:46.123: E/AndroidRuntime(22401):    at android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java)
    05-27 15:11:46.123: E/AndroidRuntime(22401):    at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java)
    05-27 15:11:46.123: E/AndroidRuntime(22401):    at android.database.sqlite.SQLiteDatabase.rawQuery(SQLiteDatabase.java)
    05-27 15:11:46.123: E/AndroidRuntime(22401):    at com.example.osmdroidtestproject.MBTileSource.createFromFile(MBTileSource.java:96)
    05-27 15:11:46.123: E/AndroidRuntime(22401):    at com.example.osmdroidtestproject.MBTileProvider.<init>(MBTileProvider.java:32)
    05-27 15:11:46.123: E/AndroidRuntime(22401):    at com.example.osmdroidtestproject.MainActivity.onCreate(MainActivity.java:32)
    05-27 15:11:46.123: E/AndroidRuntime(22401):    at android.app.Activity.performCreate(Activity.java)
    05-27 15:11:46.123: E/AndroidRuntime(22401):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java)
    05-27 15:11:46.123: E/AndroidRuntime(22401):    ... 12 more

拜托,你能帮我吗,我该如何解决这个问题?如果有人有,请您上传一些 .mbtiles 示例地图,以确保代码正常工作并且问题出在 .mbtiles 文件上。任何区域。

非常感谢。

4

1 回答 1

2
Caused by: android.database.sqlite.SQLiteException: no such table: images (code 1): , while compiling: SELECT tile_data FROM images LIMIT 0,1

数据库有问题,找不到图像表。检查您的数据库中是否有图像表。

于 2013-06-01T07:59:34.340 回答