Cannot resolve symbol DownloaderService for APK expansion

Viewed 927

I was following this guide : https://developer.android.com/google/play/expansion-files.html

and in my downloaderService.java file it can't resolve to extends DownloaderService :

public class downloaderService extends DownloaderService {

Why and how to fix it? another file can't resolve DownloaderClientMarshaller at alarmReceiver.java :

..  DownloaderClientMarshaller.startDownloadServiceIfRequired(context,
                    intent, downloaderService.class);  .....

Thank you for your answers

2 Answers

Google tutorial not worked for me, and neither this one: https://kitefaster.com/2017/02/15/expansion-apk-files-android-studio/

Because after import the libraries I had the same problem that you.

But adding dependencies in gradle worked for me. For that you have to add in your app build.gradle this lines:

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'
}

As you can see here: https://github.com/danikula/Google-Play-Expansion-File

And finally android studio finds vending library and DownloaderService and DownloaderClientMarshaller classes.

Hope this answer help you :)

Related