Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

not initializing on some android devices

Discussion in 'Unity IAP' started by wouter_vugt, Jun 17, 2019.

  1. wouter_vugt

    wouter_vugt

    Joined:
    Feb 25, 2015
    Posts:
    110
    Unity IAP is not initializing on my phone, but is working correctly on my tablet (including test purchases etc).
    Could there be any reason for this, seems really weird to me?

    thanks
     
  2. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    7,146
  3. wouter_vugt

    wouter_vugt

    Joined:
    Feb 25, 2015
    Posts:
    110
    Alright here it is:
    06-30 12:21:20.306 13232 13247 I UnityIAP: Starting in-app billing setup.
    06-30 12:21:20.358 13232 13232 I UnityIAP: Billing service connected.
    06-30 12:21:20.373 13232 13344 I UnityIAP: invoking callback
    06-30 12:21:20.373 13232 13344 I UnityIAP: Checking for in-app billing 3 support.
    06-30 12:21:20.478 13232 13344 I UnityIAP: In-app billing version 3 supported for com.graphicvizion.visualacupuncturefr
    06-30 12:21:20.486 13232 13344 I UnityIAP: Subscriptions AVAILABLE.
    06-30 12:21:20.493 13232 13344 I UnityIAP: Subscription upgrade and downgrade are AVAILABLE.
    06-30 12:21:20.499 13232 13344 I UnityIAP: Subscriptions information parse AVAILABLE.
    06-30 12:21:20.507 13232 13344 I UnityIAP: VR supported.
    06-30 12:21:20.509 13232 13344 I UnityIAP: onIabSetupFinished: 0
    06-30 12:21:20.510 13232 13344 I UnityIAP: Requesting 7 products
    06-30 12:21:20.510 13232 13344 I UnityIAP: QueryInventory: 7
    06-30 12:21:20.510 13232 13344 I UnityIAP: invoking callback
    06-30 12:21:20.510 13232 13344 I UnityIAP: Querying owned items, item type: inapp
    06-30 12:21:20.510 13232 13344 I UnityIAP: Package name: com.graphicvizion.visualacupuncturefr
    06-30 12:21:20.510 13232 13344 I UnityIAP: Calling getPurchases with continuation token: null
    06-30 12:21:20.536 13232 13344 I UnityIAP: Owned items response: 0
    06-30 12:21:20.536 13232 13344 I UnityIAP: Sku is owned: com.graphicvizion.visualacupuncturefr.extraordinary
    06-30 12:21:20.537 13232 13344 I UnityIAP: Sku is owned: com.graphicvizion.visualacupuncturefr.anatomy
    06-30 12:21:20.537 13232 13344 I UnityIAP: Sku is owned: com.graphicvizion.visualacupuncturefr.primarymeridians
    06-30 12:21:20.537 13232 13344 I UnityIAP: Sku is owned: com.graphicvizion.visualacupuncturefr.anatomy
    06-30 12:21:20.537 13232 13344 I UnityIAP: Continuation token: null
    06-30 12:21:20.537 13232 13344 I UnityIAP: Querying SKU details.
    06-30 12:21:20.649 13232 13344 I UnityIAP: getSkuDetails() failed: 6:Error
    06-30 12:21:20.649 13232 13344 I UnityIAP: onQueryInventoryFinished: false
    06-30 12:21:20.649 13232 13344 I UnityIAP: Error refreshing inventory (querying prices of items). (response: 6:Error)
    06-30 12:21:20.649 13232 13344 I UnityIAP: Failed to Query inventory. UnityIAP will automatically retry in 5000ms
    06-30 12:21:20.650 13232 13344 I UnityIAP: QueryInventory: 7
    06-30 12:21:20.650 13232 13344 I UnityIAP: invoking callback
    06-30 12:21:25.650 13232 13344 I UnityIAP: Querying owned items, item type: inapp
    06-30 12:21:25.650 13232 13344 I UnityIAP: Package name: com.graphicvizion.visualacupuncturefr
    06-30 12:21:25.650 13232 13344 I UnityIAP: Calling getPurchases with continuation token: null
    06-30 12:21:25.662 13232 13344 I UnityIAP: Owned items response: 0
    06-30 12:21:25.662 13232 13344 I UnityIAP: Sku is owned: com.graphicvizion.visualacupuncturefr.extraordinary
    06-30 12:21:25.662 13232 13344 I UnityIAP: Sku is owned: com.graphicvizion.visualacupuncturefr.anatomy
    06-30 12:21:25.662 13232 13344 I UnityIAP: Sku is owned: com.graphicvizion.visualacupuncturefr.primarymeridians
    06-30 12:21:25.662 13232 13344 I UnityIAP: Sku is owned: com.graphicvizion.visualacupuncturefr.anatomy
    06-30 12:21:25.662 13232 13344 I UnityIAP: Continuation token: null
    06-30 12:21:25.662 13232 13344 I UnityIAP: Querying SKU details.
    06-30 12:21:25.717 13232 13344 I UnityIAP: getSkuDetails() failed: 6:Error
    06-30 12:21:25.717 13232 13344 I UnityIAP: onQueryInventoryFinished: false
    06-30 12:21:25.717 13232 13344 I UnityIAP: Error refreshing inventory (querying prices of items). (response: 6:Error)
    06-30 12:21:25.717 13232 13344 I UnityIAP: Failed to Query inventory. UnityIAP will automatically retry in 10000ms
    06-30 12:21:25.718 13232 13344 I UnityIAP: QueryInventory: 7
    06-30 12:21:25.718 13232 13344 I UnityIAP: invoking callback
    06-30 12:21:31.873 13232 13264 E Unity : java.net.UnknownHostException: Unable to resolve host "cdp.cloud.unity3d.com": No address associated with hostname
    06-30 12:21:31.873 13232 13264 E Unity : #0 0xce0f6cac (libunity.so) ? 0x469cac
    06-30 12:21:31.873 13232 13264 E Unity : #1 0xce68ff5c (libunity.so) ? 0xa02f5c
    06-30 12:21:31.873 13232 13264 E Unity : #2 0xce5cc4ac (libunity.so) ? 0x93f4ac
    06-30 12:21:31.873 13232 13264 E Unity :
    06-30 12:21:31.873 13232 13264 E Unity : (Filename: Line: 451)
    06-30 12:21:31.873 13232 13264 E Unity :
    06-30 12:21:35.721 13232 13344 I UnityIAP: Querying owned items, item type: inapp
    06-30 12:21:35.721 13232 13344 I UnityIAP: Package name: com.graphicvizion.visualacupuncturefr
    06-30 12:21:35.721 13232 13344 I UnityIAP: Calling getPurchases with continuation token: null
    06-30 12:21:35.835 13232 13344 I UnityIAP: Owned items response: 0
    06-30 12:21:35.835 13232 13344 I UnityIAP: Sku is owned: com.graphicvizion.visualacupuncturefr.extraordinary
    06-30 12:21:35.835 13232 13344 I UnityIAP: Sku is owned: com.graphicvizion.visualacupuncturefr.anatomy
    06-30 12:21:35.835 13232 13344 I UnityIAP: Sku is owned: com.graphicvizion.visualacupuncturefr.primarymeridians
    06-30 12:21:35.836 13232 13344 I UnityIAP: Sku is owned: com.graphicvizion.visualacupuncturefr.anatomy
    06-30 12:21:35.836 13232 13344 I UnityIAP: Continuation token: null
    06-30 12:21:35.836 13232 13344 I UnityIAP: Querying SKU details.
    06-30 12:21:39.624 13232 13344 I UnityIAP: Querying owned items, item type: subs
    06-30 12:21:39.625 13232 13344 I UnityIAP: Package name: com.graphicvizion.visualacupuncturefr
    06-30 12:21:39.625 13232 13344 I UnityIAP: Calling getPurchases with continuation token: null
    06-30 12:21:40.109 13232 13344 I UnityIAP: Owned items response: 0
    06-30 12:21:40.110 13232 13344 I UnityIAP: Continuation token: null
    06-30 12:21:40.110 13232 13344 I UnityIAP: Querying SKU details.
    06-30 12:21:46.317 13232 13344 I UnityIAP: Querying owned items' purchase history, item type: subs
    06-30 12:21:46.318 13232 13344 I UnityIAP: Package name: com.graphicvizion.visualacupuncturefr
    06-30 12:21:46.320 13232 13344 I UnityIAP: Calling getPurchaseHistory with continuation token: null
    06-30 12:21:49.908 13232 13344 I UnityIAP: Purchase history response: 6
    06-30 12:21:49.908 13232 13344 I UnityIAP: getPurchaseHistory() failed: 6:Error
    06-30 12:21:49.914 13232 13344 I UnityIAP: onQueryInventoryFinished: false
    06-30 12:21:49.914 13232 13344 I UnityIAP: Error query Purchase History (response: 6:Error)
    06-30 12:21:49.914 13232 13344 I UnityIAP: Failed to Query inventory. UnityIAP will automatically retry in 20000ms
    06-30 12:21:49.914 13232 13344 I UnityIAP: QueryInventory: 7
    06-30 12:21:49.914 13232 13344 I UnityIAP: invoking callback
    06-30 12:22:09.915 13232 13344 I UnityIAP: Querying owned items, item type: inapp
    06-30 12:22:09.915 13232 13344 I UnityIAP: Package name: com.graphicvizion.visualacupuncturefr
    06-30 12:22:09.915 13232 13344 I UnityIAP: Calling getPurchases with continuation token: null
    06-30 12:22:09.954 13232 13344 I UnityIAP: Owned items response: 0
    06-30 12:22:09.954 13232 13344 I UnityIAP: Sku is owned: com.graphicvizion.visualacupuncturefr.extraordinary
    06-30 12:22:09.954 13232 13344 I UnityIAP: Sku is owned: com.graphicvizion.visualacupuncturefr.anatomy
    06-30 12:22:09.954 13232 13344 I UnityIAP: Sku is owned: com.graphicvizion.visualacupuncturefr.primarymeridians
    06-30 12:22:09.955 13232 13344 I UnityIAP: Sku is owned: com.graphicvizion.visualacupuncturefr.anatomy
    06-30 12:22:09.955 13232 13344 I UnityIAP: Continuation token: null
    06-30 12:22:09.955 13232 13344 I UnityIAP: Querying SKU details.
    06-30 12:22:10.009 13232 13344 I UnityIAP: Querying owned items, item type: subs
    06-30 12:22:10.009 13232 13344 I UnityIAP: Package name: com.graphicvizion.visualacupuncturefr
    06-30 12:22:10.009 13232 13344 I UnityIAP: Calling getPurchases with continuation token: null
    06-30 12:22:10.401 13232 13344 I UnityIAP: Owned items response: 0
    06-30 12:22:10.401 13232 13344 I UnityIAP: Continuation token: null
    06-30 12:22:10.402 13232 13344 I UnityIAP: Querying SKU details.
    06-30 12:22:10.437 13232 13344 I UnityIAP: Querying owned items' purchase history, item type: subs
    06-30 12:22:10.437 13232 13344 I UnityIAP: Package name: com.graphicvizion.visualacupuncturefr
    06-30 12:22:10.437 13232 13344 I UnityIAP: Calling getPurchaseHistory with continuation token: null
    06-30 12:22:19.449 13232 13344 I UnityIAP: Purchase history response: 6
    06-30 12:22:19.449 13232 13344 I UnityIAP: getPurchaseHistory() failed: 6:Error
    06-30 12:22:19.459 13232 13344 I UnityIAP: onQueryInventoryFinished: false
    06-30 12:22:19.459 13232 13344 I UnityIAP: Error query Purchase History (response: 6:Error)
    06-30 12:22:19.459 13232 13344 I UnityIAP: Failed to Query inventory. UnityIAP will automatically retry in 40000ms
    06-30 12:22:19.462 13232 13344 I UnityIAP: QueryInventory: 7
    06-30 12:22:19.462 13232 13344 I UnityIAP: invoking callback
     
  4. wouter_vugt

    wouter_vugt

    Joined:
    Feb 25, 2015
    Posts:
    110
    This fixed it, without changing any code:

    We had the same problem in one of our apps under test mode. Later, we figured out that, we had to clear the Cache of the Google Play Store app.

    So you can try this -

    1. Go your device's Settings menu.
    2. Go to Applications (may also be labeled Application Manager).
    3. Tab over to All Applications.
    4. Search for and open the Google Play Store app. Tap on it, application settings will show
    5. Tap on Clear Data and Clear Cache.

    However, does this mean it is safe to release this way? seems to be an issue with my account somehow.
     
    ibicus likes this.
  5. ibicus

    ibicus

    Joined:
    Feb 28, 2014
    Posts:
    1
    I've got same problem here.

    Looks like that android billing api function "queryPurchaseHistoryAsync" is returning error code 6.
     
  6. wouter_vugt

    wouter_vugt

    Joined:
    Feb 25, 2015
    Posts:
    110
    @JeffDUnity3D Could you please let us know how to fix this?

    Clearing cache and data only worked once, now when I restart I get the same problem.
    I don't know if this would happen to other users as well, I think it is because I made many test purchases and it must have caused an error somehow, which still is a bug but one that most probably would never encounter.
     
  7. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    7,146
    This looks like recent issue we may have introduced in IAP 1.22 with regard to getPurchaseHistoryAsync returning error code 6. Apparently it doesn't reproduce in Alpha/Beta/Internal testing, but only in release. We have heard reports that it works as expected with Unity IAP 1.19
     
  8. wouter_vugt

    wouter_vugt

    Joined:
    Feb 25, 2015
    Posts:
    110
    I use IAP 1.21..
    Also this is the error "getPurchaseHistory() failed: 6:Error" not the Async version..
    I have released it as is, since it did work on other account and I have used this IAP version before and this was never an issue.

    Please let me eknow if it is safe to release and what this error means.
     
  9. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    7,146
    We have determined that this is caused by the user changing their Google password on the web, but not on an unlocked/no screen lock device. We are looking to improve the behavior and work around this Google issue in a future release.
     
  10. emeraldgamestudio

    emeraldgamestudio

    Joined:
    Mar 14, 2017
    Posts:
    7
    I am doing internal testing, re-logged in the android account, and added a screen lock. I am still getting the exact error.

    I understand there is no way to roll back to an older IAP version, do I have any other option?
     
  11. GarlicDipping

    GarlicDipping

    Joined:
    Sep 7, 2013
    Posts:
    31
    We're experiencing this same issue on our production app. Any updates?

    *Edit : Ok, seems like @wouter_vugt 's solution works. I understand there's nothing much unity can do here, hope more elegant solution appears asap.
     
    Last edited: Sep 15, 2019
  12. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    7,146
    It looks to be an issue on Google's side, but we are attempting to accommodate in the next IAP release in a few weeks. You will receive a specific error code where you'll want to pop up a dialog to inform the user to check their Google account and password on the device.
     
  13. cheese_A

    cheese_A

    Joined:
    Sep 18, 2019
    Posts:
    1

    2019-09-18 15:27:25.112 23544-23594/? I/Unity: InAppInitialize
    2019-09-18 15:27:25.115 23544-23594/? I/Unity: UnityIAP Version: 1.19.0
    2019-09-18 15:27:25.133 23544-23594/? I/UnityIAP: IAB helper created.
    2019-09-18 15:27:25.177 23544-23594/? I/Unity: CLIENT:TRANSACTION_POLL:
    DONE:310427
    2019-09-18 15:27:25.177 23544-23594/? I/Unity: CLIENT:TRANSACTION_POLL:CLOSED
    2019-09-18 15:27:25.507 23544-23594/? I/Unity: Using configuration builder objects
    2019-09-18 15:27:25.516 23544-23594/? I/UnityIAP: Starting in-app billing setup.
    2019-09-18 15:27:25.527 23544-23544/? I/UnityIAP: Billing service connected.
    2019-09-18 15:27:25.527 23544-24026/? I/UnityIAP: invoking callback
    2019-09-18 15:27:25.527 23544-24026/? I/UnityIAP: Checking for in-app billing 3 support.
    2019-09-18 15:27:25.529 23544-24026/? I/UnityIAP: In-app billing version 3 supported for com.xxx
    2019-09-18 15:27:25.530 23544-24026/? I/UnityIAP: Subscriptions AVAILABLE.
    2019-09-18 15:27:25.530 23544-24026/? I/UnityIAP: Subscriptions information parse AVAILABLE.
    2019-09-18 15:27:25.531 23544-24026/? I/UnityIAP: VR supported.
    2019-09-18 15:27:25.531 23544-24026/? I/UnityIAP: onIabSetupFinished: 0
    2019-09-18 15:27:25.531 23544-24026/? I/UnityIAP: Requesting 72 products
    2019-09-18 15:27:25.531 23544-24026/? I/UnityIAP: QueryInventory: 72
    2019-09-18 15:27:25.532 23544-24026/? I/UnityIAP: invoking callback
    2019-09-18 15:27:25.532 23544-24026/? I/UnityIAP: Querying owned items, item type: inapp
    2019-09-18 15:27:25.532 23544-24026/? I/UnityIAP: Package name: com.xxx
    2019-09-18 15:27:25.532 23544-24026/? I/UnityIAP: Calling getPurchases with continuation token: null
    2019-09-18 15:27:25.532 23544-24026/? I/UnityIAP: Owned items response: 0
    2019-09-18 15:27:25.533 23544-24026/? I/UnityIAP: Continuation token: null
    2019-09-18 15:27:25.533 23544-24026/? I/UnityIAP: Querying SKU details.
    2019-09-18 15:27:25.578 23544-24026/? I/UnityIAP: getSkuDetails() failed: 6:Error
    2019-09-18 15:27:25.578 23544-24026/? I/UnityIAP: onQueryInventoryFinished: false
    2019-09-18 15:27:25.578 23544-24026/? I/UnityIAP: Error refreshing inventory (querying prices of items). (response: 6:Error)
    2019-09-18 15:27:25.578 23544-24026/? I/UnityIAP: Failed to Query inventory. UnityIAP will automatically retry in 5000ms
    2019-09-18 15:27:25.578 23544-24026/? I/UnityIAP: QueryInventory: 72
    2019-09-18 15:27:25.578 23544-24026/? I/UnityIAP: invoking callback
    2019-09-18 15:27:30.578 23544-24026/? I/UnityIAP: Querying owned items, item type: inapp
    2019-09-18 15:27:30.578 23544-24026/? I/UnityIAP: Package name: com.xxx
    2019-09-18 15:27:30.578 23544-24026/? I/UnityIAP: Calling getPurchases with continuation token: null
    2019-09-18 15:27:30.580 23544-24026/? I/UnityIAP: Owned items response: 0
    2019-09-18 15:27:30.580 23544-24026/? I/UnityIAP: Continuation token: null
    2019-09-18 15:27:30.580 23544-24026/? I/UnityIAP: Querying SKU details.
    2019-09-18 15:27:30.618 23544-24026/? I/UnityIAP: getSkuDetails() failed: 6:Error
    2019-09-18 15:27:30.618 23544-24026/? I/UnityIAP: onQueryInventoryFinished: false
    2019-09-18 15:27:30.618 23544-24026/? I/UnityIAP: Error refreshing inventory (querying prices of items). (response: 6:Error)
    2019-09-18 15:27:30.618 23544-24026/? I/UnityIAP: Failed to Query inventory. UnityIAP will automatically retry in 10000ms
    2019-09-18 15:27:30.619 23544-24026/? I/UnityIAP: QueryInventory: 72
    2019-09-18 15:27:30.619 23544-24026/? I/UnityIAP: invoking callback
    2019-09-18 15:27:40.619 23544-24026/? I/UnityIAP: Querying owned items, item type: inapp
    2019-09-18 15:27:40.619 23544-24026/? I/UnityIAP: Package name: com.xxx
    2019-09-18 15:27:40.619 23544-24026/? I/UnityIAP: Calling getPurchases with continuation token: null
    2019-09-18 15:27:40.620 23544-24026/? I/UnityIAP: Owned items response: 0
    2019-09-18 15:27:40.620 23544-24026/? I/UnityIAP: Continuation token: null
    2019-09-18 15:27:40.620 23544-24026/? I/UnityIAP: Querying SKU details.
    2019-09-18 15:27:40.668 23544-24026/? I/UnityIAP: getSkuDetails() failed: 6:Error
    2019-09-18 15:27:40.668 23544-24026/? I/UnityIAP: onQueryInventoryFinished: false
    2019-09-18 15:27:40.668 23544-24026/? I/UnityIAP: Error refreshing inventory (querying prices of items). (response: 6:Error)
    2019-09-18 15:27:40.668 23544-24026/? I/UnityIAP: Failed to Query inventory. UnityIAP will automatically retry in 20000ms
    2019-09-18 15:27:40.668 23544-24026/? I/UnityIAP: QueryInventory: 72
    2019-09-18 15:27:40.668 23544-24026/? I/UnityIAP: invoking callback
    2019-09-18 15:28:00.668 23544-24026/? I/UnityIAP: Querying owned items, item type: inapp
    2019-09-18 15:28:00.668 23544-24026/? I/UnityIAP: Package name: com.xxx
    2019-09-18 15:28:00.668 23544-24026/? I/UnityIAP: Calling getPurchases with continuation token: null
    2019-09-18 15:28:00.670 23544-24026/? I/UnityIAP: Owned items response: 0
    2019-09-18 15:28:00.670 23544-24026/? I/UnityIAP: Continuation token: null
    2019-09-18 15:28:00.670 23544-24026/? I/UnityIAP: Querying SKU details.
    2019-09-18 15:28:00.713 23544-24026/? I/UnityIAP: getSkuDetails() failed: 6:Error
    2019-09-18 15:28:00.713 23544-24026/? I/UnityIAP: onQueryInventoryFinished: false
    2019-09-18 15:28:00.713 23544-24026/? I/UnityIAP: Error refreshing inventory (querying prices of items). (response: 6:Error)
    2019-09-18 15:28:00.713 23544-24026/? I/UnityIAP: Failed to Query inventory. UnityIAP will automatically retry in 40000ms
    2019-09-18 15:28:00.713 23544-24026/? I/UnityIAP: QueryInventory: 72
    2019-09-18 15:28:00.713 23544-24026/? I/UnityIAP: invoking callback


    ================================================================================
    Our project took place while using 1.20.
    We upgraded to 1.22 and tested it, but we read this article and downgraded it to 1.19, and the same thing happens.

    When the user's Google account is logged out, the user does not receive a callback and continues to loop indefinitely.
    We have a continuous stream of user inquiries, so please resolve them within a short period of time.

    The attached error is from 1.19.
     
    Last edited: Sep 18, 2019
  14. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    7,146
    Yes, we are hoping to address this behavior in the next release due out in a few weeks.
     
    nolifeYoshi likes this.
  15. Kevin-HyperHippo

    Kevin-HyperHippo

    Joined:
    Jan 16, 2014
    Posts:
    8
    When you say "inform the user to check their Google account and password on the device", what exactly should we be informing the user to do? We are also starting to get numerous reports about this error and would like to give our players instructions to fix the issue but so far we have been unable to find reliable working steps for the devices in the office. Things we have tried include removing/adding the Google account and clearing the cache for the Google Play Store app.

    I also tried finding references to this issue on the various Google issue trackers and StackOverflow but came up empty. Has Google made any kind of official acknowledgement of this issue and/or workarounds?
     
  16. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    7,146
    Pop up a dialog and say something like "Please check your Google account on this device on Google Play". Have you done this in your testing? When you launch Google Play and view My Apps and Programs, what user is logged in? If there is an account issue and I've changed my password recently online for example, I get prompted to log in again with my new password. In my testing, this affects unlocked devices (no screen swipe or pin unlock)
     
  17. Kevin-HyperHippo

    Kevin-HyperHippo

    Joined:
    Jan 16, 2014
    Posts:
    8
    We have tried removing and re-adding/resigning-in accounts that are affected but it didn't seem to resolve the issue. It's possible the problem we are experiencing is being caused by something different but the log files look the same from our end:

     
  18. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    7,146
    Can you elaborate what you mean by "accounts"? Are you able to follow my specific advice regarding Google Play? Keep in mind that "Accounts" under Android Settings is not applicable here. That only allows you to set additional email accounts. Some Android devices allow you to actually switch users, and have a Users section under Android Settings (and NOT Accounts). Switching users under Accounts does not affect IAP. The user we are using is the one logged into Google Play, please confirm.
     
  19. philiphippo

    philiphippo

    Joined:
    Mar 21, 2016
    Posts:
    6
    I'll be taking over for Kevin for now as I've been more focused on this task.

    What we have done is gone into Settings -> Users & Accounts then removed all accounts on the device. If I do that, our game works aside from being unable to purchase anything. We also tried clearing all data from the Google Play Store under the All Apps section just in case.
    If I then re-add the same account under the Settings -> Users & Accounts section, our game once again has the problem of no response from the initialize call to UnityIAP.

    I have gone into the Google Play Store and checked out what is there. I have the same account logged in now as I have under the Users & Accounts in Settings. I checked my app and it did not ask me to log in.

    I do have a screen lock on our test device.
     
  20. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    7,146
    Can you try with a different tester account? Does this same account show the same behavior on multiple Android devices?
     
  21. philiphippo

    philiphippo

    Joined:
    Mar 21, 2016
    Posts:
    6
    It does show the same behaviour on multiple devices. Same account, different device, same problem.

    If we have a device with the problem account and switch accounts on that device, it works fine.
     
  22. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    7,146
    So it does appear to be account related. Is this user able to make IAP purchases in other games, perhaps an invalid credit card or other account issue? Also, have both accounts (one working and none not) made the same type of purchases (subscription, etc)?
     
  23. philiphippo

    philiphippo

    Joined:
    Mar 21, 2016
    Posts:
    6
    I can make purchases in other games, including both ours and other companies games.

    I'm not sure about the same type of purchases. I'll try and look into that as soon as I can.
     
  24. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    7,146
    When you mention "including ours..", do you mean other of your games with Unity IAP enabled, but only this game has a problem?
     
  25. philiphippo

    philiphippo

    Joined:
    Mar 21, 2016
    Posts:
    6
    Correct. Both use UnityIAP but only one of our games is having the issue.

    As for checking purchases, these devices have been used for a while and there are too many purchases to reasonably check against. I also know some live users who have not purchases anything seem to be having the same issue (Same symptoms at least).
     
  26. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    7,146
    Interesting, are your other games using a previous version of IAP by chance? If you grep the Android logcat device logs for "unityiap" you'll see the version.
     
  27. philiphippo

    philiphippo

    Joined:
    Mar 21, 2016
    Posts:
    6
    They are different, it is true. Our other game is using 1.20.1 while the game we are having issues with is using 1.22.0
     
  28. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    7,146
    Good information, let me do some testing.
     
  29. philiphippo

    philiphippo

    Joined:
    Mar 21, 2016
    Posts:
    6
    Have you gotten any further with your investigation? Anything else we could do to try and help figure things out?
     
  30. GarlicDipping

    GarlicDipping

    Joined:
    Sep 7, 2013
    Posts:
    31
    Any updates? We guided our users to logout-login google play store, blah blah, No, it doesn't work.
    Now I'm starting to think this is not user-account related issue.

    Seems like unity's getting into somewhere regarding recent conversation here, but I'd be really happy to know any fix will be avaliable soon cause my last option for now is just rollback IAP plugin to 1.20.1.
     
  31. zyc_dc

    zyc_dc

    Joined:
    May 11, 2018
    Posts:
    42
    Some of our players are experiencing the same issue. Really need to address this issue ASAP. Or should we all rollback to 1.19?
     
  32. zyc_dc

    zyc_dc

    Joined:
    May 11, 2018
    Posts:
    42
    Based on our latest analytics, there are about 5.5% of Google player users can not receive initialization callback. We're using IAP 1.22 and Unity 2019.2.5f1
     
  33. GarlicDipping

    GarlicDipping

    Joined:
    Sep 7, 2013
    Posts:
    31
    5% is similar init fail rate due to our logs also, mate. (IAP 1.22.0, Unity 2017.4.26f1)
    We've processed some tests, requested to one of our user. Downgrading from 1.22.0 to 1.20.1 does not work, deleting app cache and datas then re-install, also does not work.

    One strange thing, due to our logs it seems like initialization fail callback is never called. Guess this is not network failure, because our game checks network connection regularly.

    But who knows, it's either user or me who made dumb mistakes during the test. I've doubted sd card thing(because re-installing never worked), but honestly idk because this behaviour never reproduces on our test devices...
     
  34. zyc_dc

    zyc_dc

    Joined:
    May 11, 2018
    Posts:
    42
    Clearing cache did solve one user's problem. IAP does need to provide more error codes. Otherwise, we could not know what's happening. Sometimes users just don't log in the google play account.
     
  35. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    7,146
    We pass along all the return codes that the stores provide to us. Make sure you handle the initialization and purchase failure callbacks. Users will be prompted if they are not logged in, this is handled by the system.
     
  36. zyc_dc

    zyc_dc

    Joined:
    May 11, 2018
    Posts:
    42
    For the case that clearing cache solves the problem, the user could not receive any callback.
     
  37. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    7,146
    Understood. Please provide device logs when you see the issue, if possible.
     
  38. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    7,146
    Also, ensure that you are NOT calling Application.Quit, as discussed on the forum elsewhere. It is not specific to IAP and is in the Unity engine. It will cause the next app launch to fail IAP initialization. It's my understanding that this is is being fixed in Unity 2019.3. A quick test to see if this applies is to simply restart the phone and see if it still occurs. Otherwise, any specific steps to reproduce would be appreciated, the only way so far we've been able to reproduce is by changing the account password online.
     
  39. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    7,146
    I suspect you are still seeing error:6 in the logs. We have a fix ready for the next release. I see the same behavior across all IAP versions. Currently if we see that error, we continuously poll, and neither OnInitialized or OnInitializedFailed is called. In the next release, we catch the error and call OnInitializedFailed with a new error code. Our suggestion when you see that error code, pop up a dialog to let the user know they need to check their password. However, as users have noted, this doesn't always address the error. It looks to be a possible issue on the Google side. Another possibility is auto-backup behavior, but not likely. I haven't confirmed, but have read other posts about the new Android auto-backup causing issues. Not sure if related, but something to check for affected users. https://forum.unity.com/threads/unity-2019-x-il2cpp-crash-on-android-8.673972/
     
    Last edited: Sep 28, 2019
  40. tayl0r

    tayl0r

    Joined:
    Jan 6, 2012
    Posts:
    81
    It's not just you. We've done all of the same things and we're experiencing the exact behavior. No callback is ever called. It just sits there. I also experimented with adding a forced 30 second retry - no difference.

    We're on Unity 2017.4.32f1 with IAP 1.20.1.

    Also, every time we release an app update on Google Play. All versions of the app (old & new) will experience 2x to 4x higher rates of this error. Then it goes back to normal 1-2 weeks later.
     
  41. tayl0r

    tayl0r

    Joined:
    Jan 6, 2012
    Posts:
    81
    @JeffDUnity3D - 2 questions for you:

    1) ETA on the new IAP plugin release with these fixes?

    2) Android apps usually have QUIT buttons, and if you're saying we shouldn't call Application.Quit(), is there a recommended workaround? Just allocate memory until it crashes?

    Edit - we can't reproduce the Quit() error. We're on Unity 2017 and I think this is only for Unity 2018+.
     
    Last edited: Sep 30, 2019
  42. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    7,146
    I had mentioned the Application.Quit workaround (Unity 2019.3) as it has issues on previous Unity versions. And I'm not clear on your "allocate memory until it crashes", you mean to quit your app by purposely using memory and expecting the system to exit your app? That does not sound like a good solution to me. And to be clear, we are only returning a specific error code in the next IAP release when error:6 is returned from QueryPurchaseHistory. You'll need to catch it and put up a dialog box to notify the user to check their Google account.
     
  43. tayl0r

    tayl0r

    Joined:
    Jan 6, 2012
    Posts:
    81
    What exactly do they need to do to "check their Google account"? Just make sure they can access the Google Play Store?
     
  44. tayl0r

    tayl0r

    Joined:
    Jan 6, 2012
    Posts:
    81
    Do you think this could also be IPv6 related? I've noticed that a lot of players with this problem are on IPv6, a higher % than usual.
     
  45. tayl0r

    tayl0r

    Joined:
    Jan 6, 2012
    Posts:
    81
    @JeffDUnity3D I actually do not think that this QueryPurchaseHistory / error:6 Unity IAP Android Initialization error can explain all the weirdness we're seeing with the Unity IAP Initialize.

    There are 2 different errors that can be returned from the Init() call on Android: NoProductsAvailable and PurchasingUnavailable.
    But, some players never receive the Init() callback at all - no error and no success. So, I added a 30 second timer to create a 3rd error, Timeout.
    Here is a chart that shows you, per day, how many of each type of error we're getting (unique per user per day).

    You can see that NoProductsAvailable is very small, we can ignore that.
    PurchasingUnavailable is fairly constant. I'm not sure what triggers this but at least it gives an error. This could be people who need to check their Google Play account?
    The Timeout is the weird one. You can see that it sometimes spikes up to double what it normally is.

    Sometimes the player puts in a support ticket, we tell them to reset their Google Play cache and check their account, sometimes it works but sometimes it doesn't.

    Here is another chart that shows only the Timeout errors, by application version. It also only shows people who only have errors on that day, zero successful Init() responses.

    The weird thing is that both the spikes in Timeout errors correspond with one of our application releases. And not only did it spike for just the new version, it spiked for every version.

    So, any thoughts here?

    Do you think that both the Timeout and PurchasingUnavailable is explained by the QueryPurchaseHistory error:6? Or only one of them?

    In the next release I am going to add the dialog you are suggesting, that the person check their Google Play account, if they get either of those errors. But I really do not think it will do anything for the timeouts spikes. I think there is still something else going on there.
     
  46. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    7,146
    That is exactly (and unfortunately) the current behavior. In the current release, we poll indefinitely when we see error:6 or other error condition when calling purchase history. By checking Google account, I meant, confirm that the user is properly logged into Google Play on the device. We have no control over the timeout behavior that you are mentioning if that is indeed the case, we are calling the store API's directly. We are hearing reports of users still receiving the error even after checking their Google account. That is currently the status of the issue, it looks like something possibly on the Google side, but we are continuing to investigate here. If you have specific steps to reproduce, it would be invaluable.
     
unityunity