我正在遵循这个指南:https://developer.android.com/google/play/expansion-files.html
在我的downloaderService.java文件中,它无法解析为扩展DownloaderService:
public class downloaderService extends DownloaderService {
为什么以及如何解决它?另一个文件无法解析alarmReceiver.java中的DownloaderClientMarshaller:
.. DownloaderClientMarshaller.startDownloadServiceIfRequired(context,
intent, downloaderService.class); .....
谢谢您的回答
谷歌教程不适合我,也没有这个:https://kitefaster.com/2017/02/15/expansion-apk-files-android-studio/
因为导入库后我遇到了同样的问题。
但是在gradle中添加依赖项对我有用。为此,你必须在你的应用build.gradle中添加以下行:
android{
[...]
repositories {
maven { url 'https://dl.bintray.com/alexeydanilov/apk-expansion'}
}
}
dependencies {
compile 'com.danikula.expansion:expansion:1.3.4'
compile 'com.danikula.expansion:license:1.7.0'
compile 'com.danikula.expansion:zip:1.2.1'
}
正如你在这里看到的:https://github.com/danikula/Google-Play-Expansion-File
最后android studio找到了自动售货库和DownloaderService以及DownloaderClientMarshaller类。
希望这个答案可以帮到你:)