我在 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-library 的路径上遗漏了 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,其中使用相同的库来设置许可验证库
ANSWER UPDATED: These previous method only reference one file of the whole library. Actually I revert all this steps to use a library from gradle 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/