我正在使用 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 中的密钥库或密钥设置有关?