I am trying to set up Google Play Licencing for an app in Android studio for an app written in Kotlin. My goal is to avoid users sharing APK files without purchasing my app through the store.
What I've tried:
I've tried following through their documentation. It's not very useful. It skips over many details and it's not really a tutorial. I couldn't use it.
I've seen this question, which does have a long and detailed tutorial-like answer. But the answer seems long-outdated. It causes lots of warnings and terminates with an exception "Intent must be explicit".
My question in summary is:
How can I set up license checking through Google so people who haven't purchased the app through the store can't install it. This seems to be a very common thing to do even though I couldn't manage to find much of any proper answer around.
Here's how I got it working in 2020:
libraryfolder in your project:appand click Open Module Settings:libraryand click OK:Go to library > manifests > AndroidManifest.xml and remove the line
<uses-sdk android:minSdkVersion="3" android:targetSdkVersion="15" />.minSdkVersionto 4 and also changecompileSdkVersion,buildToolsVersionandtargetSdkVersionas necessary, then clickSync Now:MainActivity.kt.// TODOcomments):Apply the fix in this answer.