我在之后开发指南http://developer.android.com/guide/market/expansion-files.html以下载其他资产,以我的APK。
我已经做了所有的部分关于库的进口,等等。我还实施了样本代码,我的主要程序(以检测是否扩展文件已经下载,如果我们需要将它们下载并启动下载等。)
我在Eclipse中没有错误,但是当我启动应用程序,并开始打电话从库中的方法和类,我有不同的崩溃:
1 -首先,在安装时,亚行说,图书馆找不到..:
[2012-04-17 22:50:13 - MyApp] adb is running normally.
[2012-04-17 22:50:13 - MyApp] Performing com.gmla.MyApp activity launch
[2012-04-17 22:50:16 - MyApp] Uploading MyApp.apk onto device 'SH16PV801048'
[2012-04-17 22:50:16 - MyApp] Installing MyApp.apk...
[2012-04-17 22:50:22 - MyApp] Success!
[2012-04-17 22:50:22 - Google Play Downloader Library] Could not find Google Play Downloader Library.apk!
[2012-04-17 22:50:22 - Google Play License Library] Could not find Google Play License Library.apk!
下面是我如何试图导入我的图书馆截图: http://floy.fr/perso/floy/expfiles/4.PNG
我有进口与项目导入库像部分)的Java构建路径,在我的主要项目属性:(进口在下载库的许可库太)
我也试图在B部分在安装这一个只导入罐等)(没有错误)
并在C部分的Android库导入等)(这似乎是一个开发者指南中的建议,但我有编译错误与这一个,月食没有找到一些参考,我不能建项目):
所以,坛子进口的似乎是最好的,在编译和安装没有任何错误,但我有以后其他错误,当我正在从图书馆的methodes和类呼叫:
2 -在该应用:
当我试图使用助手,以便检查这种方法的XAPKFiles的存在:
boolean expansionFilesDelivered() {
XAPKFile[] xAPKS = {new XAPKFile(true, 3, 687801613L)
// main file only
};
for (XAPKFile xf : xAPKS) {
String fileName = Helpers.getExpansionAPKFileName(this, xf.mIsMain, xf.mFileVersion);
if (!Helpers.doesFileExist(this, fileName, xf.mFileSize, false))
return false;
}
return true;
}
我有这样的崩溃DDMS:
04-17 23:14:24.614: I/dalvikvm(23201): Could not find method com.google.android.vending.expansion.downloader.Helpers.getExpansionAPKFileName, referenced from method com.gmla.guideaudio.apkexp.GmlaCheckExpFiles.expansionFilesDelivered
04-17 23:14:24.614: W/dalvikvm(23201): VFY: unable to resolve static method 1295: Lcom/google/android/vending/expansion/downloader/Helpers;.getExpansionAPKFileName (Landroid/content/Context;ZI)Ljava/lang/String;
04-17 23:14:24.614: D/dalvikvm(23201): VFY: replacing opcode 0x71 at 0x001b
04-17 23:14:24.614: W/dalvikvm(23201): Unable to resolve superclass of Lcom/gmla/guideaudio/apkexp/GmlaDownloaderService; (250)
04-17 23:14:24.614: W/dalvikvm(23201): Link of class 'Lcom/gmla/guideaudio/apkexp/GmlaDownloaderService;' failed
04-17 23:14:24.614: E/dalvikvm(23201): Could not find class 'com.gmla.guideaudio.apkexp.GmlaDownloaderService', referenced from method com.gmla.guideaudio.apkexp.GmlaCheckExpFiles.onCreate
04-17 23:14:24.614: W/dalvikvm(23201): VFY: unable to resolve const-class 135 (Lcom/gmla/guideaudio/apkexp/GmlaDownloaderService;) in Lcom/gmla/guideaudio/apkexp/GmlaCheckExpFiles;
04-17 23:14:24.614: D/dalvikvm(23201): VFY: replacing opcode 0x1c at 0x001c
04-17 23:14:24.624: V/Performance(23201): >>com.gmla.guideaudio.apkexp.GmlaCheckExpFiles@40db32b0 onCreate
04-17 23:14:24.624: D/AndroidRuntime(23201): Shutting down VM
04-17 23:14:24.624: W/dalvikvm(23201): threadid=1: thread exiting with uncaught exception (group=0x40abf228)
04-17 23:14:24.624: E/AndroidRuntime(23201): FATAL EXCEPTION: main
04-17 23:14:24.624: E/AndroidRuntime(23201): java.lang.NoClassDefFoundError: com.google.android.vending.expansion.downloader.Helpers
04-17 23:14:24.624: E/AndroidRuntime(23201): at com.gmla.guideaudio.apkexp.GmlaCheckExpFiles.expansionFilesDelivered(GmlaCheckExpFiles.java:64)
04-17 23:14:24.624: E/AndroidRuntime(23201): at com.gmla.guideaudio.apkexp.GmlaCheckExpFiles.onCreate(GmlaCheckExpFiles.java:22)
04-17 23:14:24.624: E/AndroidRuntime(23201): at android.app.Activity.performCreate(Activity.java:4524)
04-17 23:14:24.624: E/AndroidRuntime(23201): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1071)
04-17 23:14:24.624: E/AndroidRuntime(23201): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2115)
04-17 23:14:24.624: E/AndroidRuntime(23201): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2189)
04-17 23:14:24.624: E/AndroidRuntime(23201): at android.app.ActivityThread.access$600(ActivityThread.java:139)
04-17 23:14:24.624: E/AndroidRuntime(23201): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1261)
04-17 23:14:24.624: E/AndroidRuntime(23201): at android.os.Handler.dispatchMessage(Handler.java:99)
04-17 23:14:24.624: E/AndroidRuntime(23201): at android.os.Looper.loop(Looper.java:154)
04-17 23:14:24.624: E/AndroidRuntime(23201): at android.app.ActivityThread.main(ActivityThread.java:4894)
04-17 23:14:24.624: E/AndroidRuntime(23201): at java.lang.reflect.Method.invokeNative(Native Method)
04-17 23:14:24.624: E/AndroidRuntime(23201): at java.lang.reflect.Method.invoke(Method.java:511)
04-17 23:14:24.624: E/AndroidRuntime(23201): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
04-17 23:14:24.624: E/AndroidRuntime(23201): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
04-17 23:14:24.624: E/AndroidRuntime(23201): at dalvik.system.NativeStart.main(Native Method)
当我使用方法1或2,当我导入库这崩溃发生。
我已经试过,因为我读1.7.1可以与图书馆进口的一些问题,更新蚂蚁最新的1.8.3。与上解决自己的问题没有成功。
我的主要应用是在谷歌API 8(Android 2.2的)
我寻觅了很多事情,以使这个工作,但..现在我完全出出主意!
如果有人知道如何得到这个工作,那将是非常亲切:P
对不起,这个长的帖子和我的英语很抱歉,如果我做出错误的拼写错误,那是因为我是法国人:P
编辑:我曾尝试下载示例代码,与库导入方法C),我这次没有编译错误,但在安装过程中:
[2012-04-18 01:56:16 - GuideAudio] Android Launch!
[2012-04-18 01:56:16 - GuideAudio] adb is running normally.
[2012-04-18 01:56:16 - GuideAudio] Performing com.gmla.guideaudio.GuideAudio activity launch
[2012-04-18 01:56:19 - GuideAudio] Uploading GuideAudio.apk onto device 'SH16PV801048'
[2012-04-18 01:56:19 - GuideAudio] Installing GuideAudio.apk...
[2012-04-18 01:56:21 - GuideAudio] Installation error: INSTALL_FAILED_MISSING_SHARED_LIBRARY
[2012-04-18 01:56:21 - GuideAudio] Please check logcat output for more details.
[2012-04-18 01:56:21 - GuideAudio] Launch canceled!
我不明白,因为该库似乎得到了很好进口...我可以看到他们在Eclipse中“引用的库”。
我也写在清单:
<uses-library android:name="com.google.android.vending.expansion.downloader" />
<uses-library android:name="com.google.android.vending.licensing" />