5

APK size has reached to 105 MB, and i need to create APK Expansion Files.

I am following Android Documentation for creating Expansion Files.

I have downloaded Google Play APK Expansion Library and Google Play Licencing Library.

Now I need to add these libraries to my app.

I have followed documentation. It states following

  1. Select File > New > New Module.
  2. In the Create New Module window, select Android Library, and then select Next.
  3. Specify an Application/Library name such as "Google Play License Library" and "Google Play Downloader Library", choose Minimum SDK level, then select Finish.
  4. Select File > Project Structure.
  5. Select the Properties tab and in Library Repository, enter the library from the /extras/google/ directory (play_licensing/ for the License Verification Library or play_apk_expansion/downloader_library/ for the Downloader Library).

Now the problem is in step-5: When I add following the path in Library Repository it runs Gradle build for a while and then does nothing, and when I re-open the Project structure there is nothing in the Library Repository field.

C:\Users\DELL\AppData\Local\Android\Sdk\extras\google\market_licensing\library

I am unable to understand how to import this project into my app. The other way is to individually copy each file and add it in the library module, but I don't want to try this approach.

Project Structure :

enter image description here

dev90
  • 7,187
  • 15
  • 80
  • 153

3 Answers3

2

Use import module instead creation. For download module before improrting remove "android.library.reference.1=../market_licensing" line from project.properties file.

Orgazm pionerki
  • 336
  • 4
  • 11
1

In step 5 I entered this

<\sdk>/extras/google/market_apk_expansion/downloader_library/AndroidManifest.xml
for the downloader library and this
<\sdk>/extras/google/market_licensing/library/AndroidManifest.xml
for the licensing library.

It seemed to accept these values. The backslashes should be removed but that was the only way I could find to get the sdk inside of greater-than and less-than to show up.

0

You can right click the library and there's a option to add as a library.You can add that as library by right clicking libs-> add as a library.

Shivam Oberoi
  • 1,447
  • 1
  • 9
  • 18