onsip / onsip-cordova

Other
48 stars 29 forks source link

Undefined symbols for architecture i386 - ionic build ios #21

Closed LTroya closed 9 years ago

LTroya commented 9 years ago

I am having problem using sipjs on ionic. I followed all the steps that in the docs appears. I configured .xcodeproj and install this plugin https://github.com/onsip/onsip-cordova.git

Here is the log I received:

Undefined symbols for architecture i386:
  "_OBJC_CLASS_$_RTCEAGLVideoView", referenced from:
      objc-class-ref in PhoneRTCPlugin.o
  "_OBJC_CLASS_$_RTCICECandidate", referenced from:
      objc-class-ref in PhoneRTCDelegate.o
  "_OBJC_CLASS_$_RTCICEServer", referenced from:
      objc-class-ref in PhoneRTCPlugin.o
  "_OBJC_CLASS_$_RTCMediaConstraints", referenced from:
      objc-class-ref in PhoneRTCDelegate.o
  "_OBJC_CLASS_$_RTCPair", referenced from:
      objc-class-ref in PhoneRTCDelegate.o
  "_OBJC_CLASS_$_RTCPeerConnectionFactory", referenced from:
      objc-class-ref in PhoneRTCDelegate.o
  "_OBJC_CLASS_$_RTCSessionDescription", referenced from:
      objc-class-ref in PhoneRTCDelegate.o
  "_OBJC_CLASS_$_RTCVideoCapturer", referenced from:
      objc-class-ref in PhoneRTCDelegate.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/emulator/Business\ Card.app/Business\ Card normal i386
(1 failure)
Error code 65 for command: xcodebuild with args: -xcconfig,/Users/LTroya/LTroya/Cibersys/ionic_tdp/platforms/ios/cordova/build-debug.xcconfig,-project,Business Card.xcodeproj,ARCHS=i386,-target,Business Card,-configuration,Debug,-sdk,iphonesimulator,build,VALID_ARCHS=i386,CONFIGURATION_BUILD_DIR=/Users/LTroya/LTroya/Cibersys/ionic_tdp/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/LTroya/LTroya/Cibersys/ionic_tdp/platforms/ios/build/sharedpch
ERROR building one of the platforms: Error: /Users/LTroya/LTroya/Cibersys/ionic_tdp/platforms/ios/cordova/build: Command failed with exit code 2
You may not have the required environment or OS to build this project
Error: /Users/LTroya/LTroya/Cibersys/ionic_tdp/platforms/ios/cordova/build: Command failed with exit code 2
    at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:139:23)
    at ChildProcess.emit (events.js:110:17)
    at maybeClose (child_process.js:1015:16)
    at Process.ChildProcess._handle.onexit (child_process.js:1087:5)

I removed the plugin and built it with the same command without problem. That happens when I add this cordova plugin that this log appears.

This info could helps you out:

Cordova CLI: 5.2.0 Gulp version: CLI version 3.9.0 Gulp local:
Ionic Version: 1.0.0 Ionic CLI Version: 1.6.4 Ionic App Lib Version: 0.3.8 ios-deploy version: 1.7.0 ios-sim version: 4.1.1 OS: Mac OS X Yosemite Node Version: v0.12.7 Xcode version: Xcode 6.4 Build version 6E35b

I will appreciate any hint to help me to solve this problem :+1:

LTroya commented 9 years ago

That was my fault. I am new using XCode but here is the solution, I hope that helps someone out.

The problem was I was building the app with an emulator as target. All the emulator works with i386 arquitecture. That It's why the error happens.

The solution was set iOS device as a target of your project and it works like a charm.

Carlos77 commented 6 years ago

Hi Luis I have the same problem I tried to build on an iPhone 7 without success. here is the error received:

ld: warning: ignoring file /Users/sophos/Documents/WorkSpace/Test2/platforms/ios/Test2/Plugins/com.onsip.cordova/libwebrtc_video_coding.a, file was built for archive which is not the architecture being linked (arm64): /Users/sophos/Documents/WorkSpace/Test2/platforms/ios/Test2/Plugins/com.onsip.cordova/libwebrtc_video_coding.a Undefined symbols for architecture arm64: "_OBJCCLASS$_RTCEAGLVideoView", referenced from: objc-class-ref in PhoneRTCPlugin.o "_OBJCCLASS$_RTCICECandidate", referenced from: objc-class-ref in PhoneRTCDelegate.o "_OBJCCLASS$_RTCICEServer", referenced from: objc-class-ref in PhoneRTCPlugin.o "_OBJCCLASS$_RTCMediaConstraints", referenced from: objc-class-ref in PhoneRTCDelegate.o "_OBJCCLASS$_RTCPair", referenced from: objc-class-ref in PhoneRTCDelegate.o "_OBJCCLASS$_RTCPeerConnectionFactory", referenced from: objc-class-ref in PhoneRTCDelegate.o "_OBJCCLASS$_RTCSessionDescription", referenced from: objc-class-ref in PhoneRTCDelegate.o "_OBJCCLASS$_RTCVideoCapturer", referenced from: objc-class-ref in PhoneRTCDelegate.o ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

a solution please