我正在使用prime [31]插件测试Unity中的应用程序,用户可以在其中购买声音。如果单击声音按钮,则会调用.cs文件PurchasableSound
,以确定是否已购买声音。 (仅供参考,它尝试使用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)
可以清楚地看出我的skus无法获取。出了什么问题,为什么?这是否与Unity中错误填充的密钥库或密钥设置有关?
答案 0 :(得分: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。您可以找到我几天前写过的开源项目here,也许它可以提供一些帮助。