I recently implemented the APK Expansion File code, described in http://developer.android.com/guide/market/expansion-files.html, into my app. I updated the manifest, created the Service and Receiver files and update my main activity onCreate() to conform to the instructions in the guide.
I created a signed apk of my app, and uploaded it to my Google Play account, along with the obb file. These were saved as "drafts".
I then used adb to install my signed APK onto my device and ran it and immediately got the following exception:
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)
What is interesting is that if I run my app through the Eclipse debugger, I can execute the code that caused the exception, and continue normal processing, getting a message "Download failed because you may not have purchased this app".
Any idea why, on a signed version, there is an SQLite exception in the downloader library, specifically DownloadsDB.java?
我的项目建设目标为2.3.3
I have the Google Play License, Downloader and Zip libraries referenced by my project
我的发言如下:
<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,
页: 1