bugfender / BugfenderSDK-iOS

Bugfender SDK for iOS, a remote logger tailor-made for mobile
https://bugfender.com
Other
76 stars 30 forks source link

Bugfender doesn't seem to compile for xcode test target #3

Closed tonyxiao closed 9 years ago

tonyxiao commented 9 years ago

Works fine for the app target itself, but when xcode tries to compile the test target from command line it fails to find bugfender at link time. Building the project itself seems to be fine. This is reproducible in a clean VM continuous integration environment. I'm linking bugfender using cocoapods, if that makes a different.

xcodebuild test -workspace $WORKSPACE -scheme $SCHEME -destination 'platform=iOS Simulator,OS=latest,name=iPhone 6'

Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_Bugfender", referenced from:
      __TMaCSo9Bugfender in Logging.o
      __TMaCSo9Bugfender in AppDelegate.o
      l_OBJC_$_CATEGORY_Bugfender_$_Swift in Ketch-Bridging.o
  "___BFLog", referenced from:
      +[Bugfender(Swift) logWithFilename:lineNumber:functionName:tag:level:message:] in Ketch-Bridging.o
ld: symbol(s) not found for architecture x86_64
jgimenez commented 9 years ago

Hi @tonyxiao it looks like one of the methods you're testing uses Bugfender. The compiler knows about the Bugfender headers but the linker does not.

Since you're using Swift, the frameworks included in the main target are not included in the testing one. You should link Bugfender as well in the testing target. Did you do that?

tonyxiao commented 9 years ago

Cleaning the project solves the problem, but then it would resurface from time to time and re-clean is required. I'm using many libraries but this problem only happens with Bugfender.

jgimenez commented 9 years ago

I'm sorry but if it does sometimes work and sometimes not it's more probably that you hit a bug in CocoaPods or Xcode. I tried several things but could not reproduce your problem

I would recommend including the cleaning in your script so that you always build the whole project from scratch. It's a best practice anyway, since sometimes you could run into a situation that something works in your machine due to incremental compilation but the build is broken and your colleagues can not build.

tonyxiao commented 9 years ago

We're still seeing issues with Bugfender dependency, is it possible to open source the framework instead of shipping an compiled library? That way if I run into issues I can fix myself rather than having to open an issue and go back and forth like this.

jgimenez commented 9 years ago

Hi @tonyxiao . What are you having problems with? We'd like to help you fix them. The SDK unfortunately can not be made open source.

Please open bug reports and we'll take care of them.

tonyxiao commented 9 years ago

The same issue in the original post. Whether or not it's a bug with xcode or cocoapods I don't know, but we only run into this issue with BugFender dependency, not any other dependency for some reason.