我最近實現了在 http://developer.android.com/guide/market/expansion-files.html中描述的APK擴展文件代碼,並將其轉換爲 我的應用。我更新了清單,創建了服務和接收方文件 並更新了我的主要活動onCreate()以符合指南中的指令 。APK擴展文件下載異常
我創建了一個我的應用程序的已簽名apk,並將其上傳到我的Google Play 帳戶以及obb文件。這些被保存爲「草稿」。
然後我用ADB我簽署APK安裝到我的設備和運行它,並 立即得到了以下異常:
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.myapp/com.example.myapp.MyApp}:
android.database.sqlite.SQLiteException: no such table:
MetadataColumns: , while compiling: SELECT APKVERSION,_id,DOWNLOADSTATUS,DOWNLOADFLAGS FROM MetadataColumns LIMIT 1
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java: 1821)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java: 1842)
at android.app.ActivityThread.access$1500(ActivityThread.java: 132)
at android.app.ActivityThread $H.handleMessage(ActivityThread.java:1038)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:150)
at android.app.ActivityThread.main(ActivityThread.java:4263)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit $MethodAndArgsCaller.run(ZygoteInit.java:839)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.database.sqlite.SQLiteException: no such table:
MetadataColumns: , while compiling: SELECT APKVERSION,_id,DOWNLOADSTATUS,DOWNLOADFLAGS FROM MetadataColumns LIMIT 1
at android.database.sqlite.SQLiteCompiledSql.native_compile(Native Method)
at android.database.sqlite.SQLiteCompiledSql.compile(SQLiteCompiledSql.java: 92)
at android.database.sqlite.SQLiteCompiledSql.<init>(SQLiteCompiledSql.java: 65)
at android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:83)
at android.database.sqlite.SQLiteQuery.<init>(SQLiteQuery.java: 49)
at android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java: 53)
at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java: 1438)
at android.database.sqlite.SQLiteDatabase.rawQuery(SQLiteDatabase.java: 1406)
at com.google.android.vending.expansion.downloader.impl.t.<init>(SourceFile: 76)
at com.google.android.vending.expansion.downloader.impl.t.a(SourceFile: 44)
at com.google.android.vending.expansion.downloader.impl.DownloaderService.a(SourceFile: 634)
有趣的是,如果我跑我的應用程序通過Eclipse 調試程序,我可以執行導致異常的代碼,並且 繼續正常處理,從而收到消息「下載失敗,因爲您可能尚未購買此應用程序,因爲 」。
任何想法爲什麼在簽名版本中, 下載器庫中存在SQLite異常,特別是DownloadsDB.java?
我的項目構建目標是2.3.3
我有谷歌播放通過我的項目
引用的許可,下載器和Zip庫 而在我的表現,我有以下:
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="15"/
<uses-permission android:name="com.android.vending.CHECK_LICENSE"/
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<service android:name=".MyAppDownloaderService" />
<receiver android:name=".MyAppAlarmReceiver" />
TIA,
JB
您是否在對發行版進行混淆? – dagalpin 2012-06-05 23:32:06