ZipResourceFile 无法解析为类型 [英] ZipResourceFile cannot be resolved to a type

查看:28
本文介绍了ZipResourceFile 无法解析为类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试重写我的应用程序以使用 APK 扩展文件.我一直在关注这里的文档

解决方案

如果您使用的是 Eclipse,请为每个库创建一个项目并将其添加到您的应用中:

为许可证验证库和下载器库创建一个新的库项目.对于每个库:开始一个新的 Android 项目.选择从现有源创建项目并从/extras/google/目录(market_licensing/用于许可证验证库或 market_apk_expansion/downloader_library/用于下载程序库)中选择库.指定项目名称,例如Google Play 许可证库"和Google Play 下载程序库" 单击完成.注意:下载程序库取决于许可证验证库.确保将许可证验证库添加到下载程序库的项目属性(与下面的步骤 2 和 3 相同的过程).右键单击要在其中使用 APK 扩展文件的 Android 项目,然后选择属性.在库"面板中,单击添加"以选择每个库并将其添加到您的应用程序中.

http://developer.android.com/google/play/expand-files.html#AboutLibraries

实际上我只是忽略了关于指定一个项目名称,例如......"我只是使用了 gui 想出的默认名称.

I am trying to rewrite my App to work with APK Expansion files. I have been following the documentation here http://developer.android.com/google/play/expansion-files.html . I have downloaded the ...

... but when I added this code ...

public static Uri getTrackUriFromZipFile ( int track ) {
    // Get a ZipResourceFile representing a specific expansion file
    ZipResourceFile expansionFile = new ZipResourceFile(filePathToMyZip);
}

... I get the error message ZipResourceFile cannot be resolved to a type :( weep weep weep

Editted ... Hmmm maybe I have to do something awful like this ...

If you're using Eclipse, create a project for each library and add it to your app:

Create a new Library Project for the License Verification Library and Downloader Library. For each library: Begin a new Android project. Select Create project from existing source and choose the library from the /extras/google/ directory (market_licensing/ for the License Verification Library or market_apk_expansion/downloader_library/ for the Downloader Library). Specify a Project Name such as "Google Play License Library" and "Google Play Downloader Library" Click Finish. Note: The Downloader Library depends on the License Verification Library. Be sure to add the License Verification Library to the Downloader Library's project properties (same process as steps 2 and 3 below). Right-click the Android project in which you want to use APK expansion files and select Properties. In the Library panel, click Add to select and add each of the libraries to your application.

http://developer.android.com/google/play/expansion-files.html#AboutLibraries

解决方案

If you're using Eclipse, create a project for each library and add it to your app:

Create a new Library Project for the License Verification Library and Downloader Library. For each library: Begin a new Android project. Select Create project from existing source and choose the library from the /extras/google/ directory (market_licensing/ for the License Verification Library or market_apk_expansion/downloader_library/ for the Downloader Library). Specify a Project Name such as "Google Play License Library" and "Google Play Downloader Library" Click Finish. Note: The Downloader Library depends on the License Verification Library. Be sure to add the License Verification Library to the Downloader Library's project properties (same process as steps 2 and 3 below). Right-click the Android project in which you want to use APK expansion files and select Properties. In the Library panel, click Add to select and add each of the libraries to your application.

http://developer.android.com/google/play/expansion-files.html#AboutLibraries

And actually I just ignored the bit about "Specify a Prject Name such as ..." I just used the default names the gui came up with.

这篇关于ZipResourceFile 无法解析为类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆