Search Unity

Google Play Pass Licencing Check No Longer Working

Discussion in 'Android' started by Rajmahal, Jun 7, 2021.

  1. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    Hi,

    I upgraded the unity version of my game that is on Google Play Pass to Unity 2020.3. Unfortunately, the Google Play Pass licensing service script that google provided seems to no longer work. When trying to authenticate the game with the Google Play store, Android logcat shows the following error:

    ****
    06/07 16:57:16.542 18727 18743 Error Unity AndroidJavaException: java.lang.SecurityException: Not allowed to bind to service Intent { act=com.android.vending.licensing.ILicensingService pkg=com.android.vending }
    06/07 16:57:16.542 18727 18743 Error Unity java.lang.SecurityException: Not allowed to bind to service Intent { act=com.android.vending.licensing.ILicensingService pkg=com.android.vending }
    06/07 16:57:16.542 18727 18743 Error Unity at com.google.licensingservicehelper.LicensingServiceHelper.checkLicense(LicensingServiceHelper.java:87)
    ****

    Does anyone know what the error means and what the fix might be? I'm guessing I need to make an entry in my Android manifest file for the service intent but I'm not knowledgeable on the Android side so don't really know what I should do.

    Can anyone please help? This is currently holding back 2 titles of mine to be featured on my google play pass catalog.
     
    Panasenko and greg_unity763 like this.
  2. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    Any tips, guys? Even if it's just a way to decipher the message that would help a lot.
     
  3. pixelminer

    pixelminer

    Joined:
    Jul 24, 2011
    Posts:
    26
  4. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    Thanks so much. I was able to fix it doing something similar to the link you provided.
     
  5. ABerlemont

    ABerlemont

    Joined:
    Sep 27, 2012
    Posts:
    67
    I just had the same issue and doing what is said in pixelminer's link seems to work for me also.

    https://github.com/Unity-Technologies/GooglePlayLicenseVerification/issues/14

    Basically :

    copy the content of the generated manifest (temp/stagingarea) and use it in your own the Assets/Plugins/Anrdoid/AndroidManifest.xml

    and make sure

    <uses-permission android:name="com.android.vending.CHECK_LICENSE" />

    is present.

    Thanks !
     
  6. Tanek

    Tanek

    Joined:
    Apr 19, 2016
    Posts:
    45
    I replied on the GitHub thread but this could be helpful here too, so here's what I discovered.
    Starting from Unity 2020 there is a fundamental change needed for a plugin folder to be considered an Android library: the folder name must end with ".androidlib" otherwise Unity won't use/merge the AndroidManifest included in the folder.
    Here's the Unity 2020.3 documentation: https://docs.unity3d.com/2020.3/Documentation/Manual/AndroidAARPlugins.html , in the "Android Library Projects" paragraph there's this very important change (you can check the 2019.4 documentation to see that it has been changed).
    So for example "GooglePlayLicensing" must be renamed to "GooglePlayLicensing.androidlib" and then the included AndroidManifest will me merged in the build. Without that, it simply won't be merged/included.
     
    AcidArrow and dcheglakov like this.
  7. dcheglakov

    dcheglakov

    Joined:
    Aug 11, 2014
    Posts:
    34
    @Tanek thank you for the tip, it worked like a charm.
     
    Tanek likes this.
  8. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,791
    Pfft you're absolutely correct. We also found out that manifest merging wasn't working properly but we were unable to find out why, I don't know why changes like that aren't brought up more to the forefront and are instead hidden in the docs.
     
    Tanek likes this.
  9. Tanek

    Tanek

    Joined:
    Apr 19, 2016
    Posts:
    45
    Totally agree with you, that's why I decided to write my post, hoping to make this change a bit more visible and help other devs :)
     
    AcidArrow and dcheglakov like this.
  10. ramy660066

    ramy660066

    Joined:
    May 23, 2020
    Posts:
    4
    Can you please explain how u fixed it
     
  11. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,791
    If you have manifests you need Unity to merge for you, you need to add .androidlib at the end of the folder name where the manifest is in.

    In the meantime, since we didn't know about that, I almost manually wrote our final manifest and I'm just giving it to Unity to use without making any further adjustments to it, which is good because now we are immune to whatever other changes Unity decides to do on a whim, but I had to gain a deeper understanding on the Unity to Android building process, which was time I would rather spend on other things.
     
  12. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    In my case, I bought an asset that handled the manifest and allowed me to add the required permission (Android Permission Manager from asset store). That being said, I don't think it's necessary and you could just do it as AcidArrow suggested above.
     
    KyryloKuzyk likes this.