Flutter app on Xcode won't launch after upgrade

旧城冷巷雨未停 提交于 2021-01-22 09:01:46

问题


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.

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


2.1 Performance: App Completeness Guideline

2.1 - Performance - App Completeness

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

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


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.

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

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

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 and pod-file below:

[✓] 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 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 - 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 (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 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

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

! 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

回答1:


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.

See https://flutter.dev/docs/development/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.




回答2:


Try to allow the module in xcode to see if it finds apple_sign_in

Open Xcode select Runner > Signing % Capabilities > +Capabilities > Select Apple_Sign_In

Xcode screenshot




回答3:


It might be a problem with the iOS Simulator.

Check out this forum.

You might want to reply to them pointing out this issue from the forum, seems to have worked for others.



来源:https://stackoverflow.com/questions/64063385/flutter-app-on-xcode-wont-launch-after-upgrade

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!