Community
Topic: Unity 3D Plugin
Unity version iOS
Got several problems building for iOS with unity 2019.4. Which is the last verified version of unity for your sdk?
Hi,
we have recently tested the sdk on Unity 2019.4.9f1 and Xcode 11.7.
It's possible that the problem is in the Xcode linker. Try updating the XcodeProjectUpdater.cs file in the following way:
#if UNITY_IOS
using UnityEngine;
using UnityEditor;
using UnityEditor.Callbacks;
using System.Collections;
using UnityEditor.iOS.Xcode;
using System.IO;
public class MyBuildPostprocessor
{
[PostProcessBuild]
public static void OnPostprocessBuild(BuildTarget buildTarget, string path)
{
if (buildTarget == BuildTarget.iOS)
{
string projPath = path + "/Unity-iPhone.xcodeproj/project.pbxproj";
PBXProject proj = new PBXProject();
proj.ReadFromString(File.ReadAllText(projPath));
//ADD THE FOLLOWING FIVE LINES
#if UNITY_2019_3_OR_NEWER
string target = proj.GetUnityFrameworkTargetGuid();
#else
string target = proj.TargetGuidByName("Unity-iPhone");
#endif
// Set a custom link flag
proj.AddBuildProperty(target, "OTHER_LDFLAGS", "-lz -lsqlite3");
// Disable bitcode
proj.SetBuildProperty(target, "ENABLE_BITCODE", "NO");
File.WriteAllText(projPath, proj.WriteToString());
}
}
}
#endif
This should fix the problem. As an alternative you can update the "Other Linker Flags" in the Build Settings of UnityFramework in Xcode by adding "-lsqlite3" and "-lz".
We will soon release an update with this fix. Let us know if this solves your problem.
Best Regards,
Support Team