Xamarin.iOS Framework binding + FastPdfKit - xamarin

I have a static library (.a) whose include "FastPdfKit.framework". (My Xcode project runs correctly)
This static library is included in xamarin project and i have to bind "FastPdfKit.framework".
So i did: project options -> iOS Build -> Additionnal mtouch arguments (--framework:${ProjectDir}/frameworks/FastPdfKit.framework).
But this mani doesn't run, i've got linked error:
ld: warning: ignoring file
/Users/../Documents/XAMARIN/MyApp.IOS/frameworks/FastPdfKit.framework/FastPdfKit,
missing required architecture arm64 in file
/Users/../Documents/XAMARIN/MyApp.IOS/frameworks/FastPdfKit.framework/FastPdfKit
(2 slices) Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_MFDocumentManager", referenced from:
objc-class-ref in MyLib.a(Page.o)
"_OBJC_CLASS_$_ReaderViewController", referenced from:
objc-class-ref in MyLib.a(Page.o)
ld: symbol(s) not found for architecture arm64 clang: error: linker command failed
with exit code 1 (use -v to see invocation)
MTOUCH: error MT5209: Native linking error: warning: ignoring file
/Users/../Documents/XAMARIN/MyApp.IOS/frameworks/FastPdfKit.framework/FastPdfKit,
missing required architecture arm64 in file
/Users/../Documents/XAMARIN/MyApp.IOS/frameworks/FastPdfKit.framework/FastPdfKit
(2 slices) MTOUCH: error MT5211: Native linking failed, undefined
Objective-C class: MFDocumentManager. The symbol
'_OBJC_CLASS_$_MFDocumentManager' could not be found in any of the
libraries or frameworks linked with your application. MTOUCH: error
MT5211: Native linking failed, undefined Objective-C class:
ReaderViewController. The symbol '_OBJC_CLASS_$_ReaderViewController'
could not be found in any of the libraries or frameworks linked with
your application.
MTOUCH: error MT5202: Native linking failed. Please
review the build log.
Can anyone help me???
Thanks,
Yann

OK, i found.
It was architecture problem. I don't know why because I set architecture option correctly, but not all of architecture setting was generated
Use command line "xcrun -sdk iphoneos lipo -info MyLib.a" to check which architecture is generated.

The error is really very clear, the librarty doesn't support the arm64 architecture as is requested by the project, you need a library compatible with your project's architectures.

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.

Failed to add Firebase Database.framework without Cocoapods

I'm trying to add firebase's Database.framework without Cocoapods, but have compilation error
Undefined symbols for architecture arm64:
"_kFIRDefaultAppName", referenced from:
+[FIRDatabase databaseForApp:] in FirebaseDatabase(FIRDatabase.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error
Does anyone know which framework I should add too? Thanks
So from this question Use of unresolved identifier 'FIRDatabase' when using Firebase , I can see that FirebaseDatabase depends on FirebaseAnalytics. After add all FirebaseAnalytics framework into the project, everthing works as expected. Hope this helps others too

Adding Static Library In Xcode 6

I'm using Xcode 6.0.1 and need to add a library libpt.a to my C project. I cannot figure out how to properly integrate it into my project. I have already done Link Binary With Libraries however I still continue to get this error:
Undefined symbols for architecture x86_64:
"_pt_add_xpage", referenced from:
_main in main.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 am assuming that the above error means that the library has not been integrated correctly. I have already added the header file pt.h and included into my project. What am I doing wrong?

Xcode5, project deploys to device but get's a build error for simulator

When I deploy my app to my phone via xcode5 it works find, however when I try to deploy it to one of the simulators I get the following errors.
ld: warning: ignoring file /Users/benpearce/Downloads/MapKit.framework/MapKit, missing required architecture i386 in file /Users/benpearce/Downloads/MapKit.framework/MapKit (2 slices)
Undefined symbols for architecture i386:
"_MKCoordinateRegionMakeWithDistance", referenced from:
-[MapKitView createViewWithOptions:] in MapKit.o
"_OBJC_CLASS_$_MKMapView", referenced from:
objc-class-ref in MapKit.o
"_OBJC_CLASS_$_MKPinAnnotationView", referenced from:
objc-class-ref in MapKit.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Can anyone see what's going on?
The MapKit framework is missing a binary for the Simulator which is i386. The Simulator is a Mac application and needs a code resource compiled for the i386 Intel processor. Where did you get MapKit?
If this is Apple's MapKit you should just be including the framework provided with Xcode. It is added in Xcode by selecting the Project, Build Phases, Link Binaries with Libraries, +, select MapKit.framework.
Also the framework in in your Downloads directory, why?

A build error occurred when I used Xcode to compile a example 'sync_client' of boost

I used Xcode to build a example of boost, but as you see followed it is failed. And the error
I've got is:
Undefined symbols for architecture x86_64:
"boost::system::system_category()", referenced from:
___cxx_global_var_init2 in sync_client.o
boost::asio::error::get_system_category() in sync_client.o
boost::system::error_code::error_code() in sync_client.o
"boost::system::generic_category()", referenced from:
___cxx_global_var_init in sync_client.o
___cxx_global_var_init1 in sync_client.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 don't know how I can fix it. I've added the include and libs path of boost into Xcode Build Setting. Does anyone have any idea about this problem?
Either link against a pre-built version of libboost-system.so or pull in libs/system/src/error_code.cpp (from your boost source package), into your project.

Resources