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

Undefined symbols for architecture arm64 #278

Open
codeswapping opened this issue Feb 1, 2023 · 8 comments
Open

Undefined symbols for architecture arm64 #278

codeswapping opened this issue Feb 1, 2023 · 8 comments
Labels

Comments

@codeswapping
Copy link

Hello yasirkula,

I am facing following issue with the plugin in xcode on mac m1. Please help me with this if you can.

Undefined symbols for architecture arm64:
"OBJC_CLASS$_PHAssetChangeRequest", referenced from:
objc-class-ref in NativeGallery.o
"OBJC_CLASS$_PHAssetCollection", referenced from:
objc-class-ref in NativeGallery.o
"OBJC_CLASS$_PHAssetCollectionChangeRequest", referenced from:
objc-class-ref in NativeGallery.o
"OBJC_CLASS$_PHFetchOptions", referenced from:
objc-class-ref in NativeGallery.o
"OBJC_CLASS$_PHPhotoLibrary", referenced from:
objc-class-ref in NativeGallery.o
"_kUTTypeImage", referenced from:
+[UNativeGallery pickMedia:savePath:] in NativeGallery.o
+[UNativeGallery imagePickerController:didFinishPickingMediaWithInfo:] in NativeGallery.o
"_kUTTypeMovie", referenced from:
+[UNativeGallery pickMedia:savePath:] in NativeGallery.o
"_kUTTypeVideo", referenced from:
+[UNativeGallery pickMedia:savePath:] in NativeGallery.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

When I had exported project from unity, AssetLibrary were not automatically added in other linker flags, so I did it manually. I don't know what may be causing this.
Please help.

@yasirkula
Copy link
Owner

This is Photos framework missing rather than AssetsLibrary.

@codeswapping
Copy link
Author

Ok, thanks, I have managed to trace this issue. But I think these frameworks should have been added automatically when building from unity. anyway I have added them manually and it is working now.

@yasirkula
Copy link
Owner

Yes they should've been. Another plugin might be overwriting Other Linker Flags instead of appending to it.

@codeswapping
Copy link
Author

Actually when I am exporting xcode project, it not generating any other linker flags. all flags I have to add manually. May be there is some issues in my project configuration, but I am not sure it is related to that.

@yasirkula
Copy link
Owner

You're building the project using Build & Run, right? Not using an editor script to build it?

@codeswapping
Copy link
Author

Yes, not an editor script

@yasirkula
Copy link
Owner

OK then my assumption was another plugin calling pbxProject.SetBuildProperty because otherwise, these lines have to work:

pbxProject.AddBuildProperty( targetGUID, "OTHER_LDFLAGS", "-weak_framework PhotosUI" );
pbxProject.AddBuildProperty( targetGUID, "OTHER_LDFLAGS", "-framework Photos" );
pbxProject.AddBuildProperty( targetGUID, "OTHER_LDFLAGS", "-framework MobileCoreServices" );
pbxProject.AddBuildProperty( targetGUID, "OTHER_LDFLAGS", "-framework ImageIO" );

@codeswapping
Copy link
Author

Ok, I will check again. Thanks for your support

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

No branches or pull requests

2 participants