Skip to content

flutter build ios fails: Failed to verify bitcode in Flutter.framework/Flutter on Xcode 10.3 #49787

Closed

Description

@RenanDelfanti
Unable to export archive: 2020-01-30 04:42:11.202 xcodebuild[5117:19924] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path '/var/folders/r7/d9twdq011sb8d3q1p8f39cdr0000gn/T/Runner_2020-01-30_04-42-11.199.xcdistributionlogs'. error: exportArchive: Failed to verify bitcode in Flutter.framework/Flutter: error: Linker option verification failed for bundle /var/folders/r7/d9twdq011sb8d3q1p8f39cdr0000gn/T/Flutterg1TtfH/Flutter.armv7.xar (unrecognized arguments: -platform_version iOS 8.0.0 13.0.0) Error Domain=IDEFoundationErrorDomain Code=1 "Failed to verify bitcode in Flutter.framework/Flutter: error: Linker option verification failed for bundle /var/folders/r7/d9twdq011sb8d3q1p8f39cdr0000gn/T/Flutterg1TtfH/Flutter.armv7.xar (unrecognized arguments: -platform_version iOS 8.0.0 13.0.0) " UserInfo={NSLocalizedDescription=Failed to verify bitcode in Flutter.framework/Flutter: error: Linker option verification failed for bundle /var/folders/r7/d9twdq011sb8d3q1p8f39cdr0000gn/T/Flutterg1TtfH/Flutter.armv7.xar (unrecognized arguments: -platform_version iOS 8.0.0 13.0.0) } ** EXPORT FAILED **

Activity

  1. RenanDelfanti commented on Jan 30, 2020

    @RenanDelfanti
    Author
    [✓] Flutter (Channel stable, v1.12.13+hotfix.7, on Mac OS X 10.14.6 18G2022, locale en)
    [!] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
        ! Some Android licenses not accepted.  To resolve this, run: flutter doctor --android-licenses
    [✓] Xcode - develop for iOS and macOS (Xcode 11.3.1)
    [!] Android Studio (not installed)
    [!] Connected device
        ! No devices available
    
    ! Doctor found issues in 3 categories.
  2. pawlowskim commented on Jan 31, 2020

    @pawlowskim

    We have faced the same issue after upgrading flutter from hotfix5 to hotfix7. What I have found so far, this might be related with the XCode version. In the logs there is something like this:

    {
                code = 0;
                description = "Failed to verify bitcode in Flutter.framework/Flutter:\nerror: Linker option verification failed for bundle /var/folders/wt/jjmd1pm16lv1d9ntx203shw00000gp/T/FluttermQF29X/Flutter.armv7.xar (unrecognized arguments: -platform_version iOS 8.0.0 13.0.0)\n\n";
                info =             {
                };
                level = ERROR;
                type = "malformed-payload";
            }
    

    AFAIK you need XCode 11 to build against iOS 13. Also, other mention about similar behaviour when the library is build in version 'X' of XCode, and when you want to use it under version 'Y' which is lower, there might be a problem with bitcode bundling (appspector/ios-sdk#4 (comment))
    If I didn't find any solution we will probably update the XCode version. I will let you know.

    EDIT. Some new info:
    #47101 (comment)

  3. added
    frameworkflutter/packages/flutter repository. See also f: labels.
    c: crashStack traces logged to the console
    t: xcode"xcodebuild" on iOS and general Xcode project management
    platform-iosiOS applications specifically
    on Jan 31, 2020
  4. RenanDelfanti commented on Jan 31, 2020

    @RenanDelfanti
    Author

    Some additional:
    When I change version of Xcode 10.3 to 11.3.1, its compile, but I have a blank screen and crash.

    crash_info_entry_0
    BUG IN CLIENT OF LIBDISPATCH: dispatch_sync called on queue already owned by current thread
    
    Crashed: com.google.GoogleConfigService.FIRRemoteConfig
    0  libdispatch.dylib              0x1b590ab20 __DISPATCH_WAIT_FOR_QUEUE__ + 452
    1  ???                            0x764e4981b590a800 (Ausente)
    2  ???                            0x0 (Ausente)
    3  Runner                         0x10228dad4 -[FPRRemoteConfigFlags sessionSamplingRate] + 4341635796
    4  Runner                         0x10228d168 -[FPRConfigurations sessionsSamplingPercentage] + 4341633384
    5  Runner                         0x102286b94 -[FPRSessionManager isGaugeCollectionEnabledForSessionId:] + 4341607316
    6  Runner                         0x102286a1c -[FPRSessionManager updateSessionId:] + 4341606940
    7  Runner                         0x10228673c -[FPRSessionManager initWithNotificationCenter:] + 4341606204
    8  Runner                         0x102286698 __35+[FPRSessionManager sharedInstance]_block_invoke + 4341606040
    9  libdispatch.dylib              0x1b58fdfd8 _dispatch_client_callout + 20
    10 ???                            0x0 (Ausente)
    11 ???                            0x0 (Ausente)
    12 Runner                         0x1022985e0 -[FPRNetworkTrace start] + 4341679584
    13 Runner                         0x10229f65c __InstrumentDataTaskWithRequestCompletionHandler_block_invoke + 4341708380
    14 Runner                         0x10229f5d8 __InstrumentDataTaskWithRequestCompletionHandler_block_invoke + 4341708248
    15 Runner                         0x102257980 -[FIRInstanceIDCheckinService checkinWithExistingCheckin:completion:] + 189 (FIRInstanceIDCheckinService.m:189)
    16 Runner                         0x102255284 -[FIRInstanceIDAuthService fetchCheckinInfoWithHandler:] + 188 (FIRInstanceIDAuthService.m:188)
    17 Runner                         0x10224e798 -[FIRInstanceID tokenWithAuthorizedEntity:scope:options:handler:] + 368 (FIRInstanceID.m:368)
    18 Runner                         0x102321c98 -[RCNConfigFetch refreshInstanceIDTokenAndFetchCheckInInfoWithCompletionHandler:] + 4342242456
    19 Runner                         0x102321860 __74-[RCNConfigFetch fetchAllConfigsWithExpirationDuration:completionHandler:]_block_invoke + 4342241376
    20 libdispatch.dylib              0x1b58fcb7c _dispatch_call_block_and_release + 32
    21 ???                            0x59006d01b58fe000 (Ausente)
    22 ???                            0x1c337f81b5904400 (Ausente)
    23 ???                            0x0 (Ausente)
    24 ???                            0x0 (Ausente)
    25 ???                            0x0 (Ausente)
    26 ???                            0x0 (Ausente)
    
  5. jmagman commented on Feb 1, 2020

    @jmagman
    Member

    @RenanDelfanti Your doctor output said "Xcode - develop for iOS and macOS (Xcode 11.3.1)". But you were on Xcode 10.3?

    That crash looks like it's in Firebase. You should create a new issue at https://github.com/firebase/firebase-ios-sdk/issues.

  6. added
    toolAffects the "flutter" command-line tool. See also t: labels.
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Feb 1, 2020
  7. changed the title [-]Build iOS fail[/-] [+]flutter build ios fails: Failed to verify bitcode in Flutter.framework/Flutter[/+] on Feb 1, 2020
  8. RenanDelfanti commented on Feb 1, 2020

    @RenanDelfanti
    Author

    @jmagman Sorry if my issue is confusing, I'll explain it better.
    I use services like AppCenter / CodeMagic to build and distribute my apps in flutter.
    These services allow you to choose the version of xcode, so the output can be confusing, but the version chosen when you gave this error was 10.3.

    This is the environment I use, App Center.
    Note that the version that was compiled was distributed in the store, and my code has not been changed until then, and I have the same problem with this application after the last hotfixes.
    Anotação 2020-02-01 083503

    EDIT: I was able to confirm that the cause of the white screen and crash was Firebase Performance.

  9. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Feb 1, 2020
  10. jmagman commented on Feb 3, 2020

    @jmagman
    Member

    EDIT: I was able to confirm that the cause of the white screen and crash was Firebase Performance.

    This issue can track the tool adding more Xcode 11 checks, then.

  11. removed
    frameworkflutter/packages/flutter repository. See also f: labels.
    on Feb 3, 2020
  12. 11 remaining items

  13. godofredoc commented on Feb 7, 2020

    @godofredoc
    Contributor

    microbenchmarks_ios are always failing on ios 13.3 too.

  14. jmagman commented on Feb 7, 2020

    @jmagman
    Member

    Essentially the LUCI builder must never be upgraded past the minimum Xcode version.

    Reproduction steps

    $ flutter create test_app
    $ flutter build ios
    
    1. open ios/Runner.xcworkspace in Xcode 10.2.
    2. Set up signing
    3. Product > Archive
    4. Distribute App > Development (or however you would distribute it, I have a development cert) > Next > Next

    Bitcode validation error. iOS app submission is blocked. Probably ditto macOS App Store submission but I didn't try.

    Workaround

    Upgrade to Xcode 11 or higher.

    Options

    1. Downgrade the LUCI builder to Xcode 10.2 and hotfix with the rebuilt engine (new hotfix)
    2. Downgrade the LUCI builder to Xcode 10.2 and rebuild the same hotfixed engine and replace the existing assets (no hotfix needed, assets being changed without a version bump probably not okay)
    3. Turn off all gauge performance metric tests, upgrade mac-10 to Xcode 11, up the minimum Xcode version in the tool to 11.0 (released September 2019), hotfix.
    4. Option 3 but no hotfix, let the version bump work its way through the channels, communicate to users must upgrade to Xcode 11.

    Option 3 looks like the most complete fix, but we would lose the gauge benchmarks.

    \cc @tvolkert @zanderso

  15. jmagman commented on Feb 7, 2020

    @jmagman
    Member

    Created #50315 in anticipation of Xcode version bump required for option 3 or 4.

  16. dnfield commented on Feb 7, 2020

    @dnfield
    Contributor

    We should have a test on Luci that fails if the devicelab is on a lower version of Xcode than Luci.

  17. dnfield commented on Feb 7, 2020

    @dnfield
    Contributor

    Downgrading the builders will involve rolling back multiple patches on the hotfix branch - 1 and 2 both seem pretty risky to me.

    I would rather turn off the gauge tests. My understanding is that it's both an Xcode issue and an iOS version issue. We need to find a way to enable them that will not require so much work on each upgrade of Xcode - the fact that we haven't found a work around yet is very concerning (Xcode 11 has been out for a while).

    I'm abivalent about hotfixing a change in the version checking on Xcode, but it would probably be good.

  18. pawlowskim commented on Feb 7, 2020

    @pawlowskim

    @jmagman I didn't enable bitcode in my project. I also don't use add-to-app.

    When you are building AppStore version by default it uses bitcode, so later on, Apple can rebuild your application without you action if needed (and also decrease the size of output files depending on the device / OS is used to download it). Our builder works fine for code review process, but tasks that builds release-able version fails because of that.

    Side note. This is kinda breaking change, because everyone needs to bump XCode and was released as a hotfix. Similar issues is with firebase for flutter. They have changed CloudFunctionsExeception structure and each application that rely on error response doesn't work anymore properly :(

  19. zanderso commented on Feb 7, 2020

    @zanderso
    Member

    Normally I would say that we should go with (4) since I don't think we should be using a hotfix as essentially an announcement mechanism. But I think @christopherfujino already has a hotfix in the works for something else, and we can piggyback on that one and do (3).

  20. jmagman commented on Feb 7, 2020

    @jmagman
    Member
  21. dnfield commented on Feb 8, 2020

    @dnfield
    Contributor

    Yes, this was an unintentional break. Unfortunately, we don't have a good way to roll this back - the process to do so would very likely introduce new breakages that would be even more serious than this one.

    We're sorry about this. A few of us are working on a document describing how this happened and what we're going to do to try to prevent it from happening again. Unfortunately, at this point, your only option is to upgrade Xcode or downgrade to hotfix 6 or earlier.

  22. dnfield commented on Feb 8, 2020

    @dnfield
    Contributor

    And for what it's worth, our next stable release would have introduced this change either way - but we realize introducing it as a hotfix without even a changelog update is disruptive. This just slipped through the cracks.

  23. jmagman commented on Feb 12, 2020

    @jmagman
    Member

    Xcode 11 check is in master and stable. See https://github.com/flutter/flutter/wiki/Hotfixes-to-the-Stable-Channel#hotfix8-february-11-2020

    Please update to Xcode 11! Closing.

  24. github-actions commented on Aug 23, 2021

    @github-actions

    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.

  25. locked as resolved and limited conversation to collaborators on Aug 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    c: crashStack traces logged to the consoleplatform-iosiOS applications specificallyplatform-macosBuilding on or for macOS specificallyt: xcode"xcodebuild" on iOS and general Xcode project managementtoolAffects the "flutter" command-line tool. See also t: labels.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions