Adding the Google Play Downloader and Licensing Libraries

Anything libgdx related goes here!

Adding the Google Play Downloader and Licensing Libraries

Postby shatterblast » Tue Nov 13, 2018 7:44 pm

I am experiencing a really funky time trying to import the market_apk_expansion and market_licensing libraries. In IntelliJ, I can get them to co-exist beside each other as modules, outside the standard project setup, and the market_apk_expansion pulls dependencies properly from market_licensing. I am able to move them into the project setup, where they still correctly compile. I have been trying to integrate the market_licensing module first into the Gradle setup without success so far. The core module of the setup does not recognize the sources from market_licensing.

Does Google have Maven repositories or similar for these two Android libraries? I know that Google has its own hosted version for others, but I have not found versions for these two mentioned. Also, the Google documentation does not accurately match up with IntelliJ, but I assume it should similarly work like Android Studio.


Edit: I have been trying to get the market_licensing module to work as an AAR library with the android module. The market_licensing compiles fine, but I get errors related to the following:

Code: Select all
Exception in thread "main" java.lang.IllegalArgumentException: Type without superclass: module-info
   at com.google.common.base.Preconditions.checkArgument(Preconditions.java:191)
   at com.google.devtools.build.android.desugar.DefaultMethodClassFixer.visit(DefaultMethodClassFixer.java:80)
   at org.objectweb.asm.ClassVisitor.visit(ClassVisitor.java:113)
   at com.google.devtools.build.android.desugar.InterfaceDesugaring.visit(InterfaceDesugaring.java:97)
   at org.objectweb.asm.ClassReader.accept(ClassReader.java:621)
   at org.objectweb.asm.ClassReader.accept(ClassReader.java:500)
   at com.google.devtools.build.android.desugar.Desugar.desugarClassesInInput(Desugar.java:477)
   at com.google.devtools.build.android.desugar.Desugar.desugarOneInput(Desugar.java:361)
   at com.google.devtools.build.android.desugar.Desugar.desugar(Desugar.java:314)
   at com.google.devtools.build.android.desugar.Desugar.main(Desugar.java:711)

:android:transformClassesWithDesugarForDebug FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':android:transformClassesWithDesugarForDebug'.



The problem occurs even without obfuscation.

Thank you for your help.
shatterblast
 
Posts: 653
Joined: Sun Jul 06, 2014 1:14 pm

Re: Adding the Google Play Downloader and Licensing Librarie

Postby evilentity » Wed Nov 14, 2018 10:14 am

Dont use jdk 10?
Looking for a freelancer? PM me!
Check out libgdx discord server!
evilentity
 
Posts: 4867
Joined: Wed Aug 24, 2011 11:37 am

Re: Adding the Google Play Downloader and Licensing Librarie

Postby shatterblast » Wed Nov 14, 2018 4:38 pm

I am using Oracle JDK 8 for the JVM. I get the same errors messages whether setting all Java targets to 1.6 or 1.8. A few things do not seem to like compiling with 10 quite yet, especially some items related to Android, so I have not put it to work.
shatterblast
 
Posts: 653
Joined: Sun Jul 06, 2014 1:14 pm

Re: Adding the Google Play Downloader and Licensing Librarie

Postby shatterblast » Tue Nov 20, 2018 9:47 am

I tried several ways to get the Licensing Library and the APK Expansion Downloader library working. The above error message I think came about from a mixture of adding a Gradle Lint dependency and leaving Proguard enabled. I am not sure, but I think that Gradle Lint already comes enabled. It was probably a mistake on my part to add it again. Proguard probably just needs some " -dontwarn " flags put in the right places. I just have "minifyEnabled" set to false on everything at the moment that can use it.

Anyhow, for now, I use the following Github sources:

https://github.com/google/play-licensing

https://github.com/google/play-apk-expansion


With IntelliJ 2018.2, I used File --> New --> Module --> Import Gradle Project for the play-licensing library. For the play-apk-expansion library, I used File --> New --> Module --> Android Library --> Whatever defaults.

I have learned that dropping code from projects meant for Android that are not pre-built with Gradle SHOULD NOT be dropped straight into the src folder of an existing module. Picking "Android Library" is much better for play-apk-expansion, because choosing "New --> Module from Existing Sources ..." always ended up in a bad situation for me. It would specifically result in conflicts with Apache dependencies that went all kinds of ways of wrong, like error messages with poor details. Even the Github changelog for play-apk-expansion mentions a direct move away from Apache. Choosing "Android Library" when making a new module creates the basis for using Gradle, which in my opinion, makes things simpler.

I can finally generate a Signed APK again, so I am ending this portion of trying to import these two libraries.
shatterblast
 
Posts: 653
Joined: Sun Jul 06, 2014 1:14 pm


Return to Libgdx

Who is online

Users browsing this forum: Majestic-12 [Bot] and 1 guest