Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xcode build error - dylib failure #261

Closed
teeolendo opened this issue Nov 16, 2020 · 10 comments
Closed

Xcode build error - dylib failure #261

teeolendo opened this issue Nov 16, 2020 · 10 comments
Labels

Comments

@teeolendo
Copy link

I'm using the RNPLS version 6.0.3, and when I run the application on my device, I get a persistent build error. It builds fine on the simulator but it doesn't build when I run it on my device or when I set it to a generic ios device.

ld: building for iOS, but linking in dylib file (/Users/********/Library/Developer/Xcode/DerivedData/projectname-fwcxydociljoyzfueniqbwswsbyy/Build/Products/Release-iphoneos/LinkKit.framework/LinkKit) built for iOS Simulator, file '/Users/*********/Library/Developer/Xcode/DerivedData/projectname-fwcxydociljoyzfueniqbwswsbyy/Build/Products/Release-iphoneos/LinkKit.framework/LinkKit' for architecture arm64

I've followed the instructions here

This is a screenshot of my .xcodeproj setup. pod project looks pretty much the same
Screenshot 2020-11-16 at 2 56 23 AM

Environment

Plaid Link React Native 6.0.3
ReactNative Version 0.62.2
XCode Version 12.2
Plaid version 2.0.5
Android Devices/Emulators n/a
Occurs on iOS yes
iOS Version 12 >
iOS Devices/Emulators works on Simulator; doesn't work on connected iPhone 11

Logs

Results from when I run find . -path '*LinkKit.framework/Info.plist'|pbcopy; pbpaste; pbpaste|xargs -n1 /usr/libexec/PlistBuddy -c 'Print CFBundleSupportedPlatforms' -c 'Print CFBundleShortVersionString' -c 'Print CFBundleVersion':

./ios/Pods/Plaid/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Info.plist
./ios/Pods/Plaid/LinkKit.xcframework/ios-arm64/LinkKit.framework/Info.plist
Array {
    iPhoneSimulator
}
2.0.5
1131.1
Array {
    iPhoneOS
}
2.0.5
1131.1
@cohen72
Copy link

cohen72 commented Nov 16, 2020

my co-worker @elingersin1 and I spent the day digging and discovered that the by switching the order of the entries within the ./Pods/Plaid/LinkKit.xcframework/Info.plist file, so that the entry for ios-arm64 comes before the entry for ios-arm64_x86_64-simulator, followed by re-running pod install will correctly generate the Pods-<Project>-artifacts.sh file which is being run during the [CP] Prepare Artifacts build phase, so that the correct LinkKit.framework is being installed when compiling the project.

The resulting Info.plist should look like this:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>AvailableLibraries</key>
	<array>
  <dict>
			<key>LibraryIdentifier</key>
			<string>ios-arm64</string>
			<key>LibraryPath</key>
			<string>LinkKit.framework</string>
			<key>SupportedArchitectures</key>
			<array>
				<string>arm64</string>
			</array>
			<key>SupportedPlatform</key>
			<string>ios</string>
		</dict>
		<dict>
			<key>LibraryIdentifier</key>
			<string>ios-arm64_x86_64-simulator</string>
			<key>LibraryPath</key>
			<string>LinkKit.framework</string>
			<key>SupportedArchitectures</key>
			<array>
				<string>arm64</string>
				<string>x86_64</string>
			</array>
			<key>SupportedPlatform</key>
			<string>ios</string>
			<key>SupportedPlatformVariant</key>
			<string>simulator</string>
		</dict>		
	</array>
	<key>CFBundlePackageType</key>
	<string>XFWK</string>
	<key>XCFrameworkFormatVersion</key>
	<string>1.0</string>
</dict>
</plist>

@zsweigart zsweigart added the ios label Nov 17, 2020
@osikes
Copy link

osikes commented Nov 23, 2020

Running into same issue. With a m1 MacBook Pro.

@Zhuxingzhi01
Copy link

怎么解决呢

@Liamandrew
Copy link

Very frustrating issue, especially when there's not much support on how to fix it. Eventually I upgraded to the latest cocoapods version (1.10.0) & did pod install and this fixed the issue for me without needing to modify the Info.plist like above.

@lukaskai
Copy link

lukaskai commented Dec 9, 2020

Yes, upgrading cocoapods version to 1.10.0 helped.

@afh
Copy link
Contributor

afh commented Dec 16, 2020

Thanks, for the report @Liamandrew, @lukaskai.

@teeolendo can you confirm that updating CocoaPods 1.10.0 resolves the issue for you too and close this issue?

@agoldis
Copy link

agoldis commented Jan 20, 2021

Updated cocoapods to 1.10.1 - still facing the issue

@afh
Copy link
Contributor

afh commented Jan 20, 2021

@agoldis Can you check if the Xcode Build Setting VALIDATE_WORKSPACE is set to NO, set it accordingly if it isn't and retry, please?

@agoldis
Copy link

agoldis commented Jan 20, 2021

@afh I did, still no luck - I am seeing the next message:

dyld: Library not loaded: @rpath/LinkKit.framework/LinkKit
  Referenced from: /private/var/containers/Bundle/Application/F3B7A692-0561-4989-8858-DC33A1582D3D/xxx-staging.app/xxx-staging
  Reason: image not found
dyld: launch, loading dependent libraries
DYLD_LIBRARY_PATH=/usr/lib/system/introspection
DYLD_INSERT_LIBRARIES=/Developer/usr/lib/libBacktraceRecording.dylib:/Developer/usr/lib/libMainThreadChecker.dylib:/Developer/Library/PrivateFrameworks/DTDDISupport.framework/libViewDebuggerSupport.dylib:/Developer/Library/PrivateFrameworks/GPUTools.framework/libglInterpose.dylib:/usr/lib/libMTLCapture.dylib

Trying to run on a iOS 14.2 physical device, also unsuccessfully tried Info.plist trick

Xcode version 12.3 (12C33)
Cocoapods version 1.10.1
react-native-plaid-link-sdk 6.0.4
react-native 0.61.3

Screen Shot 2021-01-20 at 12 05 28 PM

@agoldis
Copy link

agoldis commented Jan 21, 2021

Fixed by switching to new build system and manually dragging LinkKit into embedded frameworks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

10 participants