4

我正在使用 Prime[31] 插件在 Unity 中测试一个应用程序,用户可以在其中购买声音。如果单击声音按钮,PurchasableSound则会调用一个 .cs 文件来确定声音是否已购买。(仅供参考,它尝试使用 来做到这一点PlayerPrefs.GetInt,但是,我还没有设法让它工作)。如果声音还没有被购买,我会调用另一个 .cs 文件,PurchaseSounds它会统一激活一个面板,用户可以在其中选择购买所有可购买的声音中的 4 个或 10 个。在那段代码中,GoogleIAB.init(key)GoogleIAB.queryInventory(skus)被执行并且可以购买上述两种产品中的一种。

但是,在我的 Android 设备上执行整个场景期间,Signature verification失败了:

    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)

我不明白为什么会这样。我很确定我添加的 Base64 许可证密钥没有任何问题。基于09-06 18:10:12.332: I/Unity(10536): billingSupportedEvent,GoogleIAB 初始化,但queryInventoryFailedEvent: Error refreshing inventory (querying owned items). (response: -1003:Purchase signature verification failed)很明显我的 sku 无法获取。出了什么问题,为什么?这是否与错误填写的 Unity 中的密钥库或密钥设置有关?

4

1 回答 1

0

1. 我注意到

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.

所以,我猜你的公钥是错误的,试着检查你的公钥。您可以添加一些登录 android 代码。我以前没有使用过 prime[31],但我想有一个

mHelper = new IabHelper(this, GoogleBase64PublicKey);

应该调用谷歌提供的代码。您可以注销之前的密钥。

2. 确保您的 sku 拼写正确。此外,您应该发布这些项目

3. 你可以在这里找到我几天前写的一个开源项目,也许它可以提供一些帮助。

于 2015-01-07T04:31:08.227 回答