android - APK 扩展文件 : Specifying library path in Android Studio (Windows)

标签 android android-studio android-gradle-plugin android-library apk-expansion-files

我在 Android Studio (Windows 10) 上。我一直在尝试按照 https://developer.android.com/google/play/expansion-files.html 中的步骤进行操作但我停留在“准备使用下载程序库”部分。我已经下载并安装了 Google Play License Library 和 Google Play Downloader Library。我已经创建了相应的模块。但是,当我转到“模块设置”并指定库存储库的路径时,出现错误,当我再次打开“模块设置”时,“库存储库”字段仍为空白。我得到的错误是:

10:23:57 PM IncorrectOperationException: Error while applying changes: cannot create file from text: C:\Users\n56\AppData\Local\Android\sdk\extras\google\market_apk_expansion\downloader_library\
10:36:23 PM IncorrectOperationException: Error while applying changes: cannot create file from text: C:\Users\n56\AppData\Local\Android\sdk\extras\google\market_licensing\library\

我指定的库存储库路径是:

C:\Users\n56\AppData\Local\Android\sdk\extras\google\market_apk_expansion\downloader_library
C:\Users\n56\AppData\Local\Android\sdk\extras\google\market_licensing\library\

我尝试了各种方法,例如转义反斜杠、导入模块而不是单击“新建模块”但没有可用。

如有任何帮助,我们将不胜感激。 TIA。

最佳答案

tutorial 的文档在每个 的路径上遗漏了 Android Manifes.xml 文件的引用.

每个库的正确路径是:

Google Play 许可库 <sdk>/extras/google/play_licensing/library/AndroidManifest.xml

Google Play 下载程序库 <sdk>/extras/google/play_apk_expansion/downloader_library/AndroidManifest.xml

我注意到在其他 tutorial 上来自 Google,其中使用相同的库来设置许可验证库

Tutorial for LVL

Android Library Repository

ANSWER UPDATED: These previous method only reference one file of the whole library. Actually I revert all this steps to use a library from whit all we need to use Google Play License Library and Google Play Downloader Library there is the link for the repository

关于android - APK 扩展文件 : Specifying library path in Android Studio (Windows),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39230622/

相关文章:

java - 将另一个 Activity 的数据显示到另一个 Activity 。动态地从类到数组列表到线性布局

java - Android 在 Java 中高效地阅读大文本

Android Studio新建项目Eclipse风格

android - 如何将这个(AdsWizz)Kotlin回调函数包装在协程中?

android - 防止在 Android 中达到 65k 方法

android - Google 日历排序顺序和 future 事件不起作用

android - 失败:生成失败,发生异常。在volley\bintray.gradle中

java - 为什么在我创建新项目时会在 android studio 中出现此错误?

android - 如何使用Gradle将其他参数传递给transformClassesWithDexForDebug?

android - SDK 构建工具更新到 23.1 rc1 后出现意外顶级异常