Search Unity

facing with lots of error after updating IAP to 3.1.0

Discussion in 'Unity IAP' started by ElegantUniverse, Apr 23, 2021.

Thread Status:
Not open for further replies.
  1. ElegantUniverse

    ElegantUniverse

    Joined:
    Sep 13, 2018
    Posts:
    78
    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:

    https://ibb.co/vmvG4Hp

    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:<unknown type> member:(null) signature:<none>

    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.
     
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
  3. nicholasr

    nicholasr

    Joined:
    Aug 15, 2015
    Posts:
    183
    To build on @JeffDUnity3D 's advice with these upgrade instructions https://forum.unity.com/threads/a-c...-unity-iap-plugin-3-0-0.1009678/#post-6918290 - performing Reimport All on the project should erase the Library/ folder.

    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.
     
    ElegantUniverse likes this.
  4. ElegantUniverse

    ElegantUniverse

    Joined:
    Sep 13, 2018
    Posts:
    78
  5. Gillissie

    Gillissie

    Joined:
    May 16, 2011
    Posts:
    305
    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).
     
    Last edited: Apr 26, 2021
  6. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    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
     
  7. Gillissie

    Gillissie

    Joined:
    May 16, 2011
    Posts:
    305
    @nicholasr suggested Reimport All in a comment above.

    The example project builds without that particular error in XCode. What's the next step to fix this?

    Sorry, but I can't figure out how to post an image in these forums. It only seems to accept a URL to an image.
     
  8. Gillissie

    Gillissie

    Joined:
    May 16, 2011
    Posts:
    305
    Oh, there it is... the "Upload a File" button next to "Post Reply". Screen Shot 2021-04-27 at 9.43.28 AM.png
     
  9. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    What is different between the Sample Project and yours? Are you following the same build steps, building to an XCode project from Unity on a Mac?
     
  10. Gillissie

    Gillissie

    Joined:
    May 16, 2011
    Posts:
    305
    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.
     
  11. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    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
     
  12. Gillissie

    Gillissie

    Joined:
    May 16, 2011
    Posts:
    305
    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. Screen Shot 2021-04-27 at 1.09.36 PM.png

    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.
    Screen Shot 2021-04-27 at 1.13.26 PM.png
     
  13. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    That might be, and something you'll want to test by adding the FB SDK to the Sample IAP Project, for example.
     
  14. Gillissie

    Gillissie

    Joined:
    May 16, 2011
    Posts:
    305
    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.
     
  15. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Will do. I'll update the v1 sample (which is using IAP 1.18) and upgrade to 2.x and then to 3.1.0 and build to iOS. I'll report my findings.
     
  16. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    @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?
     
  17. Gillissie

    Gillissie

    Joined:
    May 16, 2011
    Posts:
    305
    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.
     
  18. Gillissie

    Gillissie

    Joined:
    May 16, 2011
    Posts:
    305
    Interesting... it appears that the file does exist in the project.
    Screen Shot 2021-04-27 at 9.09.00 PM.png
     
  19. Gillissie

    Gillissie

    Joined:
    May 16, 2011
    Posts:
    305
    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.
     
    MeyranGames and JeffDUnity3D like this.
  20. ElegantUniverse

    ElegantUniverse

    Joined:
    Sep 13, 2018
    Posts:
    78
    hello @JeffDUnity3D I'm facing with this error without any reasons.
    is this problem could be related to switching platform to android?


    error:
    Error is The method or operation is not implemented.
     

    Attached Files:

  21. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Yes, that is a separate issue. Please compare to the Sample IAP Project. You need to wrap the validator in a Try/Catch block. Validation is not supported in the Editor (there are no receipts). I'm locking this thread so it does not become a catch-all for issues.
     
Thread Status:
Not open for further replies.