Community

Topic: Unity 3D Plugin

Ios build error (SOLVED)

Stefano Schiavi
Monday, July 4, 2022

Hello, i have the following error in xcode while trying to build for ios :

Undefined symbols for architecture arm64:
"_glTexSubImage2D", referenced from:
DBX::ImageProcessor::update_RGBA_texture_GL(void*, bool) in libpdimf-arjni-ios-unity.a(ImageProcessor.o)
DBX::ImageProcessor::update_YUV_texture_GL(void*, void*, bool) in libpdimf-arjni-ios-unity.a(ImageProcessor.o)
"_glBindTexture", referenced from:
DBX::ImageProcessor::updateImage_RGBA_FromGL(unsigned char*, int, int) in libpdimf-arjni-ios-unity.a(ImageProcessor.o)
DBX::ImageProcessor::update_RGBA_texture_GL(void*, bool) in libpdimf-arjni-ios-unity.a(ImageProcessor.o)
DBX::ImageProcessor::update_YUV_texture_GL(void*, void*, bool) in libpdimf-arjni-ios-unity.a(ImageProcessor.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)


I am using the following post process build project updater:

[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));

string target = proj.GetUnityFrameworkTargetGuid();

// 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());
}
}

I checked the "Other links flag" under project settings and it contains the lz and lsqlite3 flags.
Software used : Unity 2021.3.2 , Xcode 13.4.1 and the latest version of your plugin


Regards the license files, i have put them both (android and ios) in the streaming assets folder with different names. Is that ok?

Thanks in advance for any help!

user profile image
Support Team  (expert)
Wednesday, July 6, 2022

Hi,

is bitcode disabled in your xcode build settings?

As for the licence, in the current SDK version the iOS and Android licences are the same, just put one of them in the streaming assets folder without renaming it.

Stefano Schiavi
Wednesday, July 6, 2022

Yes, it's disabled

https://ibb.co/GMQLLjy

user profile image
Support Team  (expert)
Monday, July 11, 2022

Hi,
Have you switched graphic API to OpenGLES3?
The current version of the Unity SDK does not support metal rendering, we are still working on metal support.

Stefano Schiavi
Monday, July 11, 2022

The toggle for the Auto Graphics it's no longer available under iOS in the recent versions of Unity, should i downgrade to an older version and build without Metal library?

user profile image
Support Team  (expert)
Monday, July 11, 2022

Yes.

Stefano Schiavi
Monday, July 11, 2022

Opening the project with unity 2020 and switching to OpenGLES 3 instead of Metal solved it.
Thank you!

Sign in to add a comment