googlesamples / ios-nearby

68 stars 30 forks source link

link error #24

Open baizhe-grab opened 7 years ago

baizhe-grab commented 7 years ago

The nearby sdk runs very well both simulator and device, but when I try unit test, the linker got an error below: ld: illegal text-relocation to '_kZipBeaconV3ServiceID' in /Users/baizhe/Library/Developer/Xcode/DerivedData/MyTeksi-fmtwanojygcmibhckitjhwjghnll/Build/Intermediates/CodeCoverage/Products/Testing-iphonesimulator/MyTeksi.app/MyTeksi from 'l032' in /Users/baizhe/Documents/passenger-ios-cherry/Pods/NearbyMessages/Libraries/libGNSMessages.a(PEBeacon.o) for architecture x86_64

Do I need a Position-Dependent library?

Any idea will be appreciate.

Melzar commented 6 years ago

I'm facing same issue - is there any fix for that? @baizhe-grab @dan-webb

MarcoFilosi commented 6 years ago

Same issue here on XCode 9.3. Any fix?

baizhe-grab commented 6 years ago

Still not. I just ignored this feature in UT =.=

MarcoFilosi commented 6 years ago

@baizhe-grab How did you remove Nearby in UT and keeping it on main project?

Melzar commented 6 years ago

I've got solution regarding it - It was related in my case to cocoapods and using abstract modules. When I moved my nested modules one level up ( removed abstract one ) then everything worked fine.

MarcoFilosi commented 6 years ago

@Melzar Could you please specify CocoaPods version and provide more details (steps to follow) on how to fix it? Thanks

TCvetkovic commented 5 years ago

I had the same problem and after a few debugging hours, here is an example of how I solved that with removing NearbyMessages from test target. (With the help from baizhe-grab comment.)

Let's say we have two targets ProjectDev & ProjectProd.

Let's add a new test target ProjectTests.

We will still use the same abstract_target for multiple targets, but we will have a separate target for Test target but without NearbyMessages.

Podfile example:

platform :ios, '11.0'

use_frameworks!

abstract_target 'defaults' do
   pod 'NearbyMessages'
   pod 'RealmSwift'

   target 'ProjectDev'
   target 'ProjectProd'
end

target 'ProjectTests' do
   pod 'RealmSwift'
end
robertmryan commented 4 years ago

How can this still be an issue?