IOS compilation of the compiler linker library / framework for the device, but not the simulator

Story:

I am trying to use Phonegap with cocoapods. Phonegap already has problems compiling from the command line, so I just use Xcode with the generated project file (and, presumably, I would have to do this when using cocoapods).

I put up on Github a reproducible empty project with my problem: https://github.com/Dan2552/phonegap-reproducable-issue

You can see the steps I took after creating a completely new Phonegap application in the build_ios script in the root directory of the repo. But I also pushed the generated project files (platform / ios) so that anyone who didn't have a phone could open the project.

Problem:

I had a strange compilation problem. Probably problems with the pre-built library of Cordoba and cocoapods.

When creating without any action after creating the project using Phonegap and adding to 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 HelloWorld [Debug] ] target overrides the OTHER_LDFLAGS build parameter defined in `Pods / Pods.xcconfig '.

[!] The HelloWorld [Debug - Release] OTHER_LDFLAGS overrides the OTHER_LDFLAGS build parameter defined in `Pods / Pods.xcconfig '.

and so I tried to remove the OTHER_LDFLAGS element ('Other Linker Flags' in Xcode) in general. This compiles successfully on the iOS device , but not on the simulator, and the project will not be created based on the archive.

The building for the simulator will receive the same error as before ( Undefined symbols for architecture )

The building for the archive will receive /Users/dan2552/projects/ReproducableProblems/OpenTokPhonegap/Classes/OpentokPlugin.h:9:9: 'Cordova/CDVPlugin.h' file not found

I also tried putting $(inherited) in OTHER_LDFLAGS , which gives the same results as deleting them.

+7
ios build xcode cocoapods cordova
source share
3 answers

There is no Simulator (i386) fragment in your included structure:

 $ 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 

Thus, its classes cannot be related to the simulator.


Also, if you plan to use CocoaPods, you can completely delete the project and the old Cordova library and add the pod 'Cordova' to your subfile.

+3
source share

I saw similar problems before when I tried to start an Xcode project, not an XCWorkspace. You are having a problem because you are not using the workspace.

+1
source share

Go to your Build Settings tag → Other linker flags → double click. Add $ (inherited) to the new line. , Try it

0
source share

All Articles