Search Unity

Cannot get IAP to work on Android devices

Discussion in 'Unity IAP' started by matthewngweile, Jul 25, 2018.

  1. matthewngweile

    matthewngweile

    Joined:
    Jul 2, 2017
    Posts:
    19
    Hello all, i have recently done up a project which includes IAP features. In Editor everything works fine, so i uploaded the apk into the Google Play Store to confirm my finished product. (In closed Alpha Build), and yes, my email was placed under Testers. Yet, in my android device, when i pressed the IAP button (I am using Codeless IAP by the way), the Google Play pop up UI did not appear.

    Using logcat, this is the error i got

    07-25 11:43:30.052 31549-31569/? E/Unity: MissingMethodException: Method not found: 'UnityEngine.VR.VRSettings.get_enabled'.
    at UnityEngine.Purchasing.JSONStore.Purchase (UnityEngine.Purchasing.ProductDefinition product, System.String developerPayload) [0x00000] in <filename unknown>:0
    at UnityEngine.Purchasing.PurchasingManager.InitiatePurchase (UnityEngine.Purchasing.Product product, System.String developerPayload) [0x00000] in <filename unknown>:0
    at UnityEngine.Purchasing.PurchasingManager.InitiatePurchase (System.String purchasableId, System.String developerPayload) [0x00000] in <filename unknown>:0
    at UnityEngine.Purchasing.PurchasingManager.InitiatePurchase (System.String productId) [0x00000] in <filename unknown>:0
    at UnityEngine.Purchasing.CodelessIAPStoreListener.InitiatePurchase (System.String productID) [0x00000] in <filename unknown>:0
    at UnityEngine.Purchasing.IAPButton.PurchaseProduct () [0x00000] in <filename unknown>:0
    at UnityEngine.Events.InvokableCall.Invoke () [0x00000] in <filename unknown>:0
    at UnityEngi

    So i was Googling the solution for this for the past 2 days...

    I am using Unity 2018.2.0f2, under Windows 10. Android Studio 3.1.3, Android SDK tool 25.2.5

    My project is under C drive, with Full control, not read-only. I opened it as administrator... I deleted UnityChannel and UnityPurchasing, reimport the asset again and again...(Probably more than 20 times). Tried to manually run API adapter using code like "this.animation.Play". Even open a fresh new project with nothing and imported Unity IAP. There was simply no API Updater prompt at all... I even went back to using the OLD IAP method, the one where you have to manually do up all the code on your own... It gave the exact same error, i was disappointed because i took hours to set everything up... I uninstalled and reinstalled Android Studio twice too.

    So basically i exhausted all methods i could find on the Internet, but still have yet solved my problem, hence the thread posted here! Would appreciate if somebody have a solution for me that i have yet tried and works!
     
  2. matthewngweile

    matthewngweile

    Joined:
    Jul 2, 2017
    Posts:
    19
    Oh.. another thing i have tried. I went into Android Manifest file under GooglePlay.aar, and removed
    android:name="com.unity.purchasing.googleplay.VRPurchaseActivity". Now that brought up another problem while temporarily solved the other. because after i uploaded the APK, it told me that i do not have Billing permission... Just additional info on another method that i had used trying to debug this IAP error...
     
  3. Benvictus

    Benvictus

    Joined:
    Sep 12, 2013
    Posts:
    87
    @matthewngweile

    Could you please open a support ticket for this issue? You can open a support ticket via the support section of the Unity dashboard.

    I think it would be best to get a copy of your app (maybe add us as a tester) and we can help debug further.

    You can also ensure that you have set the right targeted store.
     
  4. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    The VR settings error is a known issue if you do not accept the "Update API, have you made a backup?" prompt during the IAP import. If you do not get this popup, then you likely have a compiler error which would prevent the upgrade from finishing correctly. Make sure you have no other files that reference IAP outside of the Plugins folder. This post may help also: https://forum.unity.com/threads/iap-troubleshooting-remove-and-reinstall-unity-iap.511747/

    We are working to improve this behavior so that possible compile issues will not prevent the IAP import/upgrade from completing.
     
  5. matthewngweile

    matthewngweile

    Joined:
    Jul 2, 2017
    Posts:
    19
    Sure, i will open a support ticket for this issue!
     
  6. matthewngweile

    matthewngweile

    Joined:
    Jul 2, 2017
    Posts:
    19
    I understand this point because i had seen that post while finding a solution, that was why i started with a fresh project with absolutely nothing (To prevent other compiler errors that might prevent the API updater prompt) and then import the IAP. Still no prompting despite that which was why i decided to post onto this thread to find out if there are other problems that are preventing the API updater prompt to be carried out!
     
  7. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    If you don't receive the API Update, you will get this VR error so there is no need to build an APK for further testing. The task here is to determine why you are not receiving the popup. Make sure your project and folder location has Read/Write permissions. Create a new project under your Documents folder to check, as a test. You did mention that you checked this and even ran as an administrator, but I wanted to confirm the project location (specifically not on an external drive). Please try on another computer as a test, if possible. We are working to make this process more smooth in a future release.
     
  8. JeanCFBiezus

    JeanCFBiezus

    Joined:
    Jun 5, 2018
    Posts:
    1
    Hello, I was having exactly the same issue as @matthewngweile and after days of trying and research i could get a solution.
    I think the problem was with the Read-only attribute from the project's folder, since it was located on D disk, but it dosen't worked even after unchecking that attribute. I tryied to make me owner of the folder with full controll and still I get no results. Then I followed the @JeffDUnity3D instructions and created a brand new project on Documents default location (C disk), did the IAP install proccess an hey, it worked, after imported the packages, the API Updater dialog showed up. Then I replaced the Unity Channel and Unity Purchasing folders in my project.

    So, I guess you have two alternatives:

    1 - Move/Copy your project's folder to a common system's directory, like Documents, and reinstall the Unity IAP like described on this link: https://forum.unity.com/threads/iap-troubleshooting-remove-and-reinstall-unity-iap.511747/ . (I do not tested that)

    2 - Create a brand new project in a common system's directory, like Documents, enable IAP service, import and install the packages (API Updater should appear on this proccess), copy the Unity Channel and Unity Purchasing folder's, delete this folders in the project that is not working and paste the new ones, Unity will import the packages and it should be working.

    Good luck!
     
  9. silverair

    silverair

    Joined:
    Jun 20, 2015
    Posts:
    5
    oh my god...I spend few hour to fix this problem
    until I look this Post...

    Only your solution worked!

    thanks a lot!!!
     
  10. Kunal6569

    Kunal6569

    Joined:
    Apr 5, 2016
    Posts:
    1
  11. MarcoPixion

    MarcoPixion

    Joined:
    Jan 29, 2018
    Posts:
    20
    I tried both solutions but the same issue keeps on happening.

    You can find the log attached.

    Can you support us on this, please?
     

    Attached Files:

  12. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    What am I looking for in the log? What line are you seeing an issue?