Search Unity

'GooglePlayStoreModule' does not exist in the namespace after Unity update

Discussion in 'Unity IAP' started by Steimond1, Mar 17, 2021.

  1. Steimond1

    Steimond1

    Joined:
    Jan 20, 2021
    Posts:
    12
    Hey guys!
    I got the problem after upgrading Unity from 2020.1.17f1 to 2020.3.0f1.

    I am updating my project to a newer version of Unity and Unity says
    The type or namespace name 'GooglePlayStoreModule' does not exist in the namespace 'Google.Play.Billing' (are you missing an assembly reference?)
    But everything is OK in my IDE. If I remove the code containing the GooglePlayStoreModule I get another error in Unity. Unity cannot find the abstract method MRGSMetrics.AddPurchase (Product PurchasingProduct), but it is there. And again in the IDE everything is OK.

    In both cases AddPurchase and GooglePlayStoreModule inside #if UNITY_PURCHASING. Perhaps the error is somewhere here.

    I have the latest version of GooglePlayPlugin v.1.4.0., Unity IAP is ON.

    P.S. If I comment and uncomment the abstract method, the AddPurchase error goes away. This also happens with GooglePlayStoreModule. But after reopening Unity, both errors will appear again.
     
    Last edited: Mar 17, 2021
    dccoo likes this.
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Make a project backup then delete your /Library folder. And you are using the GooglePlayPlugin? They may be duplicating libraries. Please test on a new project with IAP only to compare.
     
  3. Steimond1

    Steimond1

    Joined:
    Jan 20, 2021
    Posts:
    12
    Thanks! I will try to do this later and then I will answer.
     
  4. x1998629x

    x1998629x

    Joined:
    Jul 6, 2020
    Posts:
    6
    I also have same problem.
    Everything works fine before update Unity IAP to 3.0.2
    It seems that google.play.bill conflicts with IAP?
     

    Attached Files:

    • err.png
      err.png
      File size:
      10 KB
      Views:
      367
  5. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
  6. x1998629x

    x1998629x

    Joined:
    Jul 6, 2020
    Posts:
    6
    I did try everything,
    Had try:
    1. follow the release note
    2. switching IAP & Google play billing version
    3. open new project with only IAP & Google play billing

    I think the problem might caused by IAP changing storage folder,
    following the tutorial from https://developer.android.com/google/play/billing/unity
    1.whether the google play billing conflict detection is correctly pointer to the right folder?
    (with pic er2)
    2.Is it necessary to use GooglePlayStoreModule to instance?
    I can now receive information through StandardPurchasingModule.
    Code (CSharp):
    1.  
    2. //Error
    3. var builder = ConfigurationBuilder.Instance(Google.Play.Billing.GooglePlayStoreModule.Instance());
    4. //Work
    5. var builder2 = ConfigurationBuilder.Instance(StandardPurchasingModule.Instance());
     

    Attached Files:

    • er2.png
      er2.png
      File size:
      143.9 KB
      Views:
      328
  7. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Sorry I don't follow. So you tried with a new project? Please share your results. Don't install anything except Unity IAP, we install the Google billing library for you. The tutorial you are following is not from Unity, do not follow it. Perhaps start with the Sample IAP Project here https://forum.unity.com/threads/sample-iap-project.529555/
     
  8. x1998629x

    x1998629x

    Joined:
    Jul 6, 2020
    Posts:
    6
    My problem has solved.
    It's weird that this is not official tutorial,
    your teams should let unity users know which tutorial they can follow,
    this article come up first place by searching "unity iap google play bill",
    misleading for those who want to integrate iap.
     
  9. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    That is not our documentation! We have no control over the Google documentation. We are updating our documentation at https://docs.unity3d.com/Manual/UnityIAPGoogleConfiguration.html to point to the Sample IAP Project
     
    x1998629x likes this.
  10. josenunes

    josenunes

    Joined:
    Jun 16, 2017
    Posts:
    9
    Please, tell me what you've done to fix this issue ...
    I had everything going, and after the last update, Google.Play namespace seems 'broken'.

    #if UNITY_ANDROID
    GooglePlayStoreModule module = (GooglePlayStoreModule)Google.Play.Billing.GooglePlayStoreModule.Instance();
    var builder = ConfigurationBuilder.Instance(module);
    #endif

    Thanks in advance
     
  11. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Please open and compare to the Sample IAP Project v2. Note that you now need to remove Assets/Plugins/UnityPurchasing and use Package Manager (only) to update IAP. And Google.Play.Billing, where are you seeing the Unity documentation for this?
     
  12. josenunes

    josenunes

    Joined:
    Jun 16, 2017
    Posts:
    9
    I do not have anything in Assets/Plugins/UnityPurchasing. I''ve updated In App purchases to latest version via UMP.
    I can't find any consensual documentation.
    I've tried even deleting the whole library folder.

    Weirdly enough, that's the only thing in this namespace. I don't know what to do. I can't see anything in samples.

    upload_2021-6-7_21-17-12.png
     
  13. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    I meant, why are you adding that code? Where are you finding it? Please compare to the Sample IAP project as suggested.
     
  14. javpnunes

    javpnunes

    Joined:
    Jul 3, 2020
    Posts:
    2
    I'm adding this code to initialize Google Play store module, when in Android, then to pass it to the ConfigurationBuilder class.

    The code is as follows

    Code (CSharp):
    1. #if !UNITY_STANDALONE && !UNITY_ANDROID
    2.                     StandardPurchasingModule module = StandardPurchasingModule.Instance();
    3.                     var builder = ConfigurationBuilder.Instance(module);
    4. #endif
    5.  
    6. #if UNITY_ANDROID
    7.             var module = (GooglePlayStoreModule)Google.Play.Billing.GooglePlayStoreModule.Instance();
    8.             var builder = ConfigurationBuilder.Instance(module);
    9. #endif
    But this package google.billing, apparently doesn't have this GooglePlayStoreModule and I can't get this to work.
    I've looked at Sample Project v2 and I couldn't see anything related.

    Thank you
     
  15. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Correct, it's not needed. Please use the working code from the Sample project. Where did you originally obtain the code that you are using?
     
  16. javpnunes

    javpnunes

    Joined:
    Jul 3, 2020
    Posts:
    2
  17. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Yes, you no longer want to use that code which was originally published by Google (not Unity). You'll want to use the code from the Sample project and follow the directions here https://docs.unity3d.com/Packages/com.unity.purchasing@3.2/manual/UnityIAPGoogleConfiguration.html
     
  18. domdev

    domdev

    Joined:
    Feb 2, 2015
    Posts:
    375
    any proper fix for this? I'm using AIP 4.1.2 and billing 3.2.1
     
  19. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Can you confirm what code you are using and the exact error you are receiving?
     
  20. domdev

    domdev

    Joined:
    Feb 2, 2015
    Posts:
    375
    I'm using unity AIP 4.1.2 and google play billing 3.2.1, its okay now it turns out you will need to add UNITY_PURCHASING custom define, then now got error in build getting errors



    Duplicate class com.android.billingclient.api.Purchase$PurchaseState found in modules GooglePlayBilling-runtime.jar :)GooglePlayBilling:) and billing-3.0.3-runtime.jar :)billing-3.0.3:)
    Duplicate class com.android.billingclient.api.Purchase$PurchasesResult found in modules GooglePlayBilling-runtime.jar :)GooglePlayBilling:) and billing-3.0.3-runtime.jar :)billing-3.0.3:)
    Duplicate class com.android.billingclient.api.PurchaseHistoryRecord found in modules GooglePlayBilling-runtime.jar :)GooglePlayBilling:) and billing-3.0.3-runtime.jar :)billing-3.0.3:)
    Duplicate class com.android.billingclient.api.PurchaseHistoryResponseListener found in modules GooglePlayBilling-runtime.jar :)GooglePlayBilling:) and billing-3.0.3-runtime.jar :)billing-3.0.3:)
    Duplicate class com.android.billingclient.api.PurchasesUpdatedListener found in modules GooglePlayBilling-runtime.jar :)GooglePlayBilling:) and billing-3.0.3-runtime.jar :)billing-3.0.3:)
    Duplicate class com.android.billingclient.api.SkuDetails found in modules GooglePlayBilling-runtime.jar :)GooglePlayBilling:) and billing-3.0.3-runtime.jar :)billing-3.0.3:)
    Duplicate class com.android.billingclient.api.SkuDetailsParams found in modules GooglePlayBilling-runtime.jar :)GooglePlayBilling:) and billing-3.0.3-runtime.jar :)billing-3.0.3:)
    Duplicate class com.android.billingclient.api.SkuDetailsParams$Builder found in modules GooglePlayBilling-runtime.jar :)GooglePlayBilling:) and billing-3.0.3-runtime.jar :)billing-3.0.3:)
    Duplicate class com.android.billingclient.api.SkuDetailsResponseListener found in modules GooglePlayBilling-runtime.jar :)GooglePlayBilling:) and billing-3.0.3-runtime.jar :)billing-3.0.3:)
    Duplicate class com.android.billingclient.api.zza found in modules GooglePlayBilling-runtime.jar :)GooglePlayBilling:) and billing-3.0.3-runtime.jar :)billing-3.0.3:)
    Duplicate class com.android.billingclient.api.zzaa found in modules GooglePlayBilling-runtime.jar :)GooglePlayBilling:) and billing-3.0.3-runtime.jar :)billing-3.0.3:)
    Duplicate class com.android.billingclient.api.zzab found in modules GooglePlayBilling-runtime.jar :)GooglePlayBilling:) and billing-3.0.3-runtime.jar :)billing-3.0.3:)
    Duplicate class com.android.billingclient.api.zzac found in modules GooglePlayBilling-runtime.jar :)GooglePlayBilling:) and billing-3.0.3-runtime.jar :)billing-3.0.3:)
    Duplicate class com.android.billingclient.api.zzad found in modules GooglePlayBilling-runtime.jar :)GooglePlayBilling:) and billing-3.0.3-runtime.jar :)billing-3.0.3:)
    Duplicate class com.android.billingclient.api.zzae found in modules GooglePlayBilling-runtime.jar :)GooglePlayBilling:) and billing-3.0.3-runtime.jar :)billing-3.0.3:)
    Duplicate class com.android.billingclient.api.zzaf found in modules GooglePlayBilling-runtime.jar :)GooglePlayBilling:) and billing-3.0.3-runtime.jar :)billing-3.0.3:)
    Duplicate class com.android.billingclient.api.zzag found in modules GooglePlayBilling-runtime.jar :)GooglePlayBilling:) and billing-3.0.3-runtime.jar :)billing-3.0.3:)
    Duplicate class com.android.billingclient.api.zzah found in modules GooglePlayBilling-runtime.jar :)GooglePlayBilling:) and billing-3.0.3-runtime.jar :)billing-3.0.3:)
    Duplicate class com.android.billingclient.api.zzai found in modules GooglePlayBilling-runtime.jar :)GooglePlayBilling:) and billing-3.0.3-runtime.jar :)billing-3.0.3:)
    Duplicate class com.android.billingclient.api.zzaj found in modules GooglePlayBilling-runtime.jar :)GooglePlayBilling:) and billing-3.0.3-runtime.jar :)billing-3.0.3:)
    Duplicate class com.android.billingclient.api.zzak found in modules GooglePlayBilling-runtime.jar :)GooglePlayBilling:) and billing-3.0.3-runtime.jar :)billing-3.0.3:)
    Duplicate class com.android.billingclient.api.zzal found in modules GooglePlayBilling-runtime.jar :)GooglePlayBilling:) and billing-3.0.3-runtime.jar :)billing-3.0.3:)
    Duplicate class com.android.billingclient.api.zzam found in modules GooglePlayBilling-runtime.jar :)GooglePlayBilling:) and billing-3.0.3-runtime.jar :)billing-3.0.3:)
    Duplicate class com.android.billingclient.api.zzan found in modules GooglePlayBilling-runtime.jar :)GooglePlayBilling:) and billing-3.0.3-runtime.jar :)billing-3.0.3:)
    Duplicate class com.android.billingclient.api.zzao found in modules GooglePlayBilling-runtime.jar :)GooglePlayBilling:) and billing-3.0.3-runtime.jar :)billing-3.0.3:)
    Duplicate class com.android.billingclient.api.zzap found in modules GooglePlayBilling-runtime.jar :)GooglePlayBilling:) and billing-3.0.3-runtime.jar :)billing-3.0.3:)
    Duplicate class com.android.billingclient.api.zzaq found in modules GooglePlayBilling-runtime.jar :)GooglePlayBilling:) and billing-3.0.3-runtime.jar :)billing-3.0.3:)
    Duplicate class com.android.billingclient.api.zzar found in modules GooglePlayBilling-runtime.jar :)GooglePlayBilling:) and billing-3.0.3-runtime.jar :)billing-3.0.3:)
    Duplicate class com.android.billingclient.api.zzas found in modules GooglePlayBilling-runtime.jar :)GooglePlayBilling:) and billing-3.0.3-runtime.jar :)billing-3.0.3:)
    Duplicate class com.android.billingclient.api.zzat found in modules GooglePlayBilling-runtime.jar :)GooglePlayBilling:) and billing-3.0.3-runtime.jar :)billing-3.0.3:)
    Duplicate class com.android.billingclient.api.zzb found in modules GooglePlayBilling-runtime.jar :)GooglePlayBilling:) and billing-3.0.3-runtime.jar :)billing-3.0.3:)
    Duplicate class com.android.billingclient.api.zzc found in modules GooglePlayBilling-runtime.jar :)GooglePlayBilling:) and billing-3.0.3-runtime.jar :)billing-3.0.3:)
    Duplicate class com.android.billingclient.api.zzd found in modules GooglePlayBilling-runtime.jar :)GooglePlayBilling:) and billing-3.0.3-runtime.jar :)billing-3.0.3:)
    Duplicate class com.android.billingclient.api.zze found in modules GooglePlayBilling-runtime.jar :)GooglePlayBilling:) and billing-3.0.3-runtime.jar :)billing-3.0.3:)
    Duplicate class com.android.billingclient.api.zzf found in modules GooglePlayBilling-runtime.jar :)GooglePlayBilling:) and billing-3.0.3-runtime.jar :)billing-3.0.3:)
    Duplicate class com.android.billingclient.api.zzg found in modules GooglePlayBilling-runtime.jar :)GooglePlayBilling:) and billing-3.0.3-runtime.jar :)billing-3.0.3:)
    Duplicate class com.android.billingclient.api.zzh found in modules GooglePlayBilling-runtime.jar :)GooglePlayBilling:) and billing-3.0.3-runtime.jar :)billing-3.0.3:)
    Duplicate class com.android.billingclient.api.zzi found in modules GooglePlayBilling-runtime.jar :)GooglePlayBilling:) and billing-3.0.3-runtime.jar :)billing-3.0.3:)
    Duplicate class com.android.billingclient.api.zzj found in modules GooglePlayBilling-runtime.jar :)GooglePlayBilling:) and billing-3.0.3-runtime.jar :)billing-3.0.3:)
    Duplicate class com.android.billingclient.api.zzk found in modules GooglePlayBilling-runtime.jar :)GooglePlayBilling:) and billing-3.0.3-runtime.jar :)billing-3.0.3:)
    Duplicate class com.android.billingclient.api.zzl found in modules GooglePlayBilling-runtime.jar :)GooglePlayBilling:) and billing-3.0.3-runtime.jar :)billing-3.0.3:)
    Duplicate class com.android.billingclient.api.zzm found in modules GooglePlayBilling-runtime.jar :)GooglePlayBilling:) and billing-3.0.3-runtime.jar :)billing-3.0.3:)
    Duplicate class com.android.billingclient.api.zzn found in modules GooglePlayBilling-runtime.jar :)GooglePlayBilling:) and billing-3.0.3-runtime.jar :)billing-3.0.3:)
    Duplicate class com.android.billingclient.api.zzo found in modules GooglePlayBilling-runtime.jar :)GooglePlayBilling:) and billing-3.0.3-runtime.jar :)billing-3.0.3:)
    Duplicate class com.android.billingclient.api.zzp found in modules GooglePlayBilling-runtime.jar :)GooglePlayBilling:) and billing-3.0.3-runtime.jar :)billing-3.0.3:)
    Duplicate class com.android.billingclient.api.zzq found in modules GooglePlayBilling-runtime.jar :)GooglePlayBilling:) and billing-3.0.3-runtime.jar :)billing-3.0.3:)
    Duplicate class com.android.billingclient.api.zzr found in modules GooglePlayBilling-runtime.jar :)GooglePlayBilling:) and billing-3.0.3-runtime.jar :)billing-3.0.3:)
    Duplicate class com.android.billingclient.api.zzs found in modules GooglePlayBilling-runtime.jar :)GooglePlayBilling:) and billing-3.0.3-runtime.jar :)billing-3.0.3:)
    Duplicate class com.android.billingclient.api.zzt found in modules GooglePlayBilling-runtime.jar :)GooglePlayBilling:) and billing-3.0.3-runtime.jar :)billing-3.0.3:)
    Duplicate class com.android.billingclient.api.zzu found in modules GooglePlayBilling-runtime.jar :)GooglePlayBilling:) and billing-3.0.3-runtime.jar :)billing-3.0.3:)
    Duplicate class com.android.billingclient.api.zzv found in modules GooglePlayBilling-runtime.jar :)GooglePlayBilling:) and billing-3.0.3-runtime.jar :)billing-3.0.3:)
    Duplicate class com.android.billingclient.api.zzw found in modules GooglePlayBilling-runtime.jar :)GooglePlayBilling:) and billing-3.0.3-runtime.jar :)billing-3.0.3:)
    Duplicate class com.android.billingclient.api.zzx found in modules GooglePlayBilling-runtime.jar :)GooglePlayBilling:) and billing-3.0.3-runtime.jar :)billing-3.0.3:)
    Duplicate class com.android.billingclient.api.zzy found in modules GooglePlayBilling-runtime.jar :)GooglePlayBilling:) and billing-3.0.3-runtime.jar :)billing-3.0.3:)
    Duplicate class com.android.billingclient.api.zzz found in modules GooglePlayBilling-runtime.jar :)GooglePlayBilling:) and billing-3.0.3-runtime.jar :)billing-3.0.3:)
    Duplicate class com.google.android.gms.internal.play_billing.zza found in modules GooglePlayBilling-runtime.jar :)GooglePlayBilling:) and billing-3.0.3-runtime.jar :)billing-3.0.3:)
    Duplicate class com.google.androi
     
  21. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Did you add the Google Billing Library separately? We already include it, you are seeing duplicate libraries.