Reputation: 3357
I have a react-native project and I started getting following error in my xcode build after I installed some mapbox related pods.
ld: warning: building for iOS, but linking in dylib file (/Users/nitinsharma/Library/Developer/Xcode/DerivedData/app-bpqejjqomhurrldtyubqevqtdqzc/Build/Products/Debug-iphoneos/MapboxAccounts.framework/MapboxAccounts) built for Mac Catalyst
Undefined symbols for architecture arm64:
"_swift_getFunctionReplacement", referenced from:
_swift_getFunctionReplacement50 in libswiftCompatibilityDynamicReplacements.a(DynamicReplaceable.cpp.o)
(maybe you meant: _swift_getFunctionReplacement50)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Now the error goes aways if I follow these steps
1. Go to project>build settings> library search path
2. remove "$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)"
However after that I am not able to install the app as I get following error when xcode tries to install the app on my device. I even tried deleting DerivedData
folder but no luck
Details
Unable to install "app"
Domain: com.apple.dt.MobileDeviceErrorDomain
Code: -402653103
--
Could not inspect the application package.
Domain: com.apple.dt.MobileDeviceErrorDomain
Code: -402653103
User Info: {
DVTRadarComponentKey = 282703;
MobileDeviceErrorCode = "(0xE8000051)";
"com.apple.dtdevicekit.stacktrace" = (
0 DTDeviceKitBase 0x0000000124ca7c8f DTDKCreateNSErrorFromAMDErrorCode + 220
1 DTDeviceKitBase 0x0000000124ce6241 __90-[DTDKMobileDeviceToken installApplicationBundleAtPath:withOptions:andError:withCallback:]_block_invoke + 155
2 DVTFoundation 0x000000010950764b DVTInvokeWithStrongOwnership + 71
3 DTDeviceKitBase 0x0000000124ce5f82 -[DTDKMobileDeviceToken installApplicationBundleAtPath:withOptions:andError:withCallback:] + 1440
4 IDEiOSSupportCore 0x0000000124b56a10 __118-[DVTiOSDevice(DVTiPhoneApplicationInstallation) processAppInstallSet:appUninstallSet:installOptions:completionBlock:]_block_invoke.292 + 3513
5 DVTFoundation 0x000000010963617e __DVT_CALLING_CLIENT_BLOCK__ + 7
6 DVTFoundation 0x0000000109637da0 __DVTDispatchAsync_block_invoke + 1191
7 libdispatch.dylib 0x00007fff7182e6c4 _dispatch_call_block_and_release + 12
8 libdispatch.dylib 0x00007fff7182f658 _dispatch_client_callout + 8
9 libdispatch.dylib 0x00007fff71834c44 _dispatch_lane_serial_drain + 597
10 libdispatch.dylib 0x00007fff718355d6 _dispatch_lane_invoke + 363
11 libdispatch.dylib 0x00007fff7183ec09 _dispatch_workloop_worker_thread + 596
12 libsystem_pthread.dylib 0x00007fff71a89a3d _pthread_wqthread + 290
13 libsystem_pthread.dylib 0x00007fff71a88b77 start_wqthread + 15
);
}
--
System Information
macOS Version 10.15.6 (Build 19G2021)
Xcode 12.4 (17801) (Build 12D4e)
I am using react native v0.63.0
and Xcode 12.4
and my device is running iOS 14.4
Mapbox related pods that are installed
mapbox related pods from my podfile.lock
- Mapbox-iOS-SDK (6.3.0):
- MapboxMobileEvents (~> 0.10.4)
- MapboxAccounts (2.3.1)
- MapboxCommon (9.2.0)
- MapboxCoreNavigation (1.2.1):
- MapboxAccounts (~> 2.3.0)
- MapboxDirections (~> 1.2.0)
- MapboxMobileEvents (~> 0.10.2)
- MapboxNavigationNative (~> 30.0)
- Turf (~> 1.0)
- MapboxDirections (1.2.0):
- Polyline (~> 5.0)
- Turf (~> 1.0)
- MapboxMobileEvents (0.10.7)
- MapboxNavigation (1.2.1):
- Mapbox-iOS-SDK (~> 6.0)
- MapboxCoreNavigation (= 1.2.1)
- MapboxMobileEvents (~> 0.10.2)
- MapboxSpeech (~> 1.0)
- Solar (~> 2.1)
- MapboxNavigationNative (30.0.0):
- MapboxCommon (= 9.2.0)
- MapboxSpeech (1.0.0)
Upvotes: 1
Views: 11283
Reputation: 664
I had the same errors in my project. Tried everything in here: https://github.com/react-native-community/upgrade-support/issues/25
And what finally resolved it was to change Don't Dead-strip Inits and Terms
to Yes
for both Project and Target.
Upvotes: 11