8000 iOS App Build Failed After Upgrading from Flutter 1.22 to Flutter 2.0 · Issue #77189 · flutter/flutter · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

iOS App Build Failed After Upgrading from Flutter 1.22 to Flutter 2.0 #77189

8000
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

Closed
theniceboy opened this issue Mar 4, 2021 · 5 comments
Closed

Comments

@theniceboy
Copy link
Contributor
theniceboy commented Mar 4, 2021

I have a relatively large project and I don't think I can come up with a reproducible code example, but what happened was that project build went fine with Flutter 1.22.6. When I upgraded to Flutter 2.0.0 and tried to build my app it failed. I was hoping that someone would spot some useful information from the error logs. Thanks!

Steps to Reproduce

  1. Upgraded Flutter to 2.0.0
  2. flutter run

Logs

Logs
Launching lib/main.dart on iPhone 11 Pro in debug mode...
Running Xcode build...
Xcode build done.                                           35.9s
Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **


Xcode's output:
↳
    ../../.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.19.1/lib/src/picture_provider.dart:52:59: Error: No named
    parameter with the name 'nullOk'.
            context != null ? Localizations.localeOf(context, nullOk: true) : null,
                                                              ^^^^^^
    ../../prog/flutter/packages/flutter/lib/src/widgets/localizations.dart:413:17: Context: Found this candidate, but
    the arguments don't match.
      static Locale localeOf(BuildContext context) {
                    ^^^^^^^^
    ../../.pub-cache/hosted/pub.dartlang.org/pull_to_refresh-1.6.3/lib/src/smart_refresher.dart:273:21: Error: The
    method 'ancestorWidgetOfExactType' isn't defined for the class 'BuildContext'.
     - 'BuildContext' is from 'package:flutter/src/widgets/framework.dart'
     ('../../prog/flutter/packages/flutter/lib/src/widgets/framework.dart').
    Try correcting the name to the name of an existing method, or defining a method named 'ancestorWidgetOfExactType'.
        return context?.ancestorWidgetOfExactType(SmartRefresher);
                        ^^^^^^^^^^^^^^^^^^^^^^^^^
    ../../.pub-cache/hosted/pub.dartlang.org/pull_to_refresh-1.6.3/lib/src/smart_refresher.dart:277:21: Error: The
    method 'ancestorStateOfType' isn't defined for the class 'BuildContext'.
     - 'BuildContext' is from 'package:flutter/src/widgets/framework.dart'
     ('../../prog/flutter/packages/flutter/lib/src/widgets/framework.dart').
    Try correcting the name to the name of an existing method, or defining a method named 'ancestorStateOfType'.
        return context?.ancestorStateOfType(TypeMatcher<SmartRefresherState>());
                        ^^^^^^^^^^^^^^^^^^^
    ../../.pub-cache/hosted/pub.dartlang.org/pull_to_refresh-1.6.3/lib/src/smart_refresher.dart:1003:20: Error: The
    method 'inheritFromWidgetOfExactType' isn't defined for the class 'BuildContext'.
     - 'BuildContext' is from 'package:flutter/src/widgets/framework.dart'
     ('../../prog/flutter/packages/flutter/lib/src/widgets/framework.dart').
    Try correcting the name to the name of an existing method, or defining a method named
    'inheritFromWidgetOfExactType'.
        return context.inheritFromWidgetOfExactType(RefreshConfiguration);
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ../../.pub-cache/git/flutter-cupertino-date-picker-c46b063207b929872c42b59a21025ba22099049e/lib/src/date_picker.dart
    :103:34: Error: No named parameter with the name 'shadowThemeOnly'.
            theme: Theme.of(context, shadowThemeOnly: true),
                                     ^^^^^^^^^^^^^^^
    ../../prog/flutter/packages/flutter/lib/src/material/theme.dart:107:20: Context: Found this candidate, but the
    arguments don't match.
      static ThemeData of(BuildContext context) {
                       ^^
    ../../.pub-cache/hosted/pub.dartlang.org/modal_bottom_sheet-1.0.1-dev/lib/src/bottom_sheets/cupertino_bottom_sheet.d
    art:344:46: Error: No named parameter with the name 'shadowThemeOnly'.
        final isCupertinoApp = Theme.of(context, shadowThemeOnly: true) == null;
                                                 ^^^^^^^^^^^^^^^
    ../../prog/flutter/packages/flutter/lib/src/material/theme.dart:107:20: Context: Found this candidate, but the
    arguments don't match.
      static ThemeData of(BuildContext context) {
                       ^^
    ../../.pub-cache/hosted/pub.dartlang.org/modal_bottom_sheet-1.0.1-dev/lib/src/bottom_sheets/material_bottom_sheet.da
    rt:42:32: Error: No named parameter with the name 'shadowThemeOnly'.
          theme: Theme.of(context, shadowThemeOnly: true),
                                   ^^^^^^^^^^^^^^^
    ../../prog/flutter/packages/flutter/lib/src/material/theme.dart:107:20: Context: Found this candidate, but the
    arguments don't match.
      static ThemeData of(BuildContext context) {
                       ^^

    Command PhaseScriptExecution failed with a nonzero exit code
    /Users/david/Github/dugl/ios/Runner/AppDelegate.swift:11:5: warning: setter for 'isStatusBarHidden' was deprecated
    in iOS 9.0: Use -[UIViewController prefersStatusBarHidden]
        UIApplication.shared.isStatusBarHidden = false
        ^
    /Users/david/Github/dugl/ios/Runner/AppDelegate.swift:14:58: warning: conditional cast from 'AppDelegate' to
    'UNUserNotificationCenterDelegate' always succeeds
          UNUserNotificationCenter.current().delegate = self as? UNUserNotificationCenterDelegate
                                                             ^
    /Users/david/Github/dugl/ios/Runner/AppDelegate.swift:10:9: warning: initialization of variable
    'flutter_native_splash' was never used; consider replacing with assignment to '_' or removing it
        var flutter_native_splash = 1
        ~~~~^~~~~~~~~~~~~~~~~~~~~
        _
    building file list ... rsync: link_stat
    "/Users/david/Github/dugl/build/ios/Debug-prod-iphonesimulator/App.framework" failed: No such file or directory (2)
    done

    sent 29 bytes  received 20 bytes  98.00 bytes/sec
    total size is 0  speedup is 0.00
    rsync error: some files could not be transferred (code 23) at
    /AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Sources/rsync/rsync-55/rsync/main.c(996) [sender=2.6.9]
    Command PhaseScriptExecution failed with a nonzero exit code
    Running upload-symbols in Build Phase mode
    Validating build environment for Crashlytics...
    warning: DEBUG_INFORMATION_FORMAT should be set to dwarf-with-dsym for all configurations. This could also be a
    timing issue, make sure the Fabric run script build phase is the last build phase and no other scripts have moved
    the dSYM from the location Xcode generated it. Unable to process Runner.app.dSYM at path
    /Users/david/Github/dugl/build/ios/Debug-prod-iphonesimulator/Runner.app.dSYM
    Make sure your project build settings are generating a dSYM file.


    Validation succeeded. Exiting because upload-symbols was run in validation mode
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Constructing build description

Could not build the application for the simulator.
Error launching application on iPhone 11 Pro.

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.0.0, on macOS 11.2.2 20D80 darwin-x64, locale en-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[✓] Xcode - develop for iOS and macOS
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.0)
[✓] VS Code (version 1.53.2)
[✓] Connected device (3 available)

• No issues found!

Edit: Tried running with --no-sound-null-safety and the same error occurred.

@jeiea
Copy link
jeiea commented Mar 4, 2021

It seems due to breaking API change. Maybe you need a migration.

@theniceboy
Copy link
Contributor Author

@jeiea Just tried doing it, it was a hell of a mess lol.. a few of the packages I depend on doesn't support null safety. Lots of dependency conflicts.

Is there any way to downgrade to Flutter 1.22?

@jeiea
Copy link
jeiea commented Mar 4, 2021

I have not tried 2.0 migration, but what I can think of is flutter downgrade.
And dart fix --apply may help.

@jmagman
Copy link
Member
jmagman commented Mar 4, 2021

Duplicate of #74519

@jmagman jmagman marked this as a duplicate of #74519 Mar 4, 2021
@jmagman jmagman closed this as completed Mar 4, 2021
@github-actions
Copy link
github-actions bot commented Aug 5, 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 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
0