2013-05-27 38 views
1

我嘗試使用OSMDroid時出現問題。我使用的例子在這裏:使用.mbtiles數據庫的OSMdroid錯誤

Example of OSMDroid

然後我用這個視頻創建和下載mbtiles地圖。

Video

在我PROGRAMM我有錯誤:

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文件有關。任何地區。

非常感謝。

回答

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

數據庫有問題,找不到圖像表。檢查數據庫中是否有圖像表。