4

I am trying to use apk expansion files in my android project, I've read this http://developer.android.com/google/play/expansion-files.html I tried to follow those steps, but I cannot figure out how to set up / include in my project / google play apk expansion library. I've been searching for hours, didn't find right answer. Any help?

Nurdin
  • 23,382
  • 43
  • 130
  • 308
x.iva
  • 74
  • 7

4 Answers4

5

I just tried to set up the modules listed in http://developer.android.com/google/play/expansion-files.html today, but the play_apk_expansion/downloader_library cannot be imported as supplied.

The issue is a stale library reference in play_apk_expansion/downloader_library/project.properties

Update the last line from:

android.library.reference.1=../market_licensing

to:

android.library.reference.1=../../play_licensing/library

Note the extra ../

Then use File -> New -> Import Module... to import the play_apk_expansion/downloader_library as usual. It will also import the play_licensing/library as library but that can be renamed to something more useful afterwards.

Andrew
  • 1,057
  • 11
  • 19
  • you can also comment this line **android.library.reference.1=../../play_licensing/library** if you're using gradle. Then add the dependency in gradle instead. – Alex Jul 28 '19 at 20:28
2

I have not found a better way than importing via eclipse, so I have set up a github repo where this has already been done:

https://github.com/coltsoftware/ExpansionAPKsAndroidStudio

weston
  • 54,145
  • 21
  • 145
  • 203
1
  1. Copy sdk/extras/google/play_licening/library to Eclipse workspace

  2. Copy sdk/extras/google/play_apk_expansion/downloader_library to Eclipse workspace

  3. Eclipse: New --> Android project from sources to create two library projects from the above copied files. Don't forget to make the correct library reference to play_licening for downloader_library.

  4. Android Studio: New --> Import Module, and import play_licening first, and then downloader_library.

bummi
  • 27,123
  • 14
  • 62
  • 101
loopscn
  • 29
  • 6
1

To use Andrew's answer with Android Studio 2.1, I needed to update:

market_apk_expansion/downloader_library/project.properties

to

android.library.reference.1=../../market_licensing/library

before I could import the module as described.

Community
  • 1
  • 1
Andrew Wood
  • 131
  • 1
  • 5
  • 1
    Tip: Referring to other answers by "above" and "below" is meaningless, as the display order is changeable. If you're going to post an answer, post an answer. If it really is a comment, get the rep and comment. (You could get 10 rep with about 15 minute's effort, so no excuses!) – Mogsdad May 04 '16 at 15:46