Unityのパッケージ「In App Purchasing」をPackage Managerを使って、バージョン4.4.1にアップデートしたところ、ビルドエラーが出てしまいました。
その時の対応です。
------------------------------------
Library/PackageCache/com.unity.purchasing@4.4.1/Runtime/SecurityStub/AppleValidator.cs(53,16): error CS0433: The type 'AppleReceipt' exists in both 'Security, Version=1.0.7268.24073, Culture=neutral, PublicKeyToken=null' and 'UnityEngine.Purchasing.SecurityCore, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'
------------------------------------
■対応
・Unityを終了
・Finderから、Unityプロジェクト/Library/PackageCache の中身をすべて削除
・Unityを起動
すると、別のエラーが出ました。
------------------------------------
Library/PackageCache/com.unity.purchasing@4.4.1/Runtime/SecurityStub/CrossPlatformValidator.cs(43,16): error CS0433: The type 'IPurchaseReceipt' exists in both 'Security, Version=1.0.7268.24073, Culture=neutral, PublicKeyToken=null' and 'UnityEngine.Purchasing.SecurityCore, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'
------------------------------------
変数「Security」の宣言が重複してるのかな?
■対応
・Unityを終了
・Finderから、2つのディレクトリを削除
→Unityプロジェクト/Plugins > UnityChannel
→Unityプロジェクト/Plugins > UnityPurchasing
・Unityを起動し、Package Manager で「In App Purchasing」を remove -> install
※参考 : https://teratail.com/questions/167808
今度は、プログラムの内容についてのエラーが出た。
------------------------------------
error CS1061: 'IGooglePlayConfiguration' does not contain a definition for 'SetPublicKey' and no accessible extension method 'SetPublicKey' accepting a first argument of type 'IGooglePlayConfiguration' could be found (are you missing a using directive or an assembly reference?)
------------------------------------
■対応
・SetPublicKeyの箇所をコメントアウト。
(「In App Purchasing 2.2.0」から、SetPublicKeyは廃止になったらしい)
※参考 : https://forum.unity.com/threads/alternative-to-setpublickey.1092364/
これでビルドエラーが消えた。
後でテストしてみよう。
2022年09月20日
[Unity] In App Purchasing 4.4.1 にアップデートして出たエラー対応
posted by be-style at 17:00| Comment(0)
| Unity
この記事へのコメント
コメントを書く