dyld[16458]:未加载库:@rpath/libavcodec.framework/libavcodec,同时在iOS上运行我的flutter应用程序

8ehkhllq  于 2023-01-27  发布在  Flutter
关注(0)|答案(1)|浏览(491)
    • bounty将在6天后过期**。回答此问题可获得+50的声誉奖励。Stéphane de Luca正在寻找来自声誉良好来源的答案

编译成功了,但是当我运行代码时,我得到了这个.
以下是完整的跟踪。
你知道吗?

dyld[16458]: Library not loaded: @rpath/libavcodec.framework/libavcodec
  Referenced from: <3500F5CF-B1D2-30EC-8D7F-1C29BD45D05E> /private/var/containers/Bundle/Application/984D87E5-818C-49A9-9CB5-F0CC3160D2FF/Runner.app/Runner
  Reason: tried: '/usr/lib/swift/libavcodec.framework/libavcodec' (errno=2, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/libavcodec.framework/libavcodec' (errno=2), '/usr/lib/swift/libavcodec.framework/libavcodec' (errno=2, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/libavcodec.framework/libavcodec' (errno=2), '/private/var/containers/Bundle/Application/984D87E5-818C-49A9-9CB5-F0CC3160D2FF/Runner.app/Frameworks/libavcodec.framework/libavcodec' (errno=2), '/private/var/containers/Bundle/Application/984D87E5-818C-49A9-9CB5-F0CC3160D2FF/Runner.app/Frameworks/libavcodec.framework/libavcodec' (errno=2), '/private/var/containers/Bundle/Application/984D87E5-818C-49A9-9CB5-F0CC3160D2FF/Runner.app/Frameworks/libavcodec.framework/libavcodec' (errno=2), '/usr/lib/swift/libavcodec.framework/libavcodec' (errno=2, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/libavcodec.framework/libavcodec' (errno=2), '/usr/lib/swift/libavcodec.framework/libavcodec' (errno=2, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/libavcodec.framework/libavcodec' (errno=2), '/private/var/containers/Bundle/Application/984D87E5-818C-49A9-9CB5-F0CC3160D2FF/Runner.app/Frameworks/libavcodec.framework/libavcodec' (errno=2), '/private/var/containers/Bundle/Application/984D87E5-818C-49A9-9CB5-F0CC3160D2FF/Runner.app/Frameworks/libavcodec.framework/libavcodec' (errno=2), '/private/var/containers/Bundle/Application/984D87E5-818C-49A9-9CB5-F0CC3160D2FF/Runner.app/Frameworks/libavcodec.framework/libavcodec' (errno=2), '/private/preboot/Cryptexes/OS@rpath/libavcodec.framework/libavcodec' (errno=2), '/usr/lib/swift/libavcodec.framework/libavcodec' (errno=2, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/libavcodec.framework/libavcodec' (errno=2), '/usr/lib/swift/libavcodec.framework/libavcodec' (errno=2, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/libavcodec.framework/libavcodec' (errno=2), '/private/var/containers/Bundle/Application/984D87E5-818C-49A9-9CB5-F0CC3160D2FF/Runner.app/Frameworks/libavcodec.framework/libavcodec' (errno=2), '/private/var/containers/Bundle/Application/984D87E5-818C-49A9-9CB5-F0CC3160D2FF/Runner.app/Frameworks/libavcodec.framework/libavcodec' (errno=2), '/private/var/containers/Bundle/Application/984D87E5-818C-49A9-9CB5-F0CC3160D2FF/Runner.app/Frameworks/libavcodec.framework/libavcodec' (errno=2), '/usr/lib/swift/libavcodec.framework/libavcodec' (errno=2, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/libavcodec.framework/libavcodec' (errno=2), '/usr/lib/swift/libavcodec.framework/libavcodec' (errno=2, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/libavcodec.framework/libavcodec' (errno=2), '/private/var/containers/Bundle/Application/984D87E5-818C-49A9-9CB5-F0CC3160D2FF/Runner.app/Frameworks/libavcodec.framework/libavcodec' (errno=2), '/private/var/containers/Bundle/Application/984D87E5-818C-49A9-9CB5-F0CC3160D2FF/Runner.app/Frameworks/libavcodec.framework/libavcodec' (errno=2), '/private/var/containers/Bundle/Application/984D87E5-818C-49A9-9CB5-F0CC3160D2FF/Runner.app/Frameworks/libavcodec.framework/libavcodec' (errno=2), '/System/Library/Frameworks/libavcodec.framework/libavcodec' (errno=2, not in dyld cache)
Library not loaded: @rpath/libavcodec.framework/libavcodec
  Referenced from: <3500F5CF-B1D2-30EC-8D7F-1C29BD45D05E> /private/var/containers/Bundle/Application/984D87E5-818C-49A9-9CB5-F0CC3160D2FF/Runner.app/Runner
  Reason: tried: '/usr/lib/swift/libavcodec.framework/libavcodec' (errno=2, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/libavcodec.framework/libavcodec' (errno=2), '/usr/lib/swift/libavcodec.framework/libavcodec' (errno=2, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/libavcodec.framework/libavcodec' (errno=2), '/private/var/containers/Bundle/Application/984D87E5-818C-49A9-9CB5-F0CC3160D2FF/Runner.app/Frameworks/libavcodec.framework/libavcodec' (errno=2), '/private/var/containers/Bundle/Application/984D87E5-818C-49A9-9CB5-F0CC3160D2FF/Runner.app/Frameworks/libavcodec.framework/libavcodec' (errno=2), '/private/var/containers/Bundle/Application/984D87E5-818C-49A9-9CB5-F0CC3160D2FF/Runner.app/Frameworks/libavcodec.framework/libavcodec' (errno=2), '/usr/lib/swif
dyld config: DYLD_LIBRARY_PATH=/usr/lib/system/introspection DYLD_INSERT_LIBRARIES=/usr/lib/libBacktraceRecording.dylib:/usr/lib/libMainThreadChecker.dylib:/usr/lib/libRPAC.dylib:/Developer/Library/PrivateFrameworks/DTDDISupport.framework/libViewDebuggerSupport.dylib
(lldb)

吊舱如下所示:

# Uncomment this line to define a global platform for your project
platform :ios, '14.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

project 'Runner', {
  'Debug' => :debug,
  'Profile' => :release,
  'Release' => :release,
}

def flutter_root
  generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
  unless File.exist?(generated_xcode_build_settings_path)
    raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
  end

  File.foreach(generated_xcode_build_settings_path) do |line|
    matches = line.match(/FLUTTER_ROOT\=(.*)/)
    return matches[1].strip if matches
  end
  raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end

require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)

flutter_ios_podfile_setup

target 'Runner' do
  use_frameworks!
  use_modular_headers!

  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
  end
end

yaml:

environment:
  sdk: '>=2.18.2 <3.0.0'

# Dependencies specify other packages that your package needs in order to work.
# To automatically upgrade your package dependencies to the latest versions
# consider running `flutter pub upgrade --major-versions`. Alternatively,
# dependencies can be manually updated by changing the version numbers below to
# the latest version available on pub.dev. To see which dependencies have newer
# versions available, run `flutter pub outdated`.
dependencies:
  flutter:
    sdk: flutter
  flutter_localizations:
    sdk: flutter
  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: ^1.0.2
  video_editor: ^1.5.2
  image_picker: ^0.8.6
  helpers: ^1.2.0
  intl: ^0.17.0
  i18n_extension: ^5.0.1
  optimized_cached_image: ^3.0.1
  youtube_player_flutter: ^8.1.1
  flutter_launcher_icons: ^0.11.0
  flutter_lorem: ^2.0.0
  advance_image_picker: ^0.1.7+1
  wechat_assets_picker: ^8.1.4
  lecle_flutter_absolute_path: ^0.0.2+1
  #ffmpeg_kit_flutter: 5.1.0-LTS
  path_provider: ^2.0.11
  video_thumbnail: ^0.5.3
  flutter_document_picker: ^5.1.0
  flutter_login: ^4.1.1
  #flutter_absolute_path: ^1.0.6
  # flutter_absolute_path:
  #     git:
  #       url: https://github.com/ValeriusGC/flutter_absolute_path.git
  uuid: ^3.0.6
  flutter_form_builder: ^7.7.0
  form_builder_validators: ^8.4.0
  state_persistence: ^0.1.0
  shared_preferences: ^2.0.15
  firebase_core: ^2.4.0
  firebase_storage: ^11.0.8
  video_compress: ^3.1.2
  connectivity_plus: ^3.0.2
  internet_connection_checker: ^1.0.0+1
  cached_video_player: ^2.0.3
  visibility_detector: ^0.3.3
  firebase_database: ^10.0.7
  firebase_auth: ^4.2.1
  firebase_dynamic_links: ^5.0.9
  cloud_firestore: ^4.2.0
  cloud_functions: ^4.0.6
  cached_network_image: ^3.2.3
  ffmpeg_kit_flutter_min_gpl: ^5.1.0
  video_player: ^2.4.10
  provider: ^6.0.5
  camera: ^0.9.8+1
  share_plus: ^6.3.0
  package_info_plus: ^3.0.2

dependency_overrides:
  ffmpeg_kit_flutter_min_gpl: ^5.1.0-LTS

dev_dependencies:
  flutter_test:
    sdk: flutter

  # The "flutter_lints" package below contains a set of recommended lints to
  # encourage good coding practices. The lint set provided by the package is
  # activated in the `analysis_options.yaml` file located at the root of your
  # package. See that file for information about deactivating specific lint
  # rules and activating additional ones.
  flutter_lints: ^2.0.0

``
wwtsj6pe

wwtsj6pe1#

到目前为止,我有一个解决方案,包括从Xcode中添加两个缺失的动态库,如下所示:

相关问题