Skip to content

flutter build ios-framework --xcframework incorrectly copies Flutter.framework.dSYM into App.xcframework #157359

Closed

Description

@jmagman

Add-to-app xcframework generation in release mode produces App.xcframework/ios-arm64/dSYMs/Flutter.framework.dSYM and Flutter.xcframework/ios-arm64/dSYMs/Flutter.framework.dSYM. App.xcframework should not contain this dSYM.

This causes the IPA error:

error: Multiple commands produce '......./BuildProductsPath/Release-iphoneos/Flutter.framework.dSYM/Contents'

Steps to Reproduce

Checkout https://github.com/flutter/samples

$ cd add_to_app/prebuilt_module/flutter_module
$ flutter build ios-framework --xcframework --output=../ios_using_prebuilt_module/Flutter --no-debug --no-profile

Observe ios_using_prebuilt_module/Flutter/Release/App.xcframework/ios-arm64/dSYMs/Flutter.framework.dSYM and ios_using_prebuilt_module/Flutter/Release/Flutter.xcframework/ios-arm64/dSYMs/Flutter.framework.dSYM.

The workaround is to delete App.xcframework/ios-arm64/dSYMs/Flutter.framework.dSYM.

Activity

  1. added
    toolAffects the "flutter" command-line tool. See also t: labels.
    a: existing-appsIntegration with existing apps via the add-to-app flow
    P1High-priority issues at the top of the work list
    team-iosOwned by iOS platform team
    triaged-iosTriaged by iOS platform team
    on Oct 22, 2024
  2. self-assigned this
    on Oct 22, 2024
  3. jmagman commented on Oct 22, 2024

    @jmagman
    MemberAuthor

    Logic is here:

    entity.basename.endsWith('dSYM'))
    .map((FileSystemEntity entity) => <String>['-debug-symbols', entity.path])
    .expand<String>((List<String> parameter) => parameter),

    Don't regress #80065

  4. jmagman commented on Oct 22, 2024

    @jmagman
    MemberAuthor

    Test to be updated is here:

    final String appFrameworkDsymPath = path.join(
    outputPath,
    mode,
    'App.xcframework',
    'ios-arm64',
    'dSYMs',
    'App.framework.dSYM'
    );
    checkDirectoryExists(appFrameworkDsymPath);

  5. jmagman commented on Oct 22, 2024

    @jmagman
    MemberAuthor

    And also the unit test add something like parentA.childFile('Flutter.framework.dSYM')..createSync(); and confirm the command doesn't change (also confirm it fails before the fix because I didn't actually try this 😅)

    final File dSYMA = parentA.childFile('FrameworkA.framework.dSYM')..createSync();

  6. dorukbasaran commented on Oct 23, 2024

    @dorukbasaran

    We are encountering the following issue with our iOS framework builds in release mode. Previously, the size of the framework was around 100MB, but now it has increased to over 1GB. We are removing the dSYM files and their references from the Info.plist files via a script during the release build. However, after doing this, we are now facing the following signature error. Could you please assist us?

    SignatureCollection /Users/runner/Library/Developer/Xcode/DerivedData/ProjectName-edzqkohwcavlbfdkjtskcbnbjloe/Build/Intermediates.noindex/ArchiveIntermediates/QA/BuildProductsPath/QA-iphoneos/Flutter.xcframework-ios.signature
    cd /Users/runner/work/1/s/ProjectName.xcodeproj
    builtin-collectSignature --input /Users/runner/work/1/s/Flutter/QA/Flutter.xcframework --output /Users/runner/Library/Developer/Xcode/DerivedData/ProjectName-edzqkohwcavlbfdkjtskcbnbjloe/Build/Intermediates.noindex/ArchiveIntermediates/QA/BuildProductsPath/QA-iphoneos/Flutter.xcframework-ios.signature --info platform ios --info library Flutter.framework
    error: signature-collection failed: The operation couldn’t be completed. (XCBUtil.CodeSignatureInfo.Error error 0.)

  7. sulaimankhan7 commented on Oct 23, 2024

    @sulaimankhan7

    The solution fixed my previous problem. It's not showing duplicate anymore. Instead, it is giving me no No such module 'Flutter' erro in compile time. Note: I am using a framework built in flutter inside my native iOS project.

  8. jmagman commented on Oct 24, 2024

    @jmagman
    MemberAuthor

    @dorukbasaran The fix just merged, would you be willing to test it on the master channel?

  9. jmagman commented on Oct 30, 2024

    @jmagman
    MemberAuthor

    @dorukbasaran or @sulaimansust can you confirm the fix? I'd like to hotfix to stable if it's working.

  10. jmagman commented on Oct 30, 2024

    @jmagman
    MemberAuthor

    Or anyone else hitting this, maybe 👍 @goncg007 @farukarslan?

  11. jogboms commented on Nov 4, 2024

    @jogboms

    Hey @jmagman I can verify this works as expected on master

  12. jmagman commented on Nov 4, 2024

    @jmagman
    MemberAuthor

    Stable channel cherry pick request at #158125

  13. Jeanno commented on Nov 5, 2024

    @Jeanno

    @jmagman It also works for me. Thanks

  14. github-actions commented on Nov 19, 2024

    @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.

  15. locked as resolved and limited conversation to collaborators on Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work lista: existing-appsIntegration with existing apps via the add-to-app flowcustomer: castawayteam-iosOwned by iOS platform teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-iosTriaged by iOS platform team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions