Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

The type 'AppleReceiptParser' exists in both 'UnityEngine.Purchasing.Security and UnityEngine.Purch

Discussion in 'Unity IAP' started by severin1212, Jun 10, 2021.

  1. severin1212

    severin1212

    Joined:
    May 18, 2020
    Posts:
    29
    Hello
    I updated our project to the latest LTS (2020.3.11f1) , upgraded IAP because many errors showed up , deleted IAP folder in project after following all of the upgrade steps and I block on this error always showing , I tried reimporting , deleting , reverting , nothing worked , theses errors keep showing
    Library\PackageCache\com.unity.purchasing@3.2.2\Runtime\Stores\AppleAppStore\AppleStoreImpl.cs(310,34): error CS0433: The type 'AppleReceiptParser' exists in both 'UnityEngine.Purchasing.Security, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' and 'UnityEngine.Purchasing.SecurityStub, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'
    Library\PackageCache\com.unity.purchasing@3.2.2\Runtime\Stores\SubscriptionManager.cs(225,31): error CS0433: The type 'AppleReceiptParser' exists in both 'UnityEngine.Purchasing.Security, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' and 'UnityEngine.Purchasing.SecurityStub, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'

    Failed to compile player scripts
    UnityEditor.GenericMenu:CatchMenu (object,string[],int)
    SBP ErrorError
    UnityEditor.GenericMenu:CatchMenu (object,string[],int)
    ALL of this happens when I build addressables
    How can I fix this please?
     
  2. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    In the release notes, it mentions that you need to remove Assets/Plugins/UnityPurchasing as IAP is now a Package Manager package. Make a full project back up first. You might also try removing the /Library folder. To compare, open the Sample IAP Project v2 https://forum.unity.com/threads/sample-iap-project.529555/#post-6950270 . Ensure to not additionally click on any Update buttons in the Services window, there is a known issue that the button is still enabled. Only update IAP via Package Manager.
     
  3. severin1212

    severin1212

    Joined:
    May 18, 2020
    Posts:
    29
    Thanks Jeff, I already
    I already removed Assets/Plugins/UnityPurchasing from the project , I have the project on github for backup.
    I removed the library folder many times, with restart and reimport all .
    I updated the project from package manager from 3.1 to 3.2 and back to the 3.1 verified , still nothing , always same issue .
    it's as if the generated library scripts by package manager are always wrong and always the same.
    I can't fix them because they keep generating in the same version
    the sample project you shared is done with unity 2020.3.0f1 while I am in 2020.3.11f .
    can it be the problem may be?
    Also just to say , this error pops when building addressables, in unity and in ucb
     
  4. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    I would suggest to start with the Sample IAP project regardless, and get it working. The Unity version should not matter. Once you do, add your addressables, etc to narrow down the problem.
     
  5. severin1212

    severin1212

    Joined:
    May 18, 2020
    Posts:
    29
    That's what I did , it builds when on Windows but not android , Android gives me the same error :/
     
  6. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    Great! So you got the Sample project working on Android, then you were able to modify it to cause the problem? Please provide your specific steps to reproduce
     
  7. severin1212

    severin1212

    Joined:
    May 18, 2020
    Posts:
    29
    Alright so I got the sample project in , I went to package manager , added addressables Version 1.16.19 - April 15, 2021
    the verified one , tried to build without assets , it didn't build obviously, then I added to pictures under assets , marked them as addressables, went to build new build , it started then it stopped and gave me the same error .
    just double checked on both project , erased library and restarted again .
    exactly the same behavior in my project.
     
  8. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    Sorry your steps are not sufficient for me to follow. "Tried to build without assets", what does this mean? Then "I added to pictures", added what?
     
  9. severin1212

    severin1212

    Joined:
    May 18, 2020
    Posts:
    29
    so to build addressables, I needed assets in the project to be built , so I added the pictures to simulate having addressable assets . ( In our game we have 3d models , animations , sprites , textures and materials) but I didn't need all of that to reproduce it , just took your sample project, added addressables in the package manager, added 4 Images under Assets folder and marked them as addressables .
    Than went to the addressables interface and clicked on make a new build and that's what I got.
    I shared a screen shot that explains it better .
     

    Attached Files:

  10. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    I tried exactly the same process without issue. I'm using IAP 3.2.2 Please show a screenshot of your expanded Project view

    MyAddressableTest.png
     
  11. severin1212

    severin1212

    Joined:
    May 18, 2020
    Posts:
    29
    Expanded the project on the drop down side and showed the project view on the root folder, is this what you are asking for?
     

    Attached Files:

  12. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    All looks correct. Perhaps you are missing a step in your description, but I'm not able to reproduce.
     
  13. severin1212

    severin1212

    Joined:
    May 18, 2020
    Posts:
    29
    I just redid it all , same thing happened , can it be something broken in my package manager or unity?
    other people got the same error when building on IOS
    I am thinking why I am getting IOS problems when I am building on Android , why is it working correctly on windows and not android?
    https://forum.unity.com/threads/two...unity-iap-cause-an-error-in-ios-mode.1100614/
    that's where you were fixing it in IOS , probably it's the same issue since I got the same error?
     
  14. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    I agree something seems amiss, but so far we haven't been able to reproduce. Perhaps "Reset all packages to defaults" under the Help menu. Are you using assembly definitions? Are you using IAP 3.2.2?
     
  15. severin1212

    severin1212

    Joined:
    May 18, 2020
    Posts:
    29
    Alright , I did the reset , it removed all packages, I imported them all again . deleted library , reimported all , closed reopened , in both projects , still same error .
    I am not using assembly definitions and I tried both IAP 3.1 and 3.2.2 .
    Should I reinstall unity?
    EDIT : I tried reimporting everything on another pc , It gave me this error :

    1. Build Task GenerateSubAssetPathMaps failed with exception:
    2. Index was out of range. Must be non-negative and less than the size of the collection.
      I fixed it following this thread https://forum.unity.com/threads/build-task-generatesubassetpathmaps-failed-with-exception.1047320/
      it built for once, then I went back to windows to build addressables again , it broke again on the new computer . giving me the IAP Error that we've been trying to fix, my guess here is that the bug has something to do when switching platforms.
     
    Last edited: Jun 12, 2021
  16. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    We would not want to guess. If you can, please provide specific steps to reproduce. Does it only occur for you when switching platforms? So you're on Windows 10? And you try to build for iOS, then switch platforms?
     
  17. severin1212

    severin1212

    Joined:
    May 18, 2020
    Posts:
    29
    I start on windows 10 , I build addressables, it works, I switch to android , I build addressables, I get that error.
     
  18. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    Got it, I will test similarly. This info would have been helpful much earlier. Indeed, now I'm able to reproduce, I will let the engineering team know. In the meantime, it should work as expected if you don't switch platforms in a single Unity session.
     
    Last edited: Jun 15, 2021
  19. severin1212

    severin1212

    Joined:
    May 18, 2020
    Posts:
    29
    Alright I will work with that temporarily no problem .
    Thank you for your help , I will keep checking on this thread
     
  20. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    Unfortunately it still occurs even if I don't switch platforms. We are checking.
     
  21. severin1212

    severin1212

    Joined:
    May 18, 2020
    Posts:
    29
    I will keep checking on this thread daily Jeff, Thanks for the quick response.
     
  22. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    Engineering is aware of the issue. Hopefully it will be included in an upcoming release, likely at least 3-4 weeks out.
     
  23. NemesisPrime8

    NemesisPrime8

    Joined:
    Jul 1, 2021
    Posts:
    1
    Hello, I have the same problem in my project. When will the fix patch come?
     
  24. quizcanners

    quizcanners

    Joined:
    Feb 6, 2015
    Posts:
    108
    Same issue here. Strangely, only on my machine.

    Code (CSharp):
    1. Library\PackageCache\com.unity.purchasing@3.2.2\Runtime\Stores\SubscriptionManager.cs(225,31): error CS0433: The type 'AppleReceiptParser' exists in both 'UnityEngine.Purchasing.Security, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' and 'UnityEngine.Purchasing.SecurityStub, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'
    Code (CSharp):
    1. Library\PackageCache\com.unity.purchasing@3.2.2\Runtime\Stores\AppleAppStore\AppleStoreImpl.cs(310,34): error CS0433: The type 'AppleReceiptParser' exists in both 'UnityEngine.Purchasing.Security, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' and 'UnityEngine.Purchasing.SecurityStub, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'
    Code (CSharp):
    1. Failed to compile player scripts
    2. UnityEditor.GenericMenu:CatchMenu (object,string[],int)
    Code (CSharp):
    1. SBP ErrorError
     
  25. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    Make a full back up of your project, then try deleting your /Library folder.
     
  26. alexds9

    alexds9

    Joined:
    Feb 9, 2019
    Posts:
    16
    I have the same problem:
    Library/PackageCache/com.unity.purchasing@3.2.3/Runtime/Stores/SubscriptionManager.cs(225,31): error CS0433: The type 'AppleReceiptParser' exists in both 'UnityEngine.Purchasing.Security, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' and 'UnityEngine.Purchasing.SecurityStub, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'

    Library/PackageCache/com.unity.purchasing@3.2.3/Runtime/Stores/AppleAppStore/AppleStoreImpl.cs(310,34): error CS0433: The type 'AppleReceiptParser' exists in both 'UnityEngine.Purchasing.Security, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' and 'UnityEngine.Purchasing.SecurityStub, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'

    Failed to compile player scripts
    #0 GetStacktrace(int)
    #1 DebugStringToFile(DebugStringToFileData const&)
    #2 BuildPipeline::CompilePlayerScripts(BuildPipeline::ScriptCompilationSettings&, core::basic_string<char, core::StringStorageDefault<char> > const&, bool)
    #3 PlayerBuildInterface_CUSTOM_CompilePlayerScriptsNative_Injected(ScriptCompilationSettings__ const&, ScriptingBackendNativeStringPtrOpaque*, unsigned char, ScriptCompilationResult__&)
    #4 (Mono JIT Code) (wrapper managed-to-native) UnityEditor.Build.Player.PlayerBuildInterface:CompilePlayerScriptsNative_Injected (UnityEditor.Build.Player.ScriptCompilationSettings&,string,bool,UnityEditor.Build.Player.ScriptCompilationResult&)
    #5 (Mono JIT Code) [PlayerBuildInterface.bindings.cs:88] UnityEditor.Build.Player.PlayerBuildInterface:CompilePlayerScriptsInternal (UnityEditor.Build.Player.ScriptCompilationSettings,string,bool)
    #6 (Mono JIT Code) [PlayerBuildInterface.bindings.cs:82] UnityEditor.Build.Player.PlayerBuildInterface:CompilePlayerScripts (UnityEditor.Build.Player.ScriptCompilationSettings,string)
    #7 (Mono JIT Code) [BuildPlayerScripts.cs:34] UnityEditor.Build.Pipeline.Tasks.BuildPlayerScripts:Run ()
    #8 (Mono JIT Code) [BuildTasksRunner.cs:56] UnityEditor.Build.Pipeline.BuildTasksRunner:Run (System.Collections.Generic.IList`1<UnityEditor.Build.Pipeline.Interfaces.IBuildTask>,UnityEditor.Build.Pipeline.Interfaces.IBuildContext)
    #9 (Mono JIT Code) [ContentPipeline.cs:145] UnityEditor.Build.Pipeline.ContentPipeline:BuildAssetBundles (UnityEditor.Build.Pipeline.Interfaces.IBundleBuildParameters,UnityEditor.Build.Pipeline.Interfaces.IBundleBuildContent,UnityEditor.Build.Pipeline.Interfaces.IBundleBuildResults&,System.Collections.Generic.IList`1<UnityEditor.Build.Pipeline.Interfaces.IBuildTask>,UnityEditor.Build.Pipeline.Interfaces.IContextObject[])
    #10 (Mono JIT Code) [BuildScriptPackedMode.cs:177] UnityEditor.AddressableAssets.Build.DataBuilders.BuildScriptPackedMode:DoBuild<TResult_REF> (UnityEditor.AddressableAssets.Build.AddressablesDataBuilderInput,UnityEditor.AddressableAssets.Build.DataBuilders.AddressableAssetsBuildContext)
    #11 (Mono JIT Code) [BuildScriptPackedMode.cs:77] UnityEditor.AddressableAssets.Build.DataBuilders.BuildScriptPackedMode:BuildDataImplementation<TResult_REF> (UnityEditor.AddressableAssets.Build.AddressablesDataBuilderInput)
    #12 (Mono JIT Code) [BuildScriptBase.cs:84] UnityEditor.AddressableAssets.Build.DataBuilders.BuildScriptBase:BuildData<TResult_REF> (UnityEditor.AddressableAssets.Build.AddressablesDataBuilderInput)
    #13 (Mono JIT Code) [AddressableAssetSettings.cs:1921] UnityEditor.AddressableAssets.Settings.AddressableAssetSettings:BuildPlayerContentImpl ()
    #14 (Mono JIT Code) [AddressableAssetSettings.cs:1903] UnityEditor.AddressableAssets.Settings.AddressableAssetSettings:BuildPlayerContent ()
    #15 (Mono JIT Code) [AddressableAssetsSettingsGroupEditor.cs:273] UnityEditor.AddressableAssets.GUI.AddressableAssetsSettingsGroupEditor:OnBuildPlayerData ()

    SBP ErrorError
    #0 GetStacktrace(int)
    #1 DebugStringToFile(DebugStringToFileData const&)
    #2 DebugLogHandler_CUSTOM_Internal_Log(LogType, LogOption, ScriptingBackendNativeStringPtrOpaque*, ScriptingBackendNativeObjectPtrOpaque*)
    #3 (Mono JIT Code) (wrapper managed-to-native) UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,UnityEngine.LogOption,string,UnityEngine.Object)
    #4 (Mono JIT Code) [AddressableAssetSettings.cs:1903] UnityEditor.AddressableAssets.Settings.AddressableAssetSettings:BuildPlayerContent ()
    #5 (Mono JIT Code) [AddressableAssetsSettingsGroupEditor.cs:273] UnityEditor.AddressableAssets.GUI.AddressableAssetsSettingsGroupEditor:OnBuildPlayerData ()

    After I have cleared my Library folder, as advised as possible workaround to unrelated issue from other post.
    Now when I try to build addressables groups these errors appear.
    I'm using Unity 2020.3.14f1 with IAP 3.2.2, and everything used to work fine before.
    I've updated to IAP 3.2.3, but it did not fixed the errors.
    If I delete or change iOSStoreBindings.cs it automatically restored, so I'm not sure what to do.
    Any suggestions or workarounds for this problem?
     
    Last edited: Jul 26, 2021
  27. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    We are still working on this with respect to addressables.
     
  28. alexds9

    alexds9

    Joined:
    Feb 9, 2019
    Posts:
    16
    Can you please clarify if @nicholasr response to similar post supposed to fix this error, and what should I do if I don't use Scriptable Build Pipeline package?
     
  29. alexds9

    alexds9

    Joined:
    Feb 9, 2019
    Posts:
    16
    Apparently Scriptable Build Pipeline package was installed in my project after all, although package manager wasn't showing it, after upgrade to 1.19.1, errors have disappeared in my case, I can build addressables groups and build AABs, seems that everything is working fine now.
     
    JeffDUnity3D likes this.
  30. MatL

    MatL

    Joined:
    Jan 29, 2014
    Posts:
    43
    I have the same problem, the workaround that I do is removing the library folder and build addressable on android without building them first on other platforms.
     
  31. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    This is the correct work around for now