Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flutter Upgrade - iOS No Longer Compiles #57222

Closed
danielgchap opened this issue May 14, 2020 · 20 comments
Closed

Flutter Upgrade - iOS No Longer Compiles #57222

danielgchap opened this issue May 14, 2020 · 20 comments
Labels
in triage Presently being triaged by the triage team

Comments

@danielgchap
Copy link

I performed a 'Flutter Upgrade' and since then, the iOS side won't compile. Not in Visual Studio or in XCode directlly.

Screen Shot 2020-05-14 at 12 40 02 PM

I have attached a screenshot.

I have tried the stable and master channels on Flutter. I'll try dev too.

@warriorCoder
Copy link

warriorCoder commented May 14, 2020

code's output:

    In file included from /.pub-cache/hosted/pub.dartlang.org/url_launcher-5.4.7/ios/Classes/FLTURLLauncherPlugin.m:7:
    /.pub-cache/hosted/pub.dartlang.org/url_launcher-5.4.7/ios/Classes/FLTURLLauncherPlugin.h:7:45: error: no type or protocol
    named 'FlutterPlugin'
    @interface FLTURLLauncherPlugin : NSObject <FlutterPlugin>
                                                ^
    /.pub-cache/hosted/pub.dartlang.org/url_launcher-5.4.7/ios/Classes/FLTURLLauncherPlugin.m:12:28: error: unknown type name
    'FlutterResult'
    @property(copy, nonatomic) FlutterResult flutterResult;
                               ^
    /.pub-cache/hosted/pub.dartlang.org/url_launcher-5.4.7/ios/Classes/FLTURLLauncherPlugin.m:12:1: error: property with 'copy'
    attribute must be of object type
    @property(copy, nonatomic) FlutterResult flutterResult;
    ^
    /.pub-cache/hosted/pub.dartlang.org/url_launcher-5.4.7/ios/Classes/FLTURLLauncherPlugin.m:25:24: warning: incompatible pointer
    to integer conversion assigning to 'int' from '__strong id' [-Wint-conversion]
        self.flutterResult = result;
                           ^ ~~~~~~
    /.pub-cache/hosted/pub.dartlang.org/url_launcher-5.4.7/ios/Classes/FLTURLLauncherPlugin.m:37:23: error: called object type
    'int' is not a function or function pointer
        self.flutterResult(nil);
        ~~~~~~~~~~~~~~~~~~^
    /.pub-cache/hosted/pub.dartlang.org/url_launcher-5.4.7/ios/Classes/FLTURLLauncherPlugin.m:39:25: error: use of undeclared
    identifier 'FlutterError'
        self.flutterResult([FlutterError
                            ^
    /.pub-cache/hosted/pub.dartlang.org/url_launcher-5.4.7/ios/Classes/FLTURLLauncherPlugin.m:66:41: error: no type or protocol
    named 'FlutterPluginRegistrar'
    + (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar> *)registrar {
                                            ^
    /.pub-cache/hosted/pub.dartlang.org/url_launcher-5.4.7/ios/Classes/FLTURLLauncherPlugin.m:74:27: error: expected a type
    - (void)handleMethodCall:(FlutterMethodCall *)call result:(FlutterResult)result {
                              ^
    /.pub-cache/hosted/pub.dartlang.org/url_launcher-5.4.7/ios/Classes/FLTURLLauncherPlugin.m:74:60: error: expected a type
    - (void)handleMethodCall:(FlutterMethodCall *)call result:(FlutterResult)result {
                                                               ^
    /.pub-cache/hosted/pub.dartlang.org/url_launcher-5.4.7/ios/Classes/FLTURLLauncherPlugin.m:110:20: error: expected a type
                 call:(FlutterMethodCall *)call
                       ^
    /.pub-cache/hosted/pub.dartlang.org/url_launcher-5.4.7/ios/Classes/FLTURLLauncherPlugin.m:111:20: error: expected a type
               result:(FlutterResult)result {
                       ^
    /.pub-cache/hosted/pub.dartlang.org/url_launcher-5.4.7/ios/Classes/FLTURLLauncherPlugin.m:132:53: error: expected a type
    - (void)launchURLInVC:(NSString *)urlString result:(FlutterResult)result API_AVAILABLE(ios(9.0)) {
                                                        ^
    /.pub-cache/hosted/pub.dartlang.org/url_launcher-5.4.7/ios/Classes/FLTURLLauncherPlugin.m:144:33: error: expected a type
    - (void)closeWebViewWithResult:(FlutterResult)result API_AVAILABLE(ios(9.0)) {
                                    ^
    /.pub-cache/hosted/pub.dartlang.org/url_launcher-5.4.7/ios/Classes/FLTURLLauncherPlugin.m:67:3: error: use of undeclared
    identifier 'FlutterMethodChannel'
      FlutterMethodChannel *channel =
      ^
    /.pub-cache/hosted/pub.dartlang.org/url_launcher-5.4.7/ios/Classes/FLTURLLauncherPlugin.m:67:25: error: use of undeclared
    identifier 'channel'
      FlutterMethodChannel *channel =
                            ^
    /.pub-cache/hosted/pub.dartlang.org/url_launcher-5.4.7/ios/Classes/FLTURLLauncherPlugin.m:68:8: error: use of undeclared
    identifier 'FlutterMethodChannel'
          [FlutterMethodChannel methodChannelWithName:@"plugins.flutter.io/url_launcher"
           ^
    /.pub-cache/hosted/pub.dartlang.org/url_launcher-5.4.7/ios/Classes/FLTURLLauncherPlugin.m:71:14: error: no visible @interface
    for 'NSObject' declares the selector 'addMethodCallDelegate:channel:'
      [registrar addMethodCallDelegate:plugin channel:channel];
       ~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /.pub-cache/hosted/pub.dartlang.org/url_launcher-5.4.7/ios/Classes/FLTURLLauncherPlugin.m:75:24: error: property 'arguments'
    not found on object of type '__strong id'
      NSString *url = call.arguments[@"url"];
                           ^
    /.pub-cache/hosted/pub.dartlang.org/url_launcher-5.4.7/ios/Classes/FLTURLLauncherPlugin.m:76:42: error: property 'method' not
    found on object of type '__strong id'
      if ([@"canLaunch" isEqualToString:call.method]) {
                                             ^
    /.pub-cache/hosted/pub.dartlang.org/url_launcher-5.4.7/ios/Classes/FLTURLLauncherPlugin.m:77:11: error: called object type
    'id' is not a function or function pointer
        result(@([self canLaunchURL:url]));
        ~~~~~~^
    fatal error: too many errors emitted, stopping now [-ferror-limit=]

@danielgchap
Copy link
Author

dev was just blown apart for me so I didn't even get that far.

@jaxnz
Copy link

jaxnz commented May 15, 2020

Yep, has happened to me as well for web on both master/beta

@knissophiliac
Copy link

I'm experiencing this issue also.

flutter doctor -v

[✓] Flutter (Channel beta, v1.15.17, on Mac OS X 10.15.4 19E266, locale tr-TR)
    • Flutter version 1.15.17 at /Users/bahadiraksoy/flutter
    • Framework revision 2294d75bfa (2 months ago), 2020-03-07 00:28:38 +0900
    • Engine revision 5aff311948
    • Dart version 2.8.0 (build 2.8.0-dev.12.0 9983424a3c)

 
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at /Users/bahadiraksoy/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-29, build-tools 28.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.4)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.4, Build version 11E146
    • CocoaPods version 1.9.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 3.6)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 45.1.1
    • Dart plugin version 192.7761
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)

[✓] VS Code (version 1.45.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.10.1

[✓] Connected device (3 available)
    • Bahadir iPhone’u • 9f5c161693a3aab3123c9987ec090448b359c63c • ios            • iOS 13.4
    • Chrome           • chrome                                   • web-javascript • Google Chrome 81.0.4044.138
    • Web Server       • web-server                               • web-javascript • Flutter Tools

@iapicca
Copy link
Contributor

iapicca commented May 15, 2020

Hi @danielgchap @warriorCoder
can you please provide your flutter doctor -v ,
your flutter run --verbose
and your pubspec.yaml
or if possible a reproducible minimal code sample.

@knissophiliac
could you please run flutter upgrade --force
if the issue persist please provide the information listed above
Thank you all

@iapicca iapicca added in triage Presently being triaged by the triage team waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds labels May 15, 2020
@knissophiliac
Copy link

knissophiliac commented May 15, 2020

I changed the channel to stable and upgraded, but the issue persist.
Additional info: I'm not completely sure, but this issue may have started appearing after an unsuccessful(due to no empty space on disk) flutter run --release for iOS.

flutter upgrade --force

Flutter is already up to date on channel stable
Flutter 1.17.1 • channel stable • https://github.com/flutter/flutter.git
Framework • revision f7a6a7906b (2 days ago) • 2020-05-12 18:39:00 -0700
Engine • revision 6bc433c6b6
Tools • Dart 2.8.2

flutter doctor -v

[✓] Flutter (Channel stable, v1.17.1, on Mac OS X 10.15.4 19E266, locale tr-TR)
    • Flutter version 1.17.1 at /Users/bahadiraksoy/flutter
    • Framework revision f7a6a7906b (2 days ago), 2020-05-12 18:39:00 -0700
    • Engine revision 6bc433c6b6
    • Dart version 2.8.2

 
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at /Users/bahadiraksoy/Library/Android/sdk
    • Platform android-29, build-tools 28.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.4)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.4, Build version 11E146
    • CocoaPods version 1.9.1

[✓] Android Studio (version 3.6)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 45.1.1
    • Dart plugin version 192.7761
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)

[✓] VS Code (version 1.45.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.10.1

[✓] Connected device (1 available)
    • Bahadir iPhone’u • 9f5c161693a3aab3123c9987ec090448b359c63c • ios • iOS 13.4

• No issues found!

pubspec.yaml

name: ********
description: A new Flutter application.

# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# Read more about versioning at semver.org.
version: 1.0.1+2

environment:
  sdk: ">=2.5.2 <3.0.0"

dependencies:
  flutter:
    sdk: flutter

  #Firebase
  cloud_firestore: ^0.13.4+2
  firebase_auth: ^0.15.5+3
  cloud_functions: ^0.4.2+3
  firestore_ui: ^1.7.2
  firebase_storage: ^3.1.5
  firebase_messaging: ^6.0.13
  firebase_crashlytics: ^0.1.3+3
  firebase_database: ^3.1.5

  #Visual
  image_picker: ^0.6.5+3
  flutter_facebook_login: ^2.0.0
  keyboard_actions: ^3.1.2
  flutter_splash_screen: ^0.1.0
  video_player: # ^0.10.5+1
    git:
      url: git://github.com/crazedvic/plugins.git
      path: packages/video_player/video_player
  pin_code_fields: ^2.3.0+3
  international_phone_input: ^1.0.2
  html: ^0.14.0+3
  map: ^0.1.0
  map_launcher: ^0.4.3
  flare_flutter: ^2.0.1
  flash: ^1.2.3
  flutter_statusbar_manager: 
    git: https://github.com/guitcastro/flutter_statusbar_manager.git
  carousel_slider: ^1.4.1
  image_cropper: ^1.2.1

  #Other Packages
  spotify: ^0.3.1+2
  url_launcher: ^5.4.5
  flutter_inappwebview: ^2.1.0+1
  uni_links: ^0.2.0
  intl: ^0.16.0
  http: null
  hive: ^1.4.1+1
  hive_flutter: ^0.3.0+2
  path_provider: ^1.4.0
  geolocator: ^5.2.1
  flutter_localizations:
    sdk: flutter
  devicelocale: ^0.2.2
  app_settings: ^3.0.1
  flutter_uxcam: ^1.1.1
  flutter_ringtone_player: ^2.0.0
  permission_handler: ^5.0.0+hotfix.5
  flutter_local_notifications: ^1.4.3

  #State management
  get_it: null
  provider_architecture: null
  provider: ^3.1.0

dev_dependencies:
  hive_generator: ^0.7.0+2
  build_runner: ^1.8.0
  flutter_launcher_icons: "^0.7.5"
  mockito: ^4.1.1
  flutter_test:
    sdk: flutter
dependency_overrides:
  dartx: ^0.3.0

flutter_icons:
  android: "launcher_icon"
  ios: true
  image_path: "assets/icon/icon.png"

# For information on the generic Dart part of this file, see the
# following page: https://www.dartlang.org/tools/pub/pubspec
# The following section is specific to Flutter.
flutter:

  # The following line ensures that the Material Icons font is
  # included with your application, so that you can use the icons in
  # the material Icons class.
  uses-material-design: true

  # To add assets to your application, add an assets section, like this:
  assets:
    - assets/flares/
    - assets/images/
    - assets/videos/
    - assets/icons/
    - assets/texts/
  fonts:
    - family: ********
      fonts:
        - asset: assets/fonts/********
        - asset: assets/fonts/********
          weight: 200
        - asset: assets/fonts/********
          weight: 800
  #   - family: *******
  #     fonts:
  #       - asset: fonts/******
  #       - asset: fonts/******
  #         weight: 700
  #
  # For details regarding fonts from package dependencies,
  # see https://flutter.io/custom-fonts/#from-packages
flutter_intl:
  enabled: true

@danielgchap
Copy link
Author

danielgchap commented May 15, 2020

Of course! Thank you so much.
Flutter-Verbose.docx

pubspec-yaml.docx
.
Flutter-Doctor.docx

@no-response no-response bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label May 15, 2020
@iapicca
Copy link
Contributor

iapicca commented May 15, 2020

Hi @knissophiliac
could you please provide your flutter run -verbose
(attached as txt if possible)
@danielgchap
could you please run flutter upgrade --force
also I don't see any error in your flutter run --verbose
Thank you

@iapicca iapicca added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label May 15, 2020
@danielgchap
Copy link
Author

danielgchap commented May 15, 2020

Sorry about that. It's attached here.
flutter-run-verbose-2.docx

@no-response no-response bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label May 15, 2020
@knissophiliac
Copy link

knissophiliac commented May 15, 2020

Sorry I forgot that. Here it is.
verbose.txt

@knissophiliac
Copy link

knissophiliac commented May 16, 2020

Update: I tried to create new project with updated version of Flutter(stable channel). Then, copied

  • some parts of pubspec.yaml
  • whole lib folder
  • whole android folder
  • some parts of ios/Runner/Info.plist

into new project.

Then, opened ios/Runner.xcworkspace and set the signing profile.

The problem is gone away.

@iapicca
Copy link
Contributor

iapicca commented May 18, 2020

Hi @danielgchap
considering @knissophiliac proposed procedure (thank you)
a workaround rather than a solution,
could be useful to know if this is effective in your case as well
Thank you

@iapicca iapicca added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label May 18, 2020
@warriorCoder
Copy link

@knissophiliac What parts of the pubspec, and plist files did you omit?

@iapicca I haven't been on a mac in a while so that is the reason I've not been able to give you the outputs you're looking for. My sincere apologies.

@TahaTesser
Copy link
Member

Hi @danielgchap
Your logs are ran without connected to device
Without additional information we are unfortunately not sure how to resolve this issue.
We are therefore reluctantly going to close this bug for now.
Please don't hesitate to comment on the bug if you have any more information for us; we will reopen it right away!
Thanks for your contribution.

@TahaTesser TahaTesser removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Jun 12, 2020
@warriorCoder
Copy link

warriorCoder commented Jun 15, 2020

@iapicca and @TahaTesser

I've been able to confirm this issue and a workaround.
Here are the steps I've taken to get the build working:

  1. Delete the ios folder
  2. Recreate it using flutter build -i swift
  3. Copy my original plist file(s)
  4. Fix the setting in Xcode for signing and target ios versions
  5. Run a build from the command line

If I then try and run another build from the command line, things fall apart and the build fails.

@warriorCoder
Copy link

New update... after creating the new iOS folder I can successfully create a new build from vscode IF xcode is closed.

@vaandhare
Copy link

vaandhare commented Aug 15, 2020

@iapicca and @TahaTesser

I've been able to confirm this issue and a workaround.
Here are the steps I've taken to get the build working:

  1. Delete the ios folder
  2. Recreate it using flutter build -i swift
  3. Copy my original plist file(s)
  4. Fix the setting in Xcode for signing and target ios versions
  5. Run a build from the command line

If I then try and run another build from the command line, things fall apart and the build fails.

flutter build -i swift not working, instead of it use create .

@eleomilagrosa
Copy link

eleomilagrosa commented Nov 17, 2020

I also encounter this problem and found this thread.
but I don't like a work around approach because I have native codes too.
too much work to do.

so I dig the files where might the problem.
then I found out that the ios/Flutter/Flutter.framework got corrupted the files were all empty or blank.

to fix it.

just copy existing ios/Flutter/Flutter.framework from other working Flutter projects you have.
then overwrite the corrupted ios/Flutter/Flutter.framework then build again

Reason:
Flutter.framework got corrupted.

EDIT:
that's why creating new project and transfer works, because it generates new Flutter.framework that will sure works.

How to identify if your Flutter.framework got corrupted?

  • open ios/Flutter/Flutter.framework/Headers/Flutter.h if this file is empty or blank.

@chanindev
Copy link

I also encounter this problem and found this thread.
but I don't like a work around approach because I have native codes too.
too much work to do.

so I dig the files where might the problem.
then I found out that the ios/Flutter/Flutter.framework got corrupted the files were all empty or blank.

to fix it.

just copy existing ios/Flutter/Flutter.framework from other working Flutter projects you have.
then overwrite the corrupted ios/Flutter/Flutter.framework then build again

Reason:
Flutter.framework got corrupted.

EDIT:
that's why creating new project and transfer works, because it generates new Flutter.framework that will sure works.

How to identify if your Flutter.framework got corrupted?

  • open ios/Flutter/Flutter.framework/Headers/Flutter.h if this file is empty or blank.

Thanks so much sir. it works for me.

@github-actions
Copy link

github-actions bot commented Aug 9, 2021

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
in triage Presently being triaged by the triage team
Projects
None yet
Development

No branches or pull requests

9 participants