Skip to content
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

iOS Unity Cloud Build Failing #20

Open
jehowell opened this issue Sep 20, 2023 · 3 comments
Open

iOS Unity Cloud Build Failing #20

jehowell opened this issue Sep 20, 2023 · 3 comments

Comments

@jehowell
Copy link

We can't seem to get YetAnotherHttpHandler building in Unity Cloud Build for iOS

We get a linker error:

[error] [2023-09-20T04:48:30.206Z] - 7.3.22.2.7.4 - INFO: ❌ ld: could not reparse object file in bitcode bundle: 'Opaque pointers are only supported in -opaque-pointers mode (Producer: 'LLVM16.0.2-rust-1.70.0-stable' Reader: 'LLVM APPLE_1_1400.0.29.202_0')', using libLTO version 'LLVM version 14.0.0, (clang-1400.0.29.202)' for architecture arm64

The latest version of xcode that Unity supports is 14.2. Was this built with something later?

@jehowell
Copy link
Author

Disabling ENABLE_BITCODE in the project does seem to solve the problem, but its not a great long term solution. Looks like there's some build settings for the native lib that are missing.

@ben-tbotlabs
Copy link

#if UNITY_IOS
using UnityEditor;
using UnityEditor.Build;
using UnityEditor.Build.Reporting;
using UnityEditor.iOS.Xcode;

public class DisableBitCode : IPostprocessBuildWithReport
{
	public int callbackOrder => 1;

	public void OnPostprocessBuild(BuildReport report)
	{
		if (report.summary.platform == BuildTarget.iOS)
		{
			string projectPath = report.summary.outputPath + "/Unity-iPhone.xcodeproj/project.pbxproj";


			PBXProject pbxProject = new PBXProject();
			pbxProject.ReadFromFile(projectPath);


			//Disabling Bitcode on all targets


			//Main
			string target = pbxProject.GetUnityMainTargetGuid();
			pbxProject.SetBuildProperty(target, "ENABLE_BITCODE", "NO");


			//Unity Tests
			target = pbxProject.TargetGuidByName(PBXProject.GetUnityTestTargetName());
			pbxProject.SetBuildProperty(target, "ENABLE_BITCODE", "NO");


			//Unity Framework
			target = pbxProject.GetUnityFrameworkTargetGuid();
			pbxProject.SetBuildProperty(target, "ENABLE_BITCODE", "NO");


			// Game Assembly
			target = pbxProject.TargetGuidByName("GameAssembly");
			pbxProject.SetBuildProperty(target, "ENABLE_BITCODE", "NO");


			pbxProject.WriteToFile(projectPath);
		}
	}
}
#endif

This is a script you can add to your project to disable the bitcode

@Last8Exile
Copy link

Bitcode is deprecated by Apple in Xcode 14.
You can (and should) disable it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants