Unity 4.2 Android In-App Billing: Signature Verification Failed

I am testing the application in Unity using the plugin [31], in which the user can acquire sounds. If you click the sound button, the .cs PurchasableSound file is PurchasableSound , which determines whether the sound was purchased or not. (FYI tries to do this using PlayerPrefs.GetInt , however I was not able to get it to work). If the sound has not yet been purchased, I call another .cs file, PurchaseSounds , which activates the panel in unity, in which the user can choose to buy 4 or 10 of all purchased sounds. In this code snippet, GoogleIAB.init(key) and GoogleIAB.queryInventory(skus) are executed, and one of the two products mentioned above can be purchased.

However, during the execution of the entire scene on my Android device, Signature verification fails:

  09-06 18:10:08.998: I/Unity(10536): 09-06 18:10:08.998: I/Unity(10536): (Filename: ./Runtime/ExportGenerated/AndroidManaged/UnityEngineDebug.cpp Line: 54) 09-06 18:10:09.008: E/Prime31-SEC(10536): Signature verification failed. 09-06 18:10:09.008: W/Prime31-SEC(10536): signature does not match data. 09-06 18:10:09.008: W/Prime31-IABH(10536): In-app billing warning: Purchase signature verification **FAILED**. Not adding item. 09-06 18:10:09.028: I/Unity(10536): PurchasableSound has been called. 09-06 18:10:09.028: I/Unity(10536): 09-06 18:10:09.028: I/Unity(10536): (Filename: ./Runtime/ExportGenerated/AndroidManaged/UnityEngineDebug.cpp Line: 54) 09-06 18:10:09.028: I/Unity(10536): PurchasableSound has been called. 09-06 18:10:09.028: I/Unity(10536): 09-06 18:10:09.028: I/Unity(10536): (Filename: ./Runtime/ExportGenerated/AndroidManaged/UnityEngineDebug.cpp Line: 54) 09-06 18:10:09.028: I/Unity(10536): PurchasableSound has been called. 09-06 18:10:09.028: I/Unity(10536): 09-06 18:10:09.028: I/Unity(10536): (Filename: ./Runtime/ExportGenerated/AndroidManaged/UnityEngineDebug.cpp Line: 54) 09-06 18:10:09.339: I/Unity(10536): billingSupportedEvent 09-06 18:10:09.339: I/Unity(10536): 09-06 18:10:09.339: I/Unity(10536): (Filename: ./Runtime/ExportGenerated/AndroidManaged/UnityEngineDebug.cpp Line: 54) 09-06 18:10:09.359: I/Unity(10536): queryInventoryFailedEvent: Error refreshing inventory (querying owned items). (response: -1003:Purchase signature verification failed) 09-06 18:10:09.359: I/Unity(10536): 09-06 18:10:09.359: I/Unity(10536): (Filename: ./Runtime/ExportGenerated/AndroidManaged/UnityEngineDebug.cpp Line: 54) 09-06 18:10:11.181: D/dalvikvm(6337): GC_EXPLICIT freed 25K, 46% free 3096K/5639K, external 0K/0K, paused 54ms 09-06 18:10:11.881: E/NativeActivity(10536): channel '4068a288 com.gumasd.beta/com.unity3d.player.UnityPlayerNativeActivity (client)' ~ Failed to receive dispatch signal. status=-11 09-06 18:10:12.212: E/NativeActivity(10536): channel '4068a288 com.gumasd.beta/com.unity3d.player.UnityPlayerNativeActivity (client)' ~ Failed to receive dispatch signal. status=-11 09-06 18:10:12.222: E/NativeActivity(10536): channel '4068a288 com.gumasd.beta/com.unity3d.player.UnityPlayerNativeActivity (client)' ~ Failed to receive dispatch signal. status=-11 09-06 18:10:12.232: I/Unity(10536): PurchasableSound: Click 09-06 18:10:12.232: I/Unity(10536): 09-06 18:10:12.232: I/Unity(10536): (Filename: ./Runtime/ExportGenerated/AndroidManaged/UnityEngineDebug.cpp Line: 54) 09-06 18:10:12.232: I/Unity(10536): PurchasableSound: Sound has not yet been purchased. 09-06 18:10:12.232: I/Unity(10536): 09-06 18:10:12.232: I/Unity(10536): (Filename: ./Runtime/ExportGenerated/AndroidManaged/UnityEngineDebug.cpp Line: 54) 09-06 18:10:12.282: I/Unity(10536): PurchaseSounds has been called. 09-06 18:10:12.282: I/Unity(10536): 09-06 18:10:12.282: I/Unity(10536): (Filename: ./Runtime/ExportGenerated/AndroidManaged/UnityEngineDebug.cpp Line: 54) 09-06 18:10:12.282: I/keystore(1255): uid: 1000 action: e -> 7 state: 3 -> 3 retry: 4 09-06 18:10:12.292: D/Finsky(3418): [32] InAppBillingUtils.getPreferredAccount: com.gumasd.beta: Account from first account - [1sBSp5jt9jfvUfoG2wXSTiotEok] 09-06 18:10:12.292: I/Unity(10536): GoogleIAB: init was called. 09-06 18:10:12.292: I/Unity(10536): 09-06 18:10:12.292: I/Unity(10536): (Filename: ./Runtime/ExportGenerated/AndroidManaged/UnityEngineDebug.cpp Line: 54) 09-06 18:10:12.292: I/Unity(10536): GoogleIAB: queryInventory was called. 09-06 18:10:12.292: I/Unity(10536): 09-06 18:10:12.292: I/Unity(10536): (Filename: ./Runtime/ExportGenerated/AndroidManaged/UnityEngineDebug.cpp Line: 54) 09-06 18:10:12.302: D/Finsky(3418): [36] InAppBillingUtils.getPreferredAccount: com.gumasd.beta: Account from first account - [1sBSp5jt9jfvUfoG2wXSTiotEok] 09-06 18:10:12.312: D/Finsky(3418): [37] InAppBillingUtils.getPreferredAccount: com.gumasd.beta: Account from first account - [1sBSp5jt9jfvUfoG2wXSTiotEok] 09-06 18:10:12.322: D/Finsky(3418): [37] InAppBillingUtils.getPreferredAccount: com.gumasd.beta: Account from first account - [1sBSp5jt9jfvUfoG2wXSTiotEok] 09-06 18:10:12.332: I/Unity(10536): billingSupportedEvent 09-06 18:10:12.332: I/Unity(10536): 09-06 18:10:12.332: I/Unity(10536): (Filename: ./Runtime/ExportGenerated/AndroidManaged/UnityEngineDebug.cpp Line: 54) 09-06 18:10:12.352: E/Prime31-SEC(10536): Signature verification failed. 09-06 18:10:12.352: W/Prime31-SEC(10536): signature does not match data. 09-06 18:10:12.352: W/Prime31-IABH(10536): In-app billing warning: Purchase signature verification **FAILED**. Not adding item. 09-06 18:10:12.372: E/Prime31-SEC(10536): Signature verification failed. 09-06 18:10:12.372: W/Prime31-SEC(10536): signature does not match data. 09-06 18:10:12.372: W/Prime31-IABH(10536): In-app billing warning: Purchase signature verification **FAILED**. Not adding item. 09-06 18:10:12.382: E/Prime31-SEC(10536): Signature verification failed. 09-06 18:10:12.382: W/Prime31-SEC(10536): signature does not match data. 09-06 18:10:12.382: W/Prime31-IABH(10536): In-app billing warning: Purchase signature verification **FAILED**. Not adding item. 09-06 18:10:12.412: E/Prime31-SEC(10536): Signature verification failed. 09-06 18:10:12.412: W/Prime31-SEC(10536): signature does not match data. 09-06 18:10:12.412: W/Prime31-IABH(10536): In-app billing warning: Purchase signature verification **FAILED**. Not adding item. 09-06 18:10:12.432: D/dalvikvm(10536): GC_CONCURRENT freed 262K, 46% free 3072K/5639K, external 2K/514K, paused 3ms+4ms 09-06 18:10:12.432: E/Prime31-SEC(10536): Signature verification failed. 09-06 18:10:12.432: W/Prime31-SEC(10536): signature does not match data. 09-06 18:10:12.432: W/Prime31-IABH(10536): In-app billing warning: Purchase signature verification **FAILED**. Not adding item. 09-06 18:10:12.442: E/Prime31-SEC(10536): Signature verification failed. 09-06 18:10:12.442: W/Prime31-SEC(10536): signature does not match data. 09-06 18:10:12.442: W/Prime31-IABH(10536): In-app billing warning: Purchase signature verification **FAILED**. Not adding item. 09-06 18:10:12.452: E/Prime31-SEC(10536): Signature verification failed. 09-06 18:10:12.452: W/Prime31-SEC(10536): signature does not match data. 09-06 18:10:12.452: W/Prime31-IABH(10536): In-app billing warning: Purchase signature verification **FAILED**. Not adding item. 09-06 18:10:12.452: E/Prime31-SEC(10536): Signature verification failed. 09-06 18:10:12.452: W/Prime31-SEC(10536): signature does not match data. 09-06 18:10:12.452: W/Prime31-IABH(10536): In-app billing warning: Purchase signature verification **FAILED**. Not adding item. 09-06 18:10:12.462: I/Unity(10536): queryInventoryFailedEvent: Error refreshing inventory (querying owned items). (response: -1003:Purchase signature verification failed) 

I do not understand why this is happening. I am sure there is nothing wrong with the Base64 license key that I added. Based on 09-06 18:10:12.332: I/Unity(10536): billingSupportedEvent , GoogleIAB is initialized, but from queryInventoryFailedEvent: Error refreshing inventory (querying owned items). (response: -1003:Purchase signature verification failed) queryInventoryFailedEvent: Error refreshing inventory (querying owned items). (response: -1003:Purchase signature verification failed) it is clear that my skus cannot be extracted. What is going wrong and why? Is this due to key store settings or keys in Unity that were filled in by mistake?

+4
source share
1 answer

1. I noticed

 09-06 18:10:09.008: E/Prime31-SEC(10536): Signature verification failed. 09-06 18:10:09.008: W/Prime31-SEC(10536): signature does not match data. 

So, I assume that your public key is incorrect, try checking your public key. You can add an Android login code. I have not used prime before [31], but I assume that

 mHelper = new IabHelper(this, GoogleBase64PublicKey); 
The code

offered by google must be called. You can log out before that.

2. Make sure your spell spells are right. In addition, you must post articles.

3. You can find an open source project here that I wrote a few days before, maybe this can help.

0
source

Source: https://habr.com/ru/post/1500971/


All Articles