2

I am on Android Studio (Windows 10). I have been trying to follow the steps in https://developer.android.com/google/play/expansion-files.html but am stuck at the section "Preparing to use the Downloader Library". I have downloaded and installed Google Play License Library and Google Play Downloader Library. I have created the corresponding modules. But when I go to Module Settings and specify the path to the Library Repository, I get errors and when I open up Module Settings again, the Library Repository field remains blank. The error I get are :

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\

And the library repository paths I specified are :

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\

I have tried various things like escaping the backslashes, importing the modules instead of clicking New Modules but to no available.

Would be grateful for any help. TIA.

Monu Surana
  • 694
  • 1
  • 6
  • 20

2 Answers2

8

The documentation of this tutorial miss the reference of the Android Manifes.xml file on the path for each .

The correct path for each library are:

Google Play License Library <sdk>/extras/google/play_licensing/library/AndroidManifest.xml

Google Play Downloader Library <sdk>/extras/google/play_apk_expansion/downloader_library/AndroidManifest.xml

I noticed that on other tutorial from Google where use the same library for setting up the Licensing Verification Library

Tutorial for LVL

Android Library Repository

ANSWER UPDATED: These previous method only reference one file of the whole library. Actually I revert all this steps to use a library from whit all we need to use Google Play License Library and Google Play Downloader Library there is the link for the repository

1

I tried and made it work with below Tags in individual Module's build.gradle . flatDir is the key to solution. and for Windows based Android Studio, the '\' needs to be escaped using double '\' backslashes.

repositories {

     flatDir {
          dirs "C:\\Users\\<username>\\AppData\\Local\\Android\\sdk\\extras\\google\\market_licensing"
     }
}

I am still learning, but I think it has something to do with flatDirs container which should be child of repositories container.

it is now showing up a bit different but the Gradle Sync just works.

Project Structure Dialog

Avinash Barnwal
  • 181
  • 1
  • 7