简体   繁体   中英

React Native IOS App works fine on IOS version 15 and 14 but crashes on splash screen for IOS 12 and 13

When I am running my react native app on IOS 14 and 15 versions, it works fine. But when I run my app for IOS 12 and 13, it fails on Xcode with the following error:

dyld: Library not loaded: /usr/lib/swift/libswiftWebKit.dylib Referenced from: /Users/pravesh2/Library/Developer/CoreSimulator/Devices/3DCC37D6-C744-4D43-9D8C-D1D1241449F4/data/Containers/Bundle/Application/74376524-5AE0-48BB-8400-6766A893F5D7/RegoReactNative.app/RegoReactNative Reason: image not found dyld: launch, loading dependent libraries DYLD_SHARED_CACHE_DIR=/Users/pravesh2/Library/Developer/CoreSimulator/Caches/dyld/21A559/com.apple.CoreSimulator.SimRuntime.iOS-13-0.17A577 DYLD_ROOT_PATH=/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 13.0.simruntime/Contents/Resources/RuntimeRoot DYLD_LIBRARY_PATH=/Users/pravesh2/Library/Developer/Xcode/DerivedData/RegoReactNative-bsjgjlzpcbtlynfhkcijhdzedlqe/Build/Products/Debug-iphonesimulator:/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 13.0.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/introspection DYLD_INSERT_LIBRARIES=/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 13.0.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libBacktraceRecording.dylib:/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 13.0.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libMainThreadChecker.dylib:/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 13.0.simruntime/Contents/Resources/RuntimeRoot/Developer/Library/PrivateFrameworks/DTDDIS (lldb)

In XCode I have set the minimum deployment target as 12.0 and I am running XCode version 13.2.1 and using new build system. React Native version - 0.63.4

Any help would be appreciated. Thanks.

libSwiftWebKit is specifically a Swift library. Not sure why your App works on newer iOS versions and fails on older versions. Unless newer iOS versions have different behaviors towards Objective-C projects (which I believe is most of the code written for React Native iOS libraries).

You can try adding an empty .swift source file to the Xcode project and try compiling. The steps are as follows.

  1. Open your React Native project folder.
  2. Open the.xcworkspace file in the ios sub-folder.
  3. On the Navigator Panel (left panel) expand top most item (the app project).
  4. Right click on the first folder inside the Project you expanded.
  5. Click "New File"
  6. Select "Swift File" from the "iOS" tab and click "Next"
  7. Give the file any name (for example "File.swift") and save it.
  8. Xcode will prompt you to add a "Bridging File" - confirm the creation of a bridging file.
  9. Retry iOS build

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM