Skip to content

Wrong platform assets being copied to flutter_assets, macOS assets showing up in iOS flutter_assets #45075

@AfzalivE

Description

@AfzalivE

Steps to Reproduce

  1. Setup macos support in an existing project with Android and iOS support. flutter config --enable-macos-desktop and then flutter create --macos . (or whatever you need to do)
  2. Build the release version of the Mac part flutter build macos
  3. Build the release version of the iOS part flutter build ios

Maybe try a few more times in that order if everything works fine the first time.

Target Platform: Mac and iOS
Target OS version/browser: Mac OS 10.15.1 and iOS 13

Logs

 === BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Release ===
    2019-11-17 15:05:59.049 defaults[4938:4863527]
    The domain/default pair of
    (/Users/afzal/Dev/projects/Flutter/mailgun_routes/build/ios/Release-iphoneos/Ma
    ilgun
    Routes.app/Frameworks/App.framework/flutter_assets/macos/Flutter/ephemeral/App.
    framework/Info.plist, CFBundleExecutable) does not exist
    fatal error: lipo: can't map input file:
    /Users/afzal/Dev/projects/Flutter/mailgun_routes/build/ios/Release-iphoneos/Mai
    lgun
    Routes.app/Frameworks/App.framework/flutter_assets/macos/Flutter/ephemeral/App.
    framework/ (Invalid argument)
    fatal error: lipo: can't map input file:
    /Users/afzal/Dev/projects/Flutter/mailgun_routes/build/ios/Release-iphoneos/Mai
    lgun
    Routes.app/Frameworks/App.framework/flutter_assets/macos/Flutter/ephemeral/App.
    framework/ (Invalid argument)
    Failed to extract armv7 for
    /Users/afzal/Dev/projects/Flutter/mailgun_routes/build/ios/Release-iphoneos/Mai
    lgun
    Routes.app/Frameworks/App.framework/flutter_assets/macos/Flutter/ephemeral/App.
    framework/. Running lipo -info:
    fatal error: lipo: can't map input file:
    /Users/afzal/Dev/projects/Flutter/mailgun_routes/build/ios/Release-iphoneos/Mai
    lgun
    Routes.app/Frameworks/App.framework/flutter_assets/macos/Flutter/ephemeral/App.
    framework/ (Invalid argument)

For some reason, the macos folder gets created in ios/Flutter/App.Framework/flutter_assets when building the iOS version after the Mac version.

This also continues happening if you add the web part to this project. The build/web/assets folder will contain ios and macos folders with Flutter/App.Framework inside them (and flutter_assets) inside those. I think something in the build cache might be causing this.

Note: I am importing a json asset in pubspec.yaml called "secrets.json"
This is the project:
https://github.com/AfzalivE/mailgun_routes

Workaround

#45075 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    a: assetsPackaging, accessing, or using assetstoolAffects 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