React Native Share Extension won't build - ios

I'm trying to add a Share Extension to a React Native app and when I try to build the app I get this linking error:
Undefined symbols for architecture x86_64:
"_RCTRegisterModule", referenced from:
_initialize_ShareManager in ShareManager-75b70a88150f3f544e5598c2fcbaaa49e4e22b3f47bce8d9a721bf31763b426d.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
This is the offending code (when I comment this out the rest of the app builds fine):
#interface RCT_EXTERN_MODULE(ShareManager, NSObject)
RCT_EXTERN_METHOD(getURL: (RCTResponseSenderBlock)callback)
#end
Has anyone got any insight into how I can fix this? I've done a lot of googling and tried a hundred different permutations of linking binaries, different linker flags etc. But so far I've got nowhere.
Thanks for any help!

Related

Google Consent SDK - Linker Error

I'm currently trying to integrate the Google Consent SDK, but as soon as I call
[PACConsentInformation.sharedInstance requestConsentInfoUpdateForPublisherIdentifiers:#[ #"pub-0123456789012345"]
I get the following error in Xcode console:
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_PACConsentInformation", referenced from:
objc-class-ref in AppDelegate.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 been searching Stackoverflow for a couple of hours now and I've tried various things such as Enabling Bitcode, Updating Linker Flags with $(inherited), as well as a few other things like adding suggested frameworks and libz found in popular questions/answers here, but still no luck.
I've gone as far to try my project in Xcode 8.3.2, Xcode 9.0 and Xcode 9.2, all of which show this error.
Is there anything I'm missing?
I'm completely stuck for ideas now.
Thanks for you help.
Go to Build Phase -> Link Binary With Libraries then add PersonalizedAdConsent framework

IMFPush Bluemix not working on Swift 2.2 (i386 error)

Anyone knows how to solve this error? I can't compile my project with IMFPush library =/
ld: warning: ignoring file /Users/kersul/Develop/Grabit_iOS/Pods/IMFPush/Frameworks/IMFPush.framework/IMFPush,
missing required architecture i386 in file
/Users/kersul/Develop/Grabit_iOS/Pods/IMFPush/Frameworks/IMFPush.framework/IMFPush
(2 slices) Undefined symbols for architecture i386:
"_OBJC_CLASS_$_IMFPushClient", referenced from:
type metadata accessor for __ObjC.IMFPushClient in AppDelegate.o ld: symbol(s) not found for architecture i386 clang:
error: linker command failed with exit code 1 (use -v to see
invocation)
There are a few questions around that seem to tackle this issue.
I would first take a look at Jordan's advice here
and ensure that the framework was added to your project correctly. Additionally ensure that the framework has been linked correctly
If neither fixes the issue then also see the answer posed by Allen and check to see if your .m file is listed under your compile sources.
That said, i386 architecture is what is used by the iOS Simulator. Do be aware that the Simulator cannot replicate push functionality, so even if you are able to compile IMFPush for it, it will not function correctly.

Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_ToDoItem"

I'm trying to the Xcode Tutorial on a iOS ToDoApp. I've done all the steps and certainly I've got compile errors.
I've searched around and I've seen that I'm not the only one with this problem, and I have tried peoples solutions but with no success.
This is my error message:
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_ToDoItem", referenced from:
objc-class-ref in ToDoListTableViewController.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
It seems you are missing ToDoItem.m (or better said the #implementation ToDoItem) in your project. Either it's not there at all or the file is not included in the build target.
Try to search #implementation ToDoItem in your project. If it's missing, you have to add it. If it's not missing, make sure that the file is added to the target you are trying to build.

MPMusicPlayerController linker error in Xcode 5.1

My media player app was compiling fine and working seamlessly in older versions.
I upgraded my Xcode and i get the following errors
Undefined symbols for architecture armv7:
"_OBJC_CLASS_$_MPMusicPlayerController", referenced from:
objc-class-ref in libvolumectrl_r.a(PlayerVolumeControl.o)
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I have tried the following based on my previous solutions search
Added MediaPlayer.framework in build phase link libraries
included following imports in my source files
#import <MediaPlayer/MediaPlayer.h>
#import <MediaPlayer/MPMusicPlayerController.h>
i am still unable to compile. Please let me know if there are any other missing steps
Go to the Build Settings -> Valid Architectures -> remove armv7 Architecture.
Only arm64 in Architecture.
Then clean application and build it.No any linker error come.
Please follow this steps.
Regards,
Kinjal

SenTestCase linker error iOS

I'm trying to write test cases for my iOS app. However, there seems to be some problem regarding SenTesting framework. I'm getting the following error:
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_SenTestCase", referenced from:
_OBJC_CLASS_$_testSmartDiary in testSmartDiary.o
_OBJC_CLASS_$_testAddTask in testAddTask.o
_OBJC_CLASS_$_testAddContacts in testAddContacts.o
"_OBJC_METACLASS_$_SenTestCase", referenced from:
_OBJC_METACLASS_$_testSmartDiary in testSmartDiary.o
_OBJC_METACLASS_$_testAddTask in testAddTask.o
_OBJC_METACLASS_$_testAddContacts in testAddContacts.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I don't know what is going wrong. I have added the SenTestingFramework. It is probably happening because I'm using two different machines to develop the same project. Do I need to specify some path? I read the solution given here: iOS: Linker errors with OCUnit integration
but it is not feasible to delete the target and add the things again every time I switch machines. Is there a permanent solution to this? Please help

Resources