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

问题描述

这是我得到的错误日志。当我尝试使用 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)

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...