OneSignal / OneSignal-Unity-SDK

OneSignal is a free push notification service for mobile apps. This plugin makes it easy to integrate your Unity app with OneSignal. https://onesignal.com
Other
222 stars 61 forks source link

[Bug]: Windows 11 IOS Build error in Unity 2021.3.42f1 #757

Open GabrielFIAB opened 2 months ago

GabrielFIAB commented 2 months ago

What happened?

onesignal_bug

When building in Unity 2021.3.42f1 for IOS the build will complete however the OneSignal files are not copied into the build folder. This is indicated in an error that is produced. Looking at the target path I can see that it does C://etcC:// when the path should only have one C://etc

Steps to reproduce?

0. On Windows 11
1. Install Unity 2021.3.42f1
2. Install OneSignal 5.1.8
3. Build for IOS

What did you expect to happen?

The IOS build should include the necessary OneSignal files.

Unity version

2021.3.42f1

OneSignal Unity SDK version

5.1.8

Platform

iOS

Relevant log output

DirectoryNotFoundException: Could not find a part of the path "C:\Users\Username\Desktop\APKs\iOS\e\C:\Users\Username\Desktop\APKs\iOS\e\ConnectTheWords.entitlements".
System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean anonymous, System.IO.FileOptions options) (at <3a0ddde1abdb49459f4d700219c8f358>:0)
System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.IO.FileOptions options) (at <3a0ddde1abdb49459f4d700219c8f358>:0)
(wrapper remoting-invoke-with-check) System.IO.FileStream..ctor(string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare,int,System.IO.FileOptions)
System.IO.StreamWriter..ctor (System.String path, System.Boolean append, System.Text.Encoding encoding, System.Int32 bufferSize) (at <3a0ddde1abdb49459f4d700219c8f358>:0)
System.IO.StreamWriter..ctor (System.String path, System.Boolean append, System.Text.Encoding encoding) (at <3a0ddde1abdb49459f4d700219c8f358>:0)
(wrapper remoting-invoke-with-check) System.IO.StreamWriter..ctor(string,bool,System.Text.Encoding)
System.IO.File.WriteAllText (System.String path, System.String contents, System.Text.Encoding encoding) (at <3a0ddde1abdb49459f4d700219c8f358>:0)
UnityEditor.iOS.Xcode.PlistDocument.WriteToFile (System.String path) (at C:/build/output/unity/unity/External/XcodeAPI/Xcode/PlistParser.cs:404)
UnityEditor.iOS.Xcode.ProjectCapabilityManager.WriteToFile () (at C:/build/output/unity/unity/External/XcodeAPI/Xcode/ProjectCapabilityManager.cs:78)
OneSignalSDK.iOS.BuildPostProcessor.AddProjectCapabilities () (at Library/PackageCache/com.onesignal.unity.ios@5.1.7/Editor/BuildPostProcessor.cs:164)
OneSignalSDK.iOS.BuildPostProcessor.OnPostprocessBuild (UnityEditor.Build.Reporting.BuildReport report) (at Library/PackageCache/com.onesignal.unity.ios@5.1.7/Editor/BuildPostProcessor.cs:109)
UnityEditor.Build.BuildPipelineInterfaces+<>c__DisplayClass18_0.<OnBuildPostProcess>b__1 (UnityEditor.Build.IPostprocessBuildWithReport bpp) (at <9efa87370fa94dd98ca62b05b2a91b8f>:0)
UnityEditor.Build.BuildPipelineInterfaces.InvokeCallbackInterfacesPair[T1,T2] (System.Collections.Generic.List`1[T] oneInterfaces, System.Action`1[T] invocationOne, System.Collections.Generic.List`1[T] twoInterfaces, System.Action`1[T] invocationTwo, System.Boolean exitOnFailure) (at <9efa87370fa94dd98ca62b05b2a91b8f>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

Code of Conduct

shepherd-l commented 1 month ago

Do you have another PostProcessor script besides OneSignal's?

Your issue looks similar to: https://github.com/OneSignal/OneSignal-Unity-SDK/issues/491

If you do have multiple PostProcessor scripts, could you try what this user suggested at let us know if it works for you? https://github.com/OneSignal/OneSignal-Unity-SDK/issues/491#issuecomment-1149647624

... make sure that [the OneSignal] PostProcessor script is running first by changing the callbackOrder on my other PostProcessor script.