无法使用 m1 处理器在 mac 上运行 flutter ios build in xcode

时间:2021-06-27 15:52:16

标签: xcode flutter flutter-ios-build flutter-macos-2.0.0-stable

这是我得到的错误日志。当我尝试使用 xcode 运行我的 ios 构建时会出现此问题,但它不会导致 android studio 出现问题。

ld: warning: ignoring file /Users/vipulhome/Library/Developer/Xcode/DerivedData/Runner-dazmieaxtygkyugrsywdqvmtzcsr/Build/Products/Debug-iphonesimulator/FMDB/FMDB.framework/FMDB, building for iOS Simulator-x86_64 but attempting to link with file built for iOS Simulator-arm64
Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_FMDatabaseQueue", referenced from:
      objc-class-ref in SqflitePlugin.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

以下是我的 podfile。我运行了 pod install 并运行了它,但是当我尝试在 xcode 上运行它时,它没有运行。

 # Uncomment this line to define a global platform for your project
# platform :ios, '9.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

这里是颤振版本

    [✓] Flutter (Channel stable, 2.2.2, on macOS 11.4 20F71 darwin-arm, locale en-IN)
    [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.1)
    [✓] Xcode - develop for iOS and macOS
    [✓] Chrome - develop for the web
    [✓] Android Studio (version 4.1)
    [✓] Connected device (2 available)

0 个答案:

没有答案