I'm building a trigger.io native module and included the AFNetworking 2.0 framework by manually adding the header and implementation files into the ForgeModule project.
AFNetworking 2.0 indicates a target requirement of ios 6.0+.
In xcode, i've changed the deployment target for the UniversalForgeModule to 6.0.
Yet after including this newly packaged native module in my app, I get the following error upon building it:
Ld build/Release-iphonesimulator/ForgeInspector.app/Forge normal i386
cd /var/folders/xw/34h86n3d5p54qpq1wfc8ff600000b1/T/tmp5z_JZJ/ios/app
setenv IPHONEOS_DEPLOYMENT_TARGET 5.0.1
...
Undefined symbols for architecture i386:
_UTTypeCopyPreferredTagWithClass", referenced from:
-[AFStreamingMultipartFormData appendPartWithFileURL:name:error:] in frisbees.a(AFURLRequestSerialization.o)
"_UTTypeCreatePreferredIdentifierForTag", referenced from:
-[AFStreamingMultipartFormData appendPartWithFileURL:name:error:] in frisbees.a(AFURLRequestSerialization.o)
"_kUTTagClassFilenameExtension", referenced from:
-[AFStreamingMultipartFormData appendPartWithFileURL:name:error:] in frisbees.a(AFURLRequestSerialization.o)
"_kUTTagClassMIMEType", referenced from:
-[AFStreamingMultipartFormData appendPartWithFileURL:name:error:] in frisbees.a(AFURLRequestSerialization.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
** BUILD FAILED **
The following build commands failed:
Ld build/Release-iphonesimulator/ForgeInspector.app/Forge normal i386
(1 failure)
Looks like my build target is still 5.0.1. How do I go about changing that?
Full logs available here.
Thanks!
It seems AFNetworking 2.0 is referencing the Apple Framework: MobileCoreServices.framework.
To include Apple frameworks to your module, you will need to Change build configuration by adding an add_ios_system_framework build step.
Steps:
Add a build_steps.json file to the ios folder within your module directory.
Add the following to the file:
[
{
"do": {
"add_ios_system_framework": {
"framework": "MobileCoreServices.framework"
}
}
}
]
Update your inspector project, so that the newly added build step is applied to your project.
Related
I am integrating AppRTC to my hybrid app (ionic 3 and angular 4)...
iOS AppRTC Integration: https://github.com/ISBX/apprtc-ios
I've successfully installed the pod and build the project without errors but when I add
[RTCPeerConnectionFactory initializeSSL];
to my
application:didFinishLaunchingWithOptions:
When I build the project I get the following errors:
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_RTCPeerConnectionFactory", referenced from:
objc-class-ref 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)
Already searched the net but couldn't find a solution...
Added " ${inherited} $(OTHER_LDFLAGS) -ObjC -all_load" to the linker library, restart and clean xcode, deleted the DerivedData file but the issue still persist.
Not sure if this will help as you have installed from a pod but we got the same error when the framework search path was wrong. $(inherited) pathToWebrtcFramework. With this option we had built the webrtc framework ourselves using the instructions at https://webrtc.org/native-code/ios/.
Also set build active architecture only to yes.
I'm experimenting an issue since some days ago, and I don't know what I made to have my project under a bad configuration. I hope explain it in a good way:
If I configure my scheme with build configuration set to Release, the build is ok. But when I changed the build configuration to Debug, the build is failed with the following error:
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_RCTReconnectingWebSocket", referenced from:
objc-class-ref in libReact.a(RCTPackagerConnection.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
My project is a react native ejected with ExpoKit:
"expo": "^19.0.0",
"react-native": "https://github.com/expo/react-native/archive/sdk-19.0.0.tar.gz",
Plus, the project has CocoaPods as a dependency manager (so I open the project with the xcworkspace file).
Any ideas what do I have wrong?
I am getting following error while build
Undefined symbols for architecture arm64: "_OBJC_CLASS_$_MMWormhole",
referenced from: objc-class-ref in InterfaceController.o ld: symbol(s)
not found for architecture arm64 clang: error: linker command failed with exit
code 1 (use -v to see invocation)
I have installed plugin using
cordova plugin add cordova-plugin-apple-watch
I did not got any libmmwormhole.a file with plugin installation
I had added reference of MMWormhole.h in InterfaceController.m.
In your file InterfaceController, you use the class with a name containing "Wormhole." It's not defined anywhere, so the linker can't put it together. It looks like a library is missing.
Try to find in project MMWormhole or Wormhole if it's in and there is in project files inside Compile Sources than go Project -> Clean Build Folder and delete User/Libraries/Developer/Xcode/Derived Data folder
If it's not -- you need add library with it in your project.
I'm trying to make a single view application for iOS and tvOS with MobileVLCKit.
I downloaded files from git.
I ran ./buildMobileVLCKit.sh with -f key and got a framework ("MobileVLCKit.framework" folder containing MobileVLCKit binaty and Headers subfolder).
I temporary put the framework into ~/Desktop/FrameworkFolder/
I created new project in XCode, chose "File->Add files" and located the framework.
Added Framework Search Path in Project Options (~/Desktop/FrameworkFolder/, recursive).
Added #import into ViewController.h file.
Added VLCMediaPlayer *vPlayer = [[VLCMediaPlayer alloc] init]; into ViewController.m -> viewDidLoad method.
This is my binary:
imac:~ vlad$ file ~/Desktop/FrameworkFolder/MobileVLCKit.framework/MobileVLCKit
/Users/vlad/Desktop/FrameworkFolder/MobileVLCKit.framework/MobileVLCKit: Mach-O universal binary with 5 architectures
/Users/vlad/Desktop/FrameworkFolder/MobileVLCKit.framework/MobileVLCKit (for architecture armv7): current ar archive random library
/Users/vlad/Desktop/FrameworkFolder/MobileVLCKit.framework/MobileVLCKit (for architecture armv7s): current ar archive random library
/Users/vlad/Desktop/FrameworkFolder/MobileVLCKit.framework/MobileVLCKit (for architecture i386): current ar archive random library
/Users/vlad/Desktop/FrameworkFolder/MobileVLCKit.framework/MobileVLCKit (for architecture x86_64): current ar archive random library
/Users/vlad/Desktop/FrameworkFolder/MobileVLCKit.framework/MobileVLCKit (for architecture arm64): current ar archive random library
When I try to build and run the project I'm getting two types of errors:
If I'm working with AppleTV project:
ld: in /Users/vlad/Desktop/FrameworkFolder/MobileVLCKit.framework/MobileVLCKit(VLCMediaPlayer.o), building for tvOS, but linking in object file built for iOS, for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
If I'm working with iOS project:
Undefined symbols for architecture x86_64:
"_AVAudioSessionCategoryPlayback", referenced from:
_Start in MobileVLCKit(audiounit_ios.o)
_Pause in MobileVLCKit(audiounit_ios.o)
"_AVAudioSessionModeMoviePlayback", referenced from:
_Start in MobileVLCKit(audiounit_ios.o)
_Pause in MobileVLCKit(audiounit_ios.o)
"_AudioComponentFindNext", referenced from:
_Start in MobileVLCKit(audiounit_ios.o)
"_AudioComponentInstanceDispose", referenced from:
_Stop in MobileVLCKit(audiounit_ios.o)
— at the begining, and:
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Showing first 200 notices only
— at the end of output. And 155 critical errors between.
I have tried to use precompilled framework as well, same result.
The questions are:
What am I doing wrong?
How can I solve this issue and successfully
build and run the project(s)?
Thank you for any help!
The reason of ld and clang errors was that the Framework and the Library has been built wrong.
The reason of multiple errors during working with iOS project is that required system frameworks has not been included.
I built the static library using XCode and the issue has been solved!
Background:
I'm trying to use a Phonegap with cocoapods. Phonegap already has issues compiling from command line so I'm just using Xcode with the generated project file (and assumably I'd have to do that anyway when using cocoapods).
I've pushed up on Github a reproduced empty project with my problem:
https://github.com/Dan2552/phonegap-reproducable-issue
You can see the steps I made after making a plain brand-new Phonegap app in the build_ios script in the root directory on the repo. But I've also pushed up the generated project files (platforms/ios) so anybody without Phonegap should be able to open the project.
Problem:
I'm having a weird issue with compiling. Probably issues with the pre-bundled Cordova library and cocoapods.
When building without doing anything after generating the project with Phonegap and adding in the cocoapods, I get the following errors:
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_OTPublisher", referenced from:
objc-class-ref in libPods.a(OpenTokPlugin.o)
"_OBJC_CLASS_$_OTSession", referenced from:
objc-class-ref in libPods.a(OpenTokPlugin.o)
"_OBJC_CLASS_$_OTSubscriber", referenced from:
objc-class-ref in libPods.a(OpenTokPlugin.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Cocoapods warns:
[!] The target HelloWorld [Debug] overrides the OTHER_LDFLAGS build setting defined in `Pods/Pods.xcconfig'.
[!] The target HelloWorld [Debug - Release] overrides the OTHER_LDFLAGS build setting defined in `Pods/Pods.xcconfig'.
and therefore I tried deleting the OTHER_LDFLAGS ('Other Linker Flags' in Xcode) entry altogether. This successfully compiles on an iOS device, but not on the simulator, nor will the project build on archive.
Building for simulator will get the same error as before (Undefined symbols for architecture)
Building for archive will get
/Users/dan2552/projects/ReproducableProblems/OpenTokPhonegap/Classes/OpentokPlugin.h:9:9: 'Cordova/CDVPlugin.h' file not found
I've also tried putting $(inherited) in the OTHER_LDFLAGS which produces the same results as deleting them.
Your included framework has no Simulator (i386) slice:
$ xcrun -sdk iphoneos lipo -info Pods/OpenTokSDK-WebRTC/Opentok.framework/Versions/A/Opentok
Architectures in the fat file: Pods/OpenTokSDK-WebRTC/Opentok.framework/Versions/A/Opentok are: armv7 armv7s
So its classes can't be linked for the Simulator.
Also if you plan to use CocoaPods you could remove the Cordova project and static library entirely and add pod 'Cordova' to your Podfile.
I've seen similar issues before when trying to run the Xcode project, rather than the XCWorkspace. The issue you're having sounds like it's because you're not running the workspace.
Go to your taget Build Settings -> Other linker flags -> double click . Add $(inherited) to a new line .
. Try this