Xcode 11.2,Catalina和Flutter v1.9.1 + hotfix.6

升级后,我以前使用Vcode的Flutter项目无法再构建,并且出现如下大量错误。我尝试过:

  1. 删除podfile.lock
  2. pod缓存清理--all
  3. rm -rf〜/ library / Caches / Cocoapods
  4. rm -rf〜/ library / Developer / Xcode / DerivedData / *
  5. rm -rf豆荚
  6. pod解体
  7. pod设置
  8. pod安装

颤振医生-v

[✓] Flutter(频道稳定,v1.9.1 + hotfix.6,在Mac OS X 10.15.1 19B88上,语言环境为en-SG) •Flutter版本1.9.1 + hotfix.6位于/ Users / peterlum / dev / flutter •Framework修订版68587a0916(7周前),2019-09-13 19:46:58 -0700 •引擎修订版b863200c37 •Dart 2.5.0版

[✓] Android工具链-为Android设备开发(Android SDK版本28.0.3)     •位于/ Applications / AndroidDev / sdk的Android SDK     •未配置Android NDK位置(可选;对本机性能分析支持很有用)     •平台android-28,构建工具28.0.3     •ANDROID_HOME = / Applications / AndroidDev / sdk     •ANDROID_SDK_ROOT = / Applications / AndroidDev / sdk     •Java二进制文件,位于:/ Applications / Android Studio 3.3.app/Contents/jre/jdk/Contents/Home/bin/java     •Java版本OpenJDK运行时环境(内部版本1.8.0_152-release-1248-b01)     •接受所有Android许可。

[✓] Xcode-为iOS和macOS开发(Xcode 11.2)     •Xcode位于/Applications/Xcode.app/Contents/Developer     •Xcode 11.2,内部版本11B52     •Cocoapods版本1.8.4

[✓] Android Studio(3.3版)     •位于/ Applications / Android Studio 3.3.app/Contents的Android Studio     •Flutter插件版本34.0.1     •Dart插件版本182.5215     •Java版本OpenJDK运行时环境(内部版本1.8.0_152-release-1248-b01)

[!] Android Studio(2.3版)     •位于/ Applications / Android Studio.app/Contents的Android Studio     tter Flutter插件版本12.1-建议的最低版本是16.0.0     •Dart插件版本162.2924     •Java版本OpenJDK运行时环境(内部版本1.8.0_112-release-b06)

[✓] VS代码(1.39.2版)     •/ Applications / Visual Studio Code.app/Contents中的VS代码     •Flutter扩展版本3.6.0

[✓]已连接设备(2个可用)     •LG D855•LGD855a710c089•安卓手臂•安卓5.0(API 21)     •iPhone 6 Plus•615DAB60-6ACB-4E37-9FAD-8CF869415B60•ios•com.apple.CoreSimulator.SimRuntime.iOS-12-4(模拟器)

我的podfile:

# 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 parse_KV_file(file,separator='=')
  file_abs_path = File.expand_path(file)
  if !File.exists? file_abs_path
    return [];
  end
  pods_ary = []
  skip_line_start_symbols = ["#","/"]
  File.foreach(file_abs_path) { |line|
      next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }
      plugin = line.split(pattern=separator)
      if plugin.length == 2
        podname = plugin[0].strip()
        path = plugin[1].strip()
        podpath = File.expand_path("#{path}",file_abs_path)
        pods_ary.push({:name => podname,:path => podpath});
      else
        puts "Invalid plugin specification: #{line}"
      end
  }
  return pods_ary
end

target 'Runner' do
  use_frameworks!

  # Prepare symlinks folder. We use symlinks to avoid having podfile.lock
  # referring to absolute paths on developers' machines.
  system('rm -rf .symlinks')
  system('mkdir -p .symlinks/plugins')

  # Flutter pods
  generated_xcode_build_settings = parse_KV_file('./Flutter/Generated.xcconfig')
  if generated_xcode_build_settings.empty?
    puts "Generated.xcconfig must exist. If you're running pod install manually,make sure flutter pub get is executed first."
  end
  generated_xcode_build_settings.map { |p|
    if p[:name] == 'FLUTTER_FRAMEWORK_DIR'
      symlink = File.join('.symlinks','flutter')
      File.symlink(File.dirname(p[:path]),symlink)
      pod 'Flutter',:path => File.join(symlink,File.basename(p[:path]))
    end
  }

  # Plugin pods
  plugin_pods = parse_KV_file('../.flutter-plugins')
  plugin_pods.map { |p|
    symlink = File.join('.symlinks','plugins',p[:name])
    File.symlink(p[:path],symlink)
    pod p[:name],'ios')
  }
end

# Prevent Cocoapods from embedding a second Flutter framework and causing an error with the new Xcode build system.
install! 'cocoapods',:disable_input_output_paths => true

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['ENABLE_BITCODE'] = 'NO'
    end
  end
end

我的pubspec.yaml

name: project
description: A new Flutter project.
version: 0.9.0+1

environment:
  sdk: ">=2.1.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter
  flutter_localizations:
    sdk: flutter
  firebase_auth: "0.14.0+5" 
  google_sign_in: "4.0.7" 

  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: "0.1.2"
  intl: "^0.15.8" # 0.15.7

  # Peter add
  firebase_core: "0.4.0+9" 
  cloud_firestore: "0.12.9+5" 
  firebase_storage: "3.0.6" 
  firebase_admob: "0.9.0+7"
  firebase_analytics: "5.0.2" 
  image_picker: "0.6.0+8"
  path_provider: "0.4.1"
  date_format: "1.0.5"
  numberpicker: "0.1.7"
  qr_mobile_vision: "0.2.2"
  firebase_ml_vision: "0.8.0" 
  qr_flutter: "2.0.0+51" 
  flutter_native_image:
    git: "https://github.com/btastic/flutter_native_image.git"

  connectivity: "0.4.2"
  firebase_messaging: "5.1.6" 
  package_info: "0.3.2+1" 
  share: "0.5.3"
  url_launcher: "4.1.0+1" 
  flutter_walkthrough: ^0.0.1
  country_pickers: "1.0.1"
  shared_preferences: "0.4.3"
  flutter_facebook_login: "2.0.1"
  charts_flutter: "0.5.0"
  device_info: "0.3.0" 
  http: "^0.11.3+16"

  permission_handler: "3.0.0" 
  flutter_local_notifications: "0.6.0" 
  contacts_service: "^0.0.9"
  flutter_dialogflow: "0.1.2"
  #flutter_lottie: "0.2.0"

dev_dependencies:
  build_runner: ^1.0.0
  flutter_test:
    sdk: flutter

错误示例: 无法构建iOS应用 Xcode构建错误输出: ↳     **建立失败** Xcode的输出: ↳     ios / pods / Bolts / Bolts / iOS / BFAppLinkReturnToRefererController.m:133:17:警告:块隐式保留了“ self”;明确提及“自我”以表明这是预期的行为[-Wimplicit-retain-self]                     _view.frame = CGRectMake(0.0,0.0,CGRectGetWidth(_view.bounds),0.0);                     ^                     自我->     /Volumes/ios/pods/Bolts/Bolts/iOS/BFAppLinkReturnToRefererController.m:133:67:警告:块隐式保留了“ self”;明确提及“自我”以表明这是预期的行为[-Wimplicit-retain-self]                     _view.frame = CGRectMake(0.0,0.0,CGRectGetWidth(_view.bounds),0.0);

生成8条警告。     /Users/flutter/.pub-cache/hosted/pub.dartlang.org/contacts_service-0.0.9/ios/Classes/ContactsServicePlugin.m:6:4:警告:“ SwiftContactsServicePlugin”仅在iOS 9.0或更高版本上可用[ -保障可用性]       [SwiftContactsServicePlugin registerWithRegistrar:registrar];

重复符号“ _GMVDetectorTypeProduct”:         /卷/ ios / pods / FirebaseMLVision /框架/FirebaseMLVision.framework/FirebaseMLVision(GMVDetector_c7138b42e3a094afed235ab051b2ff6c.o)         /Volumes/ios/pods/GoogleMobileVision/Detector/Frameworks/GoogleMobileVision.framework/GoogleMobileVision(GMVDetector_d8eaeedb32b9d25ce52bdf3b39f2008d.o)

ld:用于体系结构x86_64的106个重复符号     clang:错误:链接器命令失败,退出代码为1(使用-v查看调用)

对此进行了1周的尝试,没有解决。帮助非常感谢!

gordon000 回答:Xcode 11.2,Catalina和Flutter v1.9.1 + hotfix.6

您是否尝试过更新ios文件夹上的pod?

pod update

然后再次运行您的项目。

,

您可以尝试在应用程序的根文件夹中调用flutter clean

,

您的项目已损坏。我通过创建新的Flutter项目,然后在其中复制源代码,.yaml文件,lib文件夹和assets来解决该问题,然后重新构建项目。

本文链接:https://www.f2er.com/3162086.html

大家都在问