库未加载:@rpath/OpenSSL.framework/OpenSSL - IOS应用程序崩溃

wa7juj8i  于 11个月前  发布在  iOS
关注(0)|答案(1)|浏览(103)

问题:

iOS App打开后立即崩溃。

这是崩溃日志中的错误:

Termination Reason: DYLD 1 Library missing
Library not loaded: @rpath/OpenSSL.framework/OpenSSL
Referenced from: /Users/USER/Library/Developer/CoreSimulator/Devices/8300BCCD-E28D-4452-AD15-90C82C862880/data/Containers/Bundle/Application/3C33DD5C-7A01-4159-897C-0784DB001AA4/MyDay.app/MyDay
Reason: tried: '/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 15.5.simruntime/Contents/Resources/RuntimeRoot/usr/lib/swift/OpenSSL.framework/OpenSSL' (no such file), '/usr/lib/swift/OpenSSL.framework/OpenSSL' (no such file), '/Users/yit/Library/Developer/CoreSimulator/Devices/8300BCCD-E28D-4452-AD15-90C82C862880/data/Containers/Bundle/Application/3C33DD5C-7A01-4159-897C-0784DB001AA4/MyDay.app/Frameworks/OpenSSL.framework/OpenSSL' (no such file), '/Users/yit/Library/Developer/CoreSimulator/Devices/8300BCCD-E28D-4452-AD15-90C82C862880/data/Containers/Bundle/Application/3C33DD5C-7A01-4159-897C-0784DB001AA4/MyDay.app/Frameworks/OpenSSL.framework/OpenSSL' (no such file), '/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 15.5.simruntime/Contents/Resource
(terminated at launch; ignore backtrace)

字符串
React Native版本:0.64
Mac m1,版本14.1(也发生在13)
Xcode版本15.0.1(也发生在14.3.1)

可能有用的信息:

  • 它只会在点击应用程序图标手动打开后崩溃。当通过xcode上的播放按钮启动应用程序时,它会工作。
  • 通过试飞安装时不会发生
    **我尝试了:**删除node_modules和yarn.lock并重新安装。

正在删除pod和pod.锁定并重新安装
重启一切
升级mac和xcode
返回未触及的分支(主)
将二进制文件与库链接

package.json:

{
    "name": "MyDay",
    "version": "0.0.1",
    "private": true,
    "scripts": {
        "android": "adb reverse tcp:8081 tcp:8081 && yarn start",
        "ios": "react-native run-ios",
        "start": "react-native start",
        "test": "jest",
        "lint": "eslint .",
        "postinstall": "npx react-native-fix-image",
        "clean": "react-native-clean-project",
        "watchman-clen": "watchman watch-del-all ",
        "bundle-aab": "cd android && ./gradlew bundleRelease"
    },
    "dependencies": {
        "@react-native-community/async-storage": "^1.9.0",
        "@react-native-community/checkbox": "^0.4.2",
        "@react-native-community/cli": "^5.0.1-alpha.2",
        "@react-native-community/geolocation": "^2.0.2",
        "@react-native-community/masked-view": "^0.1.9",
        "@react-native-community/netinfo": "^5.9.9",
        "@react-native-community/push-notification-ios": "^1.9.0",
        "@react-native-community/toolbar-android": "^0.2.1",
        "@react-native-firebase/app": "^16.4.6",
        "@react-native-firebase/messaging": "^16.4.6",
        "@react-navigation/bottom-tabs": "^6.0.0",
        "@react-navigation/material-bottom-tabs": "^5.3.17",
        "@react-navigation/material-top-tabs": "^5.1.9",
        "@react-navigation/native": "^6.0.1",
        "@react-navigation/stack": "^5.2.11",
        "axios": "^0.19.2",
        "fbjs": "^3.0.4",
        "formik": "^2.1.4",
        "i18next": "^19.6.0",
        "lodash": "^4.17.20",
        "moment": "^2.24.0",
        "moment-timezone": "^0.5.31",
        "patch-package": "^6.2.2",
        "postinstall-postinstall": "^2.1.0",
        "querystring": "^0.2.0",
        "react": "17.0.1",
        "react-i18next": "^11.7.0",
        "react-native": "0.64.4",
        "react-native-android-location-enabler": "^1.2.2",
        "react-native-autolink": "^4.1.0",
        "react-native-background-fetch": "4.0.3",
        "react-native-background-geolocation": "^4.9.4",
        "react-native-blob-util": "^0.14.1",
        "react-native-calendar-picker": "^6.0.6",
        "react-native-confirmation-code-field": "^7.1.0",
        "react-native-device-info": "^5.5.6",
        "react-native-flipper": "^0.96.1",
        "react-native-gesture-handler": "^2.8.0",
        "react-native-hyperlink": "^0.0.19",
        "react-native-keep-awake": "^4.0.0",
        "react-native-linear-gradient": "^2.5.6",
        "react-native-loading-spinner-overlay": "^1.1.0",
        "react-native-localize": "^1.4.1",
        "react-native-map-link": "^2.7.15",
        "react-native-material-dropdown": "https://github.com/noway/react-native-material-dropdown",
        "react-native-modal": "^11.5.6",
        "react-native-orientation-locker": "^1.4.0",
        "react-native-otp-verify": "^1.0.4",
        "react-native-paper": "^3.12.0",
        "react-native-pdf": "^6.4.0",
        "react-native-push-notification": "8.1.1",
        "react-native-rate": "^1.2.1",
        "react-native-reanimated": "^2.2.0",
        "react-native-restart": "^0.0.15",
        "react-native-safe-area-context": "^3.2.0",
        "react-native-screens": "^3.4.0",
        "react-native-sound": "^0.11.0",
        "react-native-splash-screen": "^3.2.0",
        "react-native-svg": "^12.1.0",
        "react-native-switch": "^2.0.0",
        "react-native-tab-view": "^2.14.0",
        "react-native-vector-icons": "^6.7.0",
        "react-redux": "^7.2.0",
        "redux": "^4.0.5",
        "redux-devtools-extension": "^2.13.8",
        "redux-flipper": "^1.4.2",
        "redux-saga": "^1.1.3",
        "rn-material-ui-textfield": "^1.0.2",
        "styled-components": "^5.1.0",
        "yup": "^0.28.4"
    },
    "devDependencies": {
        "@babel/core": "^7.9.0",
        "@babel/runtime": "^7.9.2",
        "@react-native-community/eslint-config": "^1.1.0",
        "babel-jest": "^25.4.0",
        "eslint": "^6.8.0",
        "jest": "^25.4.0",
        "metro-react-native-babel-preset": "^0.59.0",
        "react-native-clean-project": "^3.6.3",
        "react-native-svg-transformer": "^0.14.3",
        "react-test-renderer": "16.11.0"
    },
    "jest": {
        "preset": "react-native"
    }
}

Podfile:

require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/react-native-permissions/scripts/setup'

platform :ios, '12.0'


target 'MyDay' do
  config = use_native_modules!
  use_react_native!(:path => config["reactNativePath"])
  
  pod 'Firebase', :modular_headers => true
  pod 'FirebaseCoreInternal', :modular_headers => true
  pod 'GoogleUtilities', :modular_headers => true
  pod 'FirebaseCore', :modular_headers => true
  
  target 'MyDayTests' do
    inherit! :complete
    # Pods for testing
  end

  # Enables Flipper.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work and
  # you should disable these next few lines.
  use_flipper!
  post_install do |installer|
    installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|
        config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = "arm64"
      end
    end
  end
end

target 'MyDay-tvOS' do
  # Pods for MyDay-tvOS

  target 'MyDay-tvOSTests' do
    inherit! :search_paths
    # Pods for testing
  end
end

def fix_library_search_paths(installer)
  def fix_config(config)
    lib_search_paths = config.build_settings["LIBRARY_SEARCH_PATHS"]
    if lib_search_paths
      if lib_search_paths.include?("$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)") || lib_search_paths.include?("\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"")
        # $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME) causes problem with Xcode 12.5 + arm64 (Apple M1)
        # since the libraries there are only built for x86_64 and i386.
        lib_search_paths.delete("$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)")
        lib_search_paths.delete("\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"")
        if !(lib_search_paths.include?("$(SDKROOT)/usr/lib/swift") || lib_search_paths.include?("\"$(SDKROOT)/usr/lib/swift\""))
          # however, $(SDKROOT)/usr/lib/swift is required, at least if user is not running CocoaPods 1.11
          lib_search_paths.insert(0, "$(SDKROOT)/usr/lib/swift")
        end
      end
    end
  end

  projects = installer.aggregate_targets
    .map{ |t| t.user_project }
    .uniq{ |p| p.path }
    .push(installer.pods_project)

  projects.each do |project|
    project.build_configurations.each do |config|
      fix_config(config)
    end
    project.native_targets.each do |target|
      target.build_configurations.each do |config|
        fix_config(config)
      end
    end
    project.save()
  end
end 

# ⬇️ uncomment wanted permissions
setup_permissions([
  'LocationAccuracy',
  'LocationAlways',
  'LocationWhenInUse',
])

相关问题