ios-nearby icon indicating copy to clipboard operation
ios-nearby copied to clipboard

link error

Open baizhe-grab opened this issue 7 years ago • 8 comments

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.

baizhe-grab avatar Mar 16 '17 13:03 baizhe-grab

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

Melzar avatar Mar 28 '18 19:03 Melzar

Same issue here on XCode 9.3. Any fix?

MarcoFilosi avatar Apr 09 '18 08:04 MarcoFilosi

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

baizhe-grab avatar Apr 09 '18 08:04 baizhe-grab

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

MarcoFilosi avatar Apr 09 '18 12:04 MarcoFilosi

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.

Melzar avatar Apr 11 '18 06:04 Melzar

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

MarcoFilosi avatar Apr 11 '18 07:04 MarcoFilosi

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

TCvetkovic avatar Jun 11 '19 18:06 TCvetkovic

How can this still be an issue?

robertmryan avatar Nov 15 '19 00:11 robertmryan