Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter app on Xcode won't launch after upgrade

Tags:

xcode

flutter

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
like image 949
enkara Avatar asked Sep 25 '20 11:09

enkara


People also ask

What version of Xcode does Flutter need?

Xcode 12.2 or later. Xcode is the main development tool for iOS and is needed to build your Flutter app for iOS. You can download the latest version of Xcode from Apple's developer site here: apple.co/2asi58y, or from the Mac App Store. Xcode 12.2 requires a Mac running macOS Catalina (10.15) or later.

Can Flutter be used with Xcode?

To deploy your Flutter app to a physical iPhone or iPad you'll need to set up physical device deployment in Xcode and an Apple Developer account. If your app is using Flutter plugins, you will also need the third-party CocoaPods dependency manager.

How do you release the Flutter app on TestFlight?

Release your app on TestFlightNavigate to the TestFlight tab of your app's application details page on App Store Connect. Select Internal Testing in the sidebar. Select the build to publish to testers, then click Save.


1 Answers

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.

like image 158
kuhnroyal Avatar answered Oct 07 '22 08:10

kuhnroyal