我在尝试使用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文件。任何地区。
非常感谢。
答案 0 :(得分:2)
Caused by: android.database.sqlite.SQLiteException: no such table: images (code 1): , while compiling: SELECT tile_data FROM images LIMIT 0,1
数据库出了问题,找不到图像表。检查数据库中是否有图像表。