-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Dependency Cycle Error after Updating to Xcode 15 #651
Comments
@shaiArn This looks like a wonky interaction between Unity(or Flutter), Cocoapods, and the fact that your app has a Notification Service Extension. I doubt this is something that can be solved by a change in the SDK, but we can investigate workarounds/setup steps that will resolve the issue. |
Have same issue after upgrading to Xcode version 15 Xcode project is generated on each player build. So we need some workaround that can be implemented in PostBuild Update: found on Unity Forum that they are currently working on fix |
I was unable to reproduce the error in a new project with OneSignal. Could any of you provide a sample project that reproduces the error along with what Unity version and OneSignal SDK version you used? |
We're experiencing the same issue. I don't have a project, but I will chip in with some extra detail... Unfortunately for us, whilst the re-ordering fix does fix the "cycle error" and the app does build, it immediately crashes when it runs on the device due to:
It's not clear to me if the re-ordering fix is actually fixing it, or if it is just plastering over one issue and causing this second issue. This second issue could be a total non-issue, in reality. Similarly to others, this started when we tried to upgrade to XCode 15 to support iOS17, no issues prior to this. Perhaps older version of XCode were more lenient/flexible but 15 is more strict, which is why a bunch of people are seeing this issue (I've seen it around a few forums). Even though it might not be a OneSignal issue directly, clearly there's a certain project structure that is susceptible to this issue, if we can collectively find a solution that would be great. |
Hello, |
This issue is still happening with Xcode 15.2 and the latest OneSignal version and we're currently blocked from building our game. The workaround works but I haven't figured out how to automate it on post process. Does anyone have a temporary solution that works automatically? |
Updating the Unity version from 2021.3 to 2022.3 fixed it for me |
same issue, Is there any workaround for unity 2021? |
find a solution by using this code with minor change: https://forum.unity.com/threads/xcode-15-cycle-inside-unity-iphone-building-could-produce-unreliable-results.1496747/#post-9397949 namespace YourNameSpace
{
internal static class FixBuildPhasesOrderForUnityIPhone
{
private const string _sectionSearchKey = "Build configuration list for PBXNativeTarget \"Unity-iPhone\"";
private const string _targetBuildPhaseKey = "ShellScript"; // changed from original post
[PostProcessBuild(45)]
private static void FixBuildPhasesOrderInProject(BuildTarget target, string pathToBuiltProject)
{
if (target != BuildTarget.iOS)
{
return;
}
// Search for order array.
var path = Path.Combine(pathToBuiltProject, "Unity-iPhone.xcodeproj", "project.pbxproj");
var allLines = File.ReadAllLines(path);
// Search for first line.
var firstLine = -1;
for (var i = 0; i + 2 < allLines.Length; i++)
{
if (allLines[i].Contains(_sectionSearchKey) && allLines[i + 1].Contains("buildPhases = ("))
{
firstLine = i + 2;
break;
}
}
// Check for error.
if (firstLine <= 0)
{
return;
}
// Search for last line.
var lastLine = -1;
for (var i = firstLine; i + 1 < allLines.Length && i - firstLine < 30; i++)
{
if (allLines[i + 1].Contains(");"))
{
lastLine = i;
break;
}
}
// Check for error.
if (lastLine <= 0 || lastLine == firstLine)
{
return;
}
var buffer = [new](http://www.google.com/search?q=new+msdn.microsoft.com) List<string>();
for (var i = firstLine; i <= lastLine; i++)
{
buffer.Add(allLines[i]);
}
var index = buffer.FindIndex(x => x.Contains(_targetBuildPhaseKey));
if (index == -1)
{
return;
}
var line = buffer[index];
buffer.RemoveAt(index);
buffer.Add(line);
// Replace old lines with new ones.
for (var i = 0; i < buffer.Count; i++)
{
allLines[firstLine + i] = buffer[i];
}
// Save results.
File.WriteAllLines(path, allLines);
Debug.Log("BuildPhases order were reordered in xCode project.");
}
}
} The build phases change from to |
I noticed something interesting: when I build the xcode project on Windows and then run it on my Mac, I'm getting the dependency cycle error and need to shift around the build phases. When I build the xcode project with Unity running on my Mac, I can build just fine without having to touch the build phases. |
can you explain what exactly you need to change to move Unity process symbols to the very end? |
What happened?
Hello OneSignal Unity SDK team,
I recently upgraded to Xcode version 15 and faced an issue while building my project. The error details are below.
Interestingly, a similar issue appears to be occurring with Flutter iOS builds as well. You can find a related discussion here:
https://stackoverflow.com/questions/77138968/handling-cycle-inside-runner-building-could-produce-unreliable-results-after-up
While the solution provided in the above Stack Overflow thread does work, it isn't a viable long-term fix for us. The manual intervention it requires disrupts our CI/CD system.
I hope this information aids in diagnosing the issue. If there are any additional details or clarifications needed, please let me know.
Thank you for your attention and support.
Steps to reproduce?
What did you expect to happen?
The build process to work smoothly without manual changes to Build Phase.
Unity version
2021.3.23f1 (LTS)
OneSignal Unity SDK version
3.0.1
Platform
iOS
Relevant log output
Code of Conduct
The text was updated successfully, but these errors were encountered: