Undefined symbols for architecture arm64: previous solution doesn't work in Xcode 12.5.1 - xcode

I am working on a flutter project. My project includes tflite and amplify packages. it works fine with android but whenever I try to build it in Xcode I am getting this following errors:
Undefined symbols for architecture arm64:
"OBJC_CLASS$_FlutterStandardTypedData", referenced from:
objc-class-ref in tflite(TflitePlugin.o)
enter code here
"_FlutterMethodNotImplemented", referenced from:
-[TflitePlugin handleMethodCall:result:] in tflite(TflitePlugin.o)
"OBJC_CLASS$_FlutterMethodChannel", referenced from:
objc-class-ref in tflite(TflitePlugin.o)
"OBJC_METACLASS$_FlutterAppDelegate", referenced from:
OBJC_METACLASS$_AppDelegate in AppDelegate.o
"OBJC_CLASS$_FlutterAppDelegate", referenced from:
OBJC_CLASS$_AppDelegate in AppDelegate.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Please help me with this. I have been stuck with this issue for more than a week now. Thank you.
I have added a snippet from Xcode which shows the current settings for Architectures. There are past suggestions to add arm64 as a Valid architectures. However, as you see there is no option for that. I added arm64 in excluded architectures as shown in the picture. It didn't work for me.

Related

Can not build DJI sample application due to missing required architecture armv7

I am trying to update the DJI SDK of my app to the latest version (i.e. v4.10 for DJISDK/UXSDK and v1.5 for DJIWidget) in order for it to be compatible with Matrice 200 V2 series. I have come across an error which I was able to reproduce as well with the sample application from the DJI Mobile-UXSDK-iOS repo.
Basically when I try to archive the app it have this error showing up:
ld: warning: directory not found for option '-F/Users/nachocarnicero/git/Mobile-UXSDK-iOS/Sample Code/ObjcSampleCode/Frameworks'
ld: warning: directory not found for option '-F/Users/nachocarnicero/git/Mobile-UXSDK-iOS/Sample Code/ObjcSampleCode/../DJIWidget'
ld: warning: ignoring file /Users/nachocarnicero/git/Mobile-UXSDK-iOS/Sample Code/ObjcSampleCode/Pods/DJI-UXSDK-iOS/iOS_UXSDK/DJIUXSDK.framework/DJIUXSDK, missing required architecture armv7 in file /Users/nachocarnicero/git/Mobile-UXSDK-iOS/Sample Code/ObjcSampleCode/Pods/DJI-UXSDK-iOS/iOS_UXSDK/DJIUXSDK.framework/DJIUXSDK (2 slices)
ld: warning: ignoring file /Users/nachocarnicero/git/Mobile-UXSDK-iOS/Sample Code/ObjcSampleCode/Pods/DJI-SDK-iOS/iOS_Mobile_SDK/DJISDK.framework/DJISDK, missing required architecture armv7 in file /Users/nachocarnicero/git/Mobile-UXSDK-iOS/Sample Code/ObjcSampleCode/Pods/DJI-SDK-iOS/iOS_Mobile_SDK/DJISDK.framework/DJISDK (2 slices)
Undefined symbols for architecture armv7:
"_OBJC_CLASS_$_DUXBatteryWidget", referenced from:
_OBJC_CLASS_$_MyBatteryWidget in MyBatteryWidget.o
objc-class-ref in PanelsCollectionsViewController.o
"_OBJC_METACLASS_$_DUXDefaultLayoutViewController", referenced from:
_OBJC_METACLASS_$_DefaultLayoutViewController in DefaultLayoutViewController.o
"_OBJC_METACLASS_$_DUXBatteryWidget", referenced from:
_OBJC_METACLASS_$_MyBatteryWidget in MyBatteryWidget.o
"_OBJC_CLASS_$_DUXStatusBarViewController", referenced from:
objc-class-ref in PanelsCollectionsViewController.o
"_OBJC_CLASS_$_DUXDefaultLayoutViewController", referenced from:
_OBJC_CLASS_$_DefaultLayoutViewController in DefaultLayoutViewController.o
"_OBJC_CLASS_$_DJISDKManager", referenced from:
objc-class-ref in MainViewController.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Before this version everything worked fine, so I guess it is a problem with the newest DJI SDK version.
I am using the ObjectiveC sample code, and the app works fine in debug mode running it on an iPad Pro.
In case anyone is running into this problem, it seems that the new DJI SDK is not compatible with armv7 architectures, so the solution here is to go to the XCode Build Settings tab of your project and remove armv7 under Valid Architectures as it was done by this commit on the DJI Mobile-SDK-iOS repo.

Unity to Xcode 8.3. Undefined symbols for architecture arm64 _addZipFile", referenced from error

I am developing an AR project in Unity and building an iOS build. From Unity, build is successful but in Xcode build is giving error like this.
Undefined symbols for architecture arm64:
"_addZipFile", referenced from:
_ZipUtil_addZipFile_m779653781 in Bulk_Assembly-CSharp-firstpass_0.o
_ZipUtil_Zip_m3365174905 in Bulk_Assembly-CSharp-firstpass_0.o
(maybe you meant: _ZipUtil_addZipFile_m779653781)
"_zip", referenced from:
_ZipUtil_zip_m353699619 in Bulk_Assembly-CSharp-firstpass_0.o
_ZipUtil_Zip_m3365174905 in Bulk_Assembly-CSharp-firstpass_0.o
(maybe you meant: _ZipUtil_zip_m353699619)
"_unzip", referenced from:
_ZipUtil_unzip_m1045744427 in Bulk_Assembly-CSharp-firstpass_0.o
(maybe you meant: _ZipUtil_unzip_m1045744427)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I have already tried all the possible solution searched here.
Thanks.
You're using UnityZip plugin in your project but when your xcode project is built it says that it can find a UnityZip's plugin to link. So all the code which is using this plugin is unknown to compiler. Look at the UnityZip github page one more time. I suppose that you've missed this step:
add file "PluginsCode>iOS>ZipArchive" to xcode project.
So just add needed files to the project and it should compile.

xCode - Undefined symbols for architecture x86_64: MWPhotoBrowser

I'm trying to use the MWPhotoBrowser project in my project. I followed the whole installation process and was able to import the MWPhotoBrowser.h file. When I tried to build, I run into this error...
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_MWPhotoBrowser", referenced from:
objc-class-ref in PhotoBrowserViewController.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Does anyone know how to resolve this?
Thanks
For anyone getting this issue...Please check if you correctly linked your project to the libMWPhotoBrowser.a file under Build Phases in your target settings !

Linking to libiconv

I've created a clean build of libmariadbclient and integrated it into my project. Whenever I try to build said project I fail with an error:
Undefined symbols for architecture x86_64:
"_libiconv", referenced from:
_mariadb_convert_string in libmariadbclient.a(my_charset.c.o)
"_libiconv_close", referenced from:
_mariadb_convert_string in libmariadbclient.a(my_charset.c.o)
"_libiconv_open", referenced from:
_mariadb_convert_string in libmariadbclient.a(my_charset.c.o)
ld: symbol(s) not found for architecture x86_64
I then add libiconvlib.dylid to my project, cleaned it and tried to build again, but I still get the same error. Any ideas?
I filed a bug report with the developers and the issue was promptly fixed.

Zxing 'undefined symbols for architecture x86-x64' error

I use zxing lib in my OS X application. I've included zxing-objc to my project and simply copy-pasted code from zxing demo (zxing-root/objc/examples/demo) to the separate ViewController class. When trying to compile project, I get the following linker errors:
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_QTCaptureDevice", referenced from:
objc-class-ref in ScanViewController.o
"_OBJC_CLASS_$_ZXCapture", referenced from:
objc-class-ref in ScanViewController.o
"_QTMediaTypeMuxed", referenced from:
-[ScanViewController performVideoSourceScan] in ScanViewController.o
"_QTMediaTypeVideo", referenced from:
-[ScanViewController performVideoSourceScan] in ScanViewController.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I've carefully checked all code and compared my project properties (including c++ compiler options) to demo project properties, and everything is done right.
You need to add the necessary frameworks to your app target. You can look in the sample app for an example. Select the target in Xcode, select Build Phases, and open the Link With Libraries entry. You'll see that it includes both QuartzCore and zxing-objc-framework. It sounds like you don't have those in your project.

Resources