onsip / onsip-cordova

Other
48 stars 29 forks source link

Linker Errors? #5

Closed lylepratt closed 9 years ago

lylepratt commented 9 years ago

Just tried to install this plugin, but I'm getting tons of Linker errors. I've adjusted the Build Settings, Valid Architectures, etc, but none of that has helped.

I'm running iOS 8.1 on an iPhone 4S. Am I missing something simple?

oleg-ria commented 9 years ago

have the same problem (Yosemite, Xcode 6.1, cordova 4.0, device an iPhone 4S (iOS 8.1))

egreenmachine commented 9 years ago

I just tested on Yosemite (10.10), Xcode 6.1 (6A1052d), Cordova 4.0.0, iPhone 5s iOS 8.1 (12B411). There were no linker errors. I got my hands on an iPhone 4s, and I am updating to iOS 8.1 to test on that.

lylepratt commented 9 years ago

I'll try see if I get the same errors on my wife's old iPhone 5 later as well.

lylepratt commented 9 years ago

I just found an iPhone 5 in the office and it builds fine. iPhone 4S has tons of linker errors. Weird!

egreenmachine commented 9 years ago

I tested this on my iPhone 4s using the same setup and was still unable to reproduce the linker errors.

oleg-ria commented 9 years ago

@egreenmachine , may be we need to set exact steps for creating new test project, and then we could be able to see what is wrong? I guess we do something different. By the way, do we have wiki how to use this plugin?

egreenmachine commented 9 years ago

Exact guide can be found on our website: http://sipjs.com/guides/mobile/cordova/. I will add a link to the README file.

oleg-ria commented 9 years ago

just now have made new project by that guide, after that did "cordova build ios", run in Xcode... and got 110 linker errors

oleg-ria commented 9 years ago

@egreenmachine, what iOS version is on your iPhone 4s

egreenmachine commented 9 years ago

I was using the latest OS (8.1). I made sure to update it right before I tested. I don't have the phone on me, but I can provide the exact version on Monday.

oleg-ria commented 9 years ago

iPad (iOS 8.1(12B410)) same linker errors

egreenmachine commented 9 years ago

@NayRia Try deleting the libCordova.a and cleaning the project. Make sure that your environment is setup correctly and recompile. See if that resolves the issue.

oleg-ria commented 9 years ago

what does it mean "cleaning the project" ?

egreenmachine commented 9 years ago

In Xcode go to the product menu and choose clean.

oleg-ria commented 9 years ago

in finder deleted file Products/libCordova.a, then cleaned the project. It did not help

egreenmachine commented 9 years ago

Following my guide. Can you try to compile via command line and paste your output into a Gist?

oleg-ria commented 9 years ago

https://gist.github.com/NayRia/a13d14625c46898e72b1

oleg-ria commented 9 years ago

Yosemite, Xcode 6.1, cordova 4.0 just tried to run on iPhone 4 (iOS 7.1.2), here is results: https://gist.github.com/NayRia/da0282a81ca3f43d0b2f

egreenmachine commented 9 years ago

@NayRia We had 2 people here try to reproduce your issue and neither were able to. Could you provide step by step instructions of what you are doing?

oleg-ria commented 9 years ago
  1. $ cordova create mySipProject
  2. $ cd mySipProject/
  3. cordova platform add ios
  4. cordova plugin add https://github.com/onsip/onsip-cordova.git
  5. in index.js added this code https://gist.github.com/NayRia/3188c66281bae6b5df49 . In index.html added
<video id="remoteVideo"></video>
 <video id="localVideo"></video>

and then: cordova run ios

The project compiled without errors, but nothing worked. Then i did in Xcode:

  1. Replaced Bundle identifier and widget id with my iBundle ID
  2. In General section in project settings set deployment target to 7.1 ( i use iPhone 4 with iOS 7.1.2)
  3. Set Build Active Architecture Only to No
  4. Set Valid Architectures to armv7 And when i run my project in Xcode i've got a lot of linker errors

I tried do first five steps, then in Xcode in General project settings set deployment target to 7.1, and then cordova run ios, got linker errors

egreenmachine commented 9 years ago

Your linker error are related to the project configuration in Xcode. Make sure that the build settings are set to armv7 in both your project and the cordovalib project.

The project compiled without errors, but nothing worked.

Can you be more specific? Can your provide javascript console logs?

lylepratt commented 9 years ago

I was having this exact problem on my iPhone 4S and could find no way to solve it. It only stopped after I borrowed a friends iPhone 5 and was able to compile the project successfully (with no linker errors). After that, it worked every time on my iPhone 4S as well. I'm not really sure why.

oleg-ria commented 9 years ago

settings are set to armv7 in both your project and the cordovalib project.

Can you be more specific? Can your provide javascript console logs?

how can i see it? If i run it in console i get a lot of compiling logs. In Xcode it gives errors. I meant that do not see any activity, no messages to my signaling server

oleg-ria commented 9 years ago

I tried https://github.com/joseph-onsip/PhoneRTCMediaHandler, and succeed to register on signaling server, but then failed. It looks like PhoneRTCMediaHandler does not work with new PhoneRTC 2.0 (https://github.com/alongubkin/phonertc)

josephfrazier commented 9 years ago

It looks like PhoneRTCMediaHandler does not work with new PhoneRTC 2.0

That's correct. See https://github.com/onsip/onsip-cordova/issues/1#issuecomment-58571651, https://github.com/onsip/onsip-cordova/issues/3#issuecomment-61316511, and https://github.com/alongubkin/phonertc/issues/104#issuecomment-62636732

oleg-ria commented 9 years ago

@lylepratt had you compiled your project with Xcode and steps like i wrote above? it gives a hope :)

lylepratt commented 9 years ago

@NayRia i compiled exactly according to the instructions given in the documentation for the plugin.

oleg-ria commented 9 years ago

@lylepratt did you set deployment target to 8.1 ?

lylepratt commented 9 years ago

I ran into this again tonight. I found that there was an old rtc project in Cordova app's plugins directory that was clashing with the new one. I also found that I could eliminate most of the errors by clearing out "Library Search Paths" in Build Settings.

InspectorConstructor commented 9 years ago

I had the 110 linker errors also. They looked like C++ standard lib stuff, so I added the very latest libstdc++ (for me, libstdc++.6.0.9.dylib) to my "Link Binaries with Libraries" list in "Build Phases" in XCode. This solved the linker errors for me. It is kinda strange, there was already a libstdc++.dylib in the link list, but I guess that one doesn't have symbols for armv7? who knows... @NayRia, if you're still getting these errors, I'd recommend trying this.

LucasReyre commented 7 years ago

Thanks @InspectorConstructor your solution works well

AhsanAyaz commented 7 years ago

@InspectorConstructor DUDE !! You are a life saver. I've spent the whole day on this :/ It's my first day on ios build. VERY PAINFUL. Thanks. !!!!