Apple Mach-O linker error _OBJC_CLASS_$_FIRInstanceID - ios

I've been trying to implement Firebase Notifications to a project that has alot of targets (like 13). I've been struggling but finally made it work on my test device, being able to show notifications when sent by an app called Postman.
The thing is I installed the frameworks by not using cocoapods because whenever I tried to do Pod install, my project couldn't build forcing me to rollback and try it again. So I opted to use this tutorial: https://www.mokacoding.com/blog/setting-up-firebase-without-cocoapods/
The app was working fine so I tried to archive it, to publish to testflight, and people told me to always use the Generic iOS Device when publishing to Testflight, so the application works on every device and not only on the one I'm testing.
But when I tried to build the project but on a Generic iOS Device I get the error:
Undefined symbols for architecture armv7s:
"_OBJC_CLASS_$_FIRInstanceID", referenced from:
objc-class-ref in MyINFOAppDelegate.o
"_OBJC_CLASS_$_FIRApp", referenced from:
objc-class-ref in MyINFOAppDelegate.o
ld: symbol(s) not found for architecture armv7s
clang: error: linker command failed with exit code 1 (use -v to see
invocation)
Not being able to archive and send it to testflight.
What should I do? Already saw a ton of posts of things I did but not able to solve :(

Make sure that the Architectures Build Setting does not include armv7s. By default, Architectures is defined to $(ARCHS_STANDARD) which maps to "armv7 arm64"
Firebase binary distributions don't include armv7s - only armv7, i386, x86_64 and arm64.

Related

Xcode and Flutter Plugin: Could not find or use auto-linked framework 'Flutter'

I'm running into an issue with archiving my app for the app store. Here are the pertinent facts:
I have an iOS app written in Objective-C, with cocoapods for libraries.
The app also has a sister project, a Flutter module that displays a screen inside the iOS app. I followed these instructions to get the module built: https://flutter.dev/docs/development/add-to-app/ios/project-setup#create-a-flutter-module
The app compiles fine in development mode - I can compile and run it on the simulator or on a device such as an iPhone.
When I try to archive it for the store, this happens:
Undefined symbols for architecture armv7:
"_FlutterMethodNotImplemented", referenced from:
___47+[FLTPathProviderPlugin registerWithRegistrar:]_block_invoke in FLTPathProviderPlugin.o
"_OBJC_CLASS_$_FlutterError", referenced from:
objc-class-ref in FLTPathProviderPlugin.o
"_OBJC_CLASS_$_FlutterMethodChannel", referenced from:
objc-class-ref in FLTPathProviderPlugin.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Just to be clear, this compiles just fine for development - it is only when I switch to archiving it that the compilation fails. Your assistance is most appreciated!
I had this problem and spent all day trying to fix it.
This worked for me:
Delete the iOS folder in your flutter project
Run flutter create .
If you made any changes to your pod file, plists, etc. Update them now
Install your pods and run.

importing swift framework only working on Simulator

I have been trying to import this swift framework into a objective c project called CreditCardForm but it fails to run. It will run on a real iPhone but when it comes to the simulator it gives be this error.
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$__TtC14CreditCardForm18CreditCardFormView", referenced
from:
objc-class-ref in CreditCardVC.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 have been trying to get it to run but it has only ran for the simulator only or the iPhone only.
Make sure the framework is built in both Device/Simulator
If the project is built only in “Simulator”, it would only generate architectures which would let the framework run specifically on simulators not on Devices. Or if the project is built in “Device”, it would generate architectures which would let the framework to run only on devices.
So build the project on both “Simulator” and “Device”.
https://medium.com/swiftindia/build-a-custom-universal-framework-on-ios-swift-549c084de7c8
Build a Fat Library
A fat library is simply a library with multiple architectures. In our
case it will contain x86 and arm architectures. The proper name is
‘Universal Static Library’. But we will stick with ‘fat library’ since
its smaller to write and that is exactly what our resultant library
would be. Fat!!! with multiple architectures in it.
https://medium.com/#hassanahmedkhan/a-noobs-guide-to-creating-a-fat-library-for-ios-bafe8452b84b

Apple Mach-O Linker (Id) Error (wechat)

I added a wechat login to my xcode. However, these errors worked.
I do not know how to fix this error. please help me.
Apple Mach-O Linker (Id) Error
"__wechatstore",referenced from:
_Wechat__wechatstore_m13_992 in Bulk_Assembly-CSharp_1.o
_Wechat_wechatstore_m13_995 in Bulk_Assembly-CSharp_1.o
(maybe you meant: _Wechat__wechatstore_m13_992)
Symbol(s) not found for architecture arm64
Linker command failed with exit code 1 (use -v to see invocation)
Activity Log Complete
the message means that the symbol __wechatstore (which is likely a pointer to data structure) can't be found in any arm64 binary supplied to the linker. So there are a couple things that could be going wrong:
the Library with this symbol might not be getting included in compilation. (when build fails in Xcode, go to the 'report' tab in navigator, click on the failing build, and check out the failing "Link ..." task
the Library might be included but not be compiled for arm64. Now that I think of it, I think this is the most likely case. arm64 support is a newer requirement from apple to support iPad Pro. I'd be willing to bet that the library probably only includes armv7. you can find out which architectures are included by running the file command on the library.
A possible temporary solution is to stop compiling for arm64, and try out just compiling armv7: to do that go to Project > Build Settings > Architectures > Architectures and change from $(ARCHS_STANDARD) $(ARCHS_STANDARD) to armv7. (nb: idk but I wouldn't try to submit a binary without the proper architectures for the appstore)

Google Conversion Tracking for iOS linker error for architecture armv7

I'm trying to add the Google Conversion Tracking for iOS feature to my iPhone app.
The app's base SDK is iOS6
the app's valid architectures is armv7, armv7s
the app's iOS deployment targer is 4.3
I'm using the latest xcode 4.5.2 and OSX 10.8.2
The app is in appstore and is ok for iPhone 3-4-5
When I try to add the Google Conversion Tracking for iOS following this link: https://developers.google.com/mobile-ads-sdk/docs/admob/conversion-tracking
I have this error:
Undefined symbols for architecture armv7:
"_OBJC_CLASS_$_ASIdentifierManager", referenced from:
objc-class-ref in libGoogleConversionTracking.a(PingUtil.o)
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
The SDK library references the iOS AdSupport development framework
which may not already be part of your project. It can be resolved by
including AdSupport.Framework.
To adding the Framework, just follow the steps below. Select the
project file at the top. Open the Link Binary With Libraries drop-down
under the Build Phases tab. Add the framework from the iOS SDK using
the + button.

Facebook Connect SDK with armv7 Architecture? :(

Recently built an iPad Application using the Facebook Connect SDK. It was recommended to me that i change the architecture of the project to armv6 to allow the Facebook Connect SDK to work.
After changing the project to armv6, it works fine on the simulator and device, however when i try to submit the application to iTunes Connect I receive the following error whilst submitting:
iPad: application executable is missing a required architecture. At least one of the following architecture(s) must be present: armv7
So, I done some research and a simple alteration of the architecture (as follows) 'should' fix the problem:
However, the project fails to build with the following error(s):
ld: warning: ignoring file PROJECT/facebook-ios-sdk/build/facebook-ios-sdk.build/Release-iphoneos/facebook-ios-sdk.build/Objects-normal/armv6/libfacebook_ios_sdk.a, file was built for archive which is not the architecture being linked (armv7)
Undefined symbols for architecture armv7:
"_OBJC_CLASS_$_Facebook", referenced from:
objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Someone correct me if i'm wrong, but it seems that iTunes Connect won't accept an iPad app binary without armv7, and the Facebook SDK won't allow the app to be build with armv7, right?
The only viable solution is enable the Facebook Connect SDK to be build with armv7 to which i've had no success with, i've read plenty of forums and posts that don't really come up with a solution that openly works.
I've been struggling on this for about 7 hours and i honestly don't know what else to do.
Has anybody submitted an iPad only app with the Facebook Connect SDK included? Would be interested to see what settings you have for your project.
Thanks guys, any help would be greatly appreciated.
Instead of waiting for the new release of Facebook SDK, you can include the Facebook Source code in to the project then compile. It should work for armv7 architecture.

Resources