gpt4 book ai didi

android - 使用 .mbtiles 数据库的 OSMdroid 错误

转载 作者:行者123 更新时间:2023-11-29 21:42:12 25 4
gpt4 key购买 nike

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

Example of OSMDroid

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

Video

在我的程序中我有错误:

    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 示例 map 以确保代码正常工作并且问题出在 .mbtiles 文件上。任何区域。

非常感谢。

最佳答案

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

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

关于android - 使用 .mbtiles 数据库的 OSMdroid 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16773076/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com