hello there are lots of errors with the new IAP package.
I deleted In app purchase folder from library and deleted plugins/unitypurchasing folder and installed and imported all of them again and still has lots of errors
unity version : 2020.1.0 f1
screenshot:
the first error
Error: Could not load signature of UnityEditor.Purchasing.GooglePlayProductCatalogExporter:productTypeString due to: Could not load file or assembly ‘UnityEngine.Purchasing, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null’ or one of its dependencies. assembly:UnityEngine.Purchasing, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null type: member:(null) signature:
the second error
Library\PackageCache\com.unity.purchasing@3.1.0\Runtime\AppleCore\INativeAppleStore.cs(5,42): error CS0122: ‘UnityPurchasingCallback’ is inaccessible due to its protection level
the third error
Microsoft (R) Visual C# Compiler version 2.9.1.65535 (9d34608e)
Copyright (C) Microsoft Corporation. All rights reserved.
error CS1704: An assembly with the same simple name ‘Purchasing.Common’ has already been imported. Try removing one of the references (e.g. ‘D:.…\Library\ScriptAssemblies\Purchasing.Common.dll’) or sign them to enable side-by-side.
Make sure the Assets/Plugins/UnityPurchasing does not exist, and don’t reimport after doing so. Don’t install or update from the Services window. Just use Package Manager. Please show a screenshot of the Sample IAP Project v2, running in the Editor Sample IAP Project
Seeing Library\ScriptAssemblies\Purchasing.Common.dll means this DLL file is being used by Unity, and that DLL file will be deleted when Assets/Plugins/UnityPurchasing is deleted. Unity should automatically import the project, and remove the files which are no longer located under Assets/Plugins/UnityPurchasing. However, if Unity does not automatically delete, then Reimport All should rebuild the Library folder, based upon what is inside the project’s Assets/ and Packages.
This information seems critically missing from the installation instructions in package manager. Why would the UI show the Import button if we’re not supposed to use it? At the very least, it should import an empty asset with just a note that explains why it’s empty.
Also, is a reimport all necessary for this upgrade? I’m getting this error in XCode:
Build input file cannot be found: ‘/[path to build]/iOS/Libraries/Plugins/UnityPurchasing/iOS/UnityPurchasing.m’
I did a reimport all, but still get the above error in XCode, even with a new build (no append or replace).
I’m not sure what you mean by Reimport all, it’s not necessary. The UI is showing the Import button because we have work to do. Please open the Sample IAP Project and link it to your organization. Please show a screenshot of the Sample IAP Project running in the Editor. Then build it to XCode on your Mac as a test, see if you experience the same thing
Well, there’s a LOT different about my project compared to the simple example project. Probably most notable is that my project had the 2.x version of IAP installed before I started doing this. However, my implementation is very straightforward, and it works fine on an Android build. There’s something about the XCode build that is expecting that file to be there, but obviously it’s not. This must be an issue with upgrading from 2.x.
Agreed likely an upgrade issue, we need to find out what it is. I’m not able to reproduce. I trust you have done a new build with the Replace option? Can you try building to a new location? And you’ve confirmed you have no /Assets/Plugins/UnityPurchasing folder in your Unity project. What versions of MacOS, Unity, and XCode are you using? I’m on Catalina 10.15.7, Unity 2020.1 and XCode 12.4
I have completely deleted my build folder to make sure it’s a whole new build, but same result. I don’t know if XCode can cache something outside of the project folder that would affect this?
The /Assets/Plugins/UnityPurchasing folder is definitely gone.
I’m on Catalina 10.15.7, Unity 2020.1.15f1, XCode 12.4.
It may be worth noting that I have the facebook SDK installed in this project, which seems to result in building a xcworkspace that is opened, instead of opening the xcodeproj file directly. I assume this difference is due to facebook’s CocoaPods dependencies in the project.
I don’t think it’s simply by having the facebook SDK. If it’s a contributor, I think it would be from having IAP 2.x AND facebook SDK, then upgrading IAP to 3.x.
I think you should test this with a IAP 2.x test project.
@Gillissie I am not able to reproduce using the steps I provided. I did not use the FB SDK, I will leave that up to you. My specific file is located at Unity-iPhone/Libraries/com.unity.purchasing/Plugins/UnityPurchasing/IOS/UnityPurchasing.m , Is this path missing in your problem project?
Wait, did you build to iOS successfully for each version of IAP, with the facebook SDK installed too? Because that may be the key here. I don’t understand why you would go through all those steps to reproduce the issue but leave out the facebook SDK part, and say you’ll leave it up to me. I don’t have a IAP test project from 1.x and 2.x to do anything with.
Ok, I think I found a solution, although it wasn’t obvious…
In the XCode project I did Product → Clean Build Folder.
Then the error went away. This tells me that XCode was indeed caching something for this project outside of the project folder.