升级后Xcode上的Flutter应用将无法启动 [英] Flutter app on Xcode won't launch after upgrade

查看:127
本文介绍了升级后Xcode上的Flutter应用将无法启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用Flutter开发的应用程序,并且由于最新版本的Xcode绝对无法像以前一样工作. 我已经为这个问题苦苦挣扎了近一个星期,错误依小时而异.

I have an app made in Flutter and since the latest version of Xcode absolutely nothing works as before. I have been struggling with this problem for nearly a week now and the errors vary depending on the hour.

主要问题是,将应用程序分发给Apple进行审核时,他们拒绝并显示以下消息:

The main problem is that when distributing the application to Apple for review, they reject it with the following message:

2.1性能:应用程序完整性指南

2.1 Performance: App Completeness Guideline

2.1-性能-应用程序完整性

2.1 - Performance - App Completeness

在iPad上进行审核时,我们在您的应用中发现了一个或多个错误 在Wi-Fi上运行iOS 14.0.

We discovered one or more bugs in your app when reviewed on iPad running iOS 14.0 on Wi-Fi.

具体来说,我们仍然无法通过使用Apple登录进行登录

Specifically, we were still unable to login through Sign in with Apple


我觉得很奇怪,因为以前所有上传的内容都经过了验证,没有任何问题. 因此,为纠正此问题,我尝试通过模拟器运行该应用程序,因为我没有iPad. 问题就从这里开始.


I find this strange as all my previous uploads got verified without any problems. So to rectify this issue I'm trying to run the app through the simulator as I don't own an iPad. And here is where the problems start.

侧面说明:在物理iPhone上运行不会出现问题,我正在打开项目runner.xcworkspace,而不是runner.xccodeproj.

Side note: Running on a physical iPhone works without problems and I'm opening the project runner.xcworkspace, not the runner.xccodeproj.

主要问题是,从第一个库开始,Xcode找不到任何库:

The main problem is that Xcode won't find any libraries, starting with the first one:

GeneratedPluginRegistrant.m:10:9:找不到模块"apple_sign_in"

GeneratedPluginRegistrant.m:10:9: Module 'apple_sign_in' not found

我尝试了与此问题相关的所有解决方案,但无济于事.

I have tried every solution related to this issue but to no avail.

  • Remove the pod files, pod install,
  • pod deintegrate, pod init, pod install
  • flutter build ios --release, flutter run
  • Ive tried removing my project and cloning it for a fresh start
  • Sometimes not even a boilerplate app will work
  • I have checked github posts like https://github.com/flutter/flutter/issues/53573 and https://github.com/flutter/flutter/issues/33423 with no luck.
  • ...checked countless threads.

下面的Flutter Doctor和Pod文件:

Flutter doctor and pod-file below:

[✓] Flutter(频道稳定,版本为1.20.4,在Mac OS X 10.15.6 19G2021上, 语言环境en-ES) •Flutter 1.20.4版位于/Users/peter/flutter •框架修订版fba99f6cf9(11天前),2020-09-14 15:32:52 -0700 •发动机版本d1bc06f032 •Dart版本2.9.2

[✓] Flutter (Channel stable, 1.20.4, on Mac OS X 10.15.6 19G2021, locale en-ES) • Flutter version 1.20.4 at /Users/peter/flutter • Framework revision fba99f6cf9 (11 days ago), 2020-09-14 15:32:52 -0700 • Engine revision d1bc06f032 • Dart version 2.9.2

[✓] Android工具链-为Android设备开发(Android SDK 版本30.0.1) •位于/Users/peter/Library/Android/sdk的Android SDK •平台android-30,构建工具30.0.1 •Java二进制文件位于: /图书馆/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home/bin/java •Java版本的Java(TM)SE运行时环境(内部版本1.8.0_51-b16) •接受所有Android许可.

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.1) • Android SDK at /Users/peter/Library/Android/sdk • Platform android-30, build-tools 30.0.1 • Java binary at: /Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home/bin/java • Java version Java(TM) SE Runtime Environment (build 1.8.0_51-b16) • All Android licenses accepted.

[✓] Xcode-为iOS和macOS开发(Xcode 12.0) •Xcode位于/Applications/Xcode.app/Contents/Developer •Xcode 12.0,内部版本12A7209 •CocoaPods版本1.9.3

[✓] Xcode - develop for iOS and macOS (Xcode 12.0) • Xcode at /Applications/Xcode.app/Contents/Developer • Xcode 12.0, Build version 12A7209 • CocoaPods version 1.9.3

[!] Android Studio(未安装) •找不到Android Studio;从下载 https://developer.android.com/studio/index.html (或访问 https://flutter.dev/docs/get-started /install/macos#android-setup 有关详细说明).

[!] Android Studio (not installed) • Android Studio not found; download from https://developer.android.com/studio/index.html (or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).

[!] IntelliJ IDEA社区版(2017.2.5版) •/Applications/IntelliJ IDEA CE.app中的IntelliJ tter未安装Flutter插件;这增加了Flutter的特定功能. art未安装Dart插件;这增加了Dart特定的功能. •有关安装插件的信息,请参见 https://flutter.dev/intellij-setup/#installing-the-plugins

[!] IntelliJ IDEA Community Edition (version 2017.2.5) • IntelliJ at /Applications/IntelliJ IDEA CE.app ✗ Flutter plugin not installed; this adds Flutter specific functionality. ✗ Dart plugin not installed; this adds Dart specific functionality. • For information about installing plugins, see https://flutter.dev/intellij-setup/#installing-the-plugins

[✓]已连接的设备(1个可用) •iPhone 11(移动设备)•F1B8AE15-9028-4E0D-BD9D-2F2C7CC93ECE•ios• com.apple.CoreSimulator.SimRuntime.iOS-14-0(模拟器)

[✓] Connected device (1 available) • iPhone 11 (mobile) • F1B8AE15-9028-4E0D-BD9D-2F2C7CC93ECE • ios • com.apple.CoreSimulator.SimRuntime.iOS-14-0 (simulator)

!医生发现了2个类别的问题.

! Doctor found issues in 2 categories.

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 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|
    target.build_configurations.each do |config|
      config.build_settings['ENABLE_BITCODE'] = 'YES'
      config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'
    end
  end
end

推荐答案

Flutter 1.20.4和XCode12/iOS14存在问题.
您需要将Flutter更新到当前的Beta(1.22.0-12.3.pre),其中包含许多针对新的iOS/XCode版本的修复程序.

There are problems with Flutter 1.20.4 and XCode12/iOS14.
You need to update Flutter to the current beta (1.22.0-12.3.pre) which contains a lot of fixes for the new iOS/XCode versions.

请参见 https://flutter.dev/docs/development/ios-14

编辑10/01/2020: Flutter 1.22.0已发布稳定,可以立即使用XCode 12和iOS 14.

Edit 10/01/2020: Flutter 1.22.0 has been released to stable and should work with XCode 12 and iOS 14 out of the box.

这篇关于升级后Xcode上的Flutter应用将无法启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆