iOS Question iOS Library missing arm64 architecture

sgt

Member
Licensed User
Hi

I am trying to build a B4i Library to use Google MLVision Libraries. I have created a static library in Xcode and compiled it and used cocoapods to get the google dependency frameworks. If comment out all MLVision related code and recompile it and add it to my local build server I can call methods from B4i without any issues. If run the 'lipo' command against the library it prints out 'Architectures in the fat file: libGoogleVision.a are: arm7 arm64'

However once I un-comment any MLVision related lines I get the following error in B4i compiling a project referencing the library.

Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_FIRVision", referenced from:
objc-class-ref in libGoogleVision.a(GoogleVision.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

It seems to be an issue with the Google Framework dependency but I have run out of ideas to resolve this. The objc line that causing the error is creating a 'FIRVision' object
Any help appreciated.
 
Last edited:

sgt

Member
Licensed User
I went through and double checked the library with lipo to make sure, I also checked all the google libraries that the pod file installs and builds with lipo as well and they all say armv7 arm64. It did compile for 32bit but it didn't install on my iphone 8 just seem to hang.

Should I be able to open the B4iProject.xcodeproj file the Build Server creates and compile that with xcode when the project does compile and when it doesn't. Is this a mismatch of the iOS min versions of the library/pod file dependencies and the B4i project.

Thanks for your reply
 

sgt

Member
Licensed User
Update to this I have tried both the ML Vision and the older Mobile Vision libraries with the same results. The Xcode project for the libraries I create compile ok with either the Vision frameworks or the library files *.a. But once the libraries have code relating the Vision libraries I receive the error 'Undefined symbols for architecture arm64' when compiling a project in B4i. Lipo command shows all libraries are fat libraries with both armv7 and arm64. Please see the Xcode image to see whats being called and the B4i Compile error image.
 

Attachments

sgt

Member
Licensed User
Ok Thanks

Here is the Xcode project. It is fairly simple just need run the 'pod install' to get the google libraries as they are too large to include in the zip file. The xml file I was using in B4i is in the root. Compile the Xcode project and you will see all the libraries are fat libraries and just reference the library in B4i in a empty project and then try building. I expect the error is some thing else other than architecture error being reported.
 

Attachments

sgt

Member
Licensed User
I have updated the files on OneDrive
https://tytechnz-my.sharepoint.com/...JPuYY2KZ2cy88BBYL3TrwSr0viaVQH8kYZIA?e=mjbZh5 to the correct version that contains libGoogleVision.a in the folder 'Libs Release Files'. All the frameworks has been copied over to the root of the Libs directory of my local build server.

I have also declared all the dependson references in the GoogleVision.h file and re did the GoogleVision.xml file. This has resolve the compile error and the B4i projects do now compile and install but they crash at startup straight away with out any log entries. I have attached the crash report from the device which is complaining about a framework not being found, but this framework is one included in the .h file. Is copying the frameworks to the Libs directory enough or is there some else I am missing.

There is a bundle file, does this just go in the B4i projects Files/Special folder along with any resource files
 

Attachments

Last edited:

sgt

Member
Licensed User
I have been trying to see why its crash so the device logs show this which is one of the frameworks.

dependent dylib '@rpath/GoogleAPIClientForREST.framework/GoogleAPIClientForREST' not found for '/private/var/containers/Bundle/Application/3D0602D7-1EE0-4627-8B40-16220E1FACD3/B4i Example.app/B4i Example', tried but didn't find: '/private/var/containers/Bundle/Application/3D0602D7-1EE0-4627-8B40-16220E1FACD3/B4i Example.app/Frameworks/GoogleAPIClientForREST.framework/GoogleAPIClientForREST' '@rpath/GoogleAPIClientForREST.framework/GoogleAPIClientForREST' '/System/Library/Frameworks/GoogleAPIClientForREST.framework/GoogleAPIClientForREST'

If open the Xcode project the 'Frameworks, Libraries and Embedded' under Target -> General show all the frameworks but the are all saying 'Do Not Embed' how can I change this to 'Embed Without Signing'
 

sgt

Member
Licensed User
Thanks for all your help Erel

Managed to get the library wrapper working for Google ML Vision Text Recognition. I will upload it once I have finished the project I am working on as the code is quite simple. But here are some things to look out for, for any one looking to build B4i wrappers with google ML Vision Libraries.

I used cocoapods with a pod file to get all the libraries for google vision libraries, there was a lot of dependencies and the 'pod install' command you use to integrate these libraries into your ObjC project modifies your project settings. The issue of framework not installing on the device turned out to be that not all of the google frameworks / dependencies where set as static libraries some where set as dynamic. Turns out only Apple creates dynamic libraries...
 
Top