Skip to content

flutter build ios failing: ld: framework not found App #32454

Description

@kentcb

Steps to Reproduce

I am running:

flutter build ios --release

Until recently, this worked. However, something is now broken and I'm having trouble identifying what. I have been trying to get Crashlytics working and I suspect it is related but it's unclear how.

Logs

I have run a build with --verbose and have uploaded as a zip here (output was too much for gist). I have redacted only the application name from the log.

This appears at several points in the log:

ld: framework not found App

But I suspect there is an underlying problem causing that.

flutter doctor -v output:

[✓] Flutter (Channel master, v1.5.9-pre.196, on Mac OS X 10.14.4 18E226, locale en-AU)
    • Flutter version 1.5.9-pre.196 at /Users/kent/Repository/flutter
    • Framework revision 9c77e8e8a0 (6 hours ago), 2019-05-09 12:43:51 -0700
    • Engine revision 644db5a49c
    • Dart version 2.3.1 (build 2.3.1-dev.0.0 a0290f823c)

[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at /Users/kent/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, 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_152-release-1343-b01)
    • All Android licenses accepted.

[✓] iOS toolchain - develop for iOS devices (Xcode 10.2.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 10.2.1, Build version 10E1001
    • ios-deploy 1.9.4
    • CocoaPods version 1.5.3

[!] Android Studio (version 3.4)
    • Android Studio at /Applications/Android Studio.app/Contents
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)

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

[✓] Connected device (1 available)
    • iPad • e9621f25ae14a6b0a4ad7d3eb0600bd2454564c0 • ios • iOS 12.1.4

! Doctor found issues in 1 category.

If you're wondering why I'm on master, it's because I've been going through hell trying to get an iOS build to actually complete without hanging/timeouts. That is now fixed on master so I'm there reluctantly until it makes its way into dev and beyond.

Activity

  1. kentcb commented on May 10, 2019

    @kentcb
    ContributorAuthor

    I tried going back to dev channel and got same result.

  2. added
    platform-iosiOS applications specifically
    toolAffects the "flutter" command-line tool. See also t: labels.
    on May 10, 2019
  3. FlorinMihalache commented on May 11, 2019

    @FlorinMihalache

    I think I had the same issue, also getting this error: ld: framework not found App

    This is how I fixed it:
    I noticed that in the project/ios/Flutter folder, App.framework was missing. Not sure what caused this, but I'm sure I did't delete it on purpose. I copied it from a new Flutter project and it works fine now.

  4. kangwang1988 commented on May 12, 2019

    @kangwang1988
    Contributor

    @FlorinMihalache
    Can you run flutter build ios --release --verbose and paste the result here?

  5. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on May 12, 2019
  6. suesitran commented on May 18, 2019

    @suesitran

    found this when i run "flutter build ios --release --verbose"

    Encountered error while building for device.

    #0      throwToolExit (package:flutter_tools/src/base/common.dart:24:3)
    #1      BuildIOSCommand.runCommand (package:flutter_tools/src/commands/build_ios.dart:94:7)
    <asynchronous suspension>
    #2      FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:559:18)
    #3      _asyncThenWrapperHelper.<anonymous closure> (dart:async-patch/async_patch.dart:77:64)
    #4      _rootRunUnary (dart:async/zone.dart:1132:38)
    #5      _CustomZone.runUnary (dart:async/zone.dart:1029:19)
    #6      _FutureListener.handleValue (dart:async/future_impl.dart:126:18)
    #7      Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:639:45)
    #8      Future._propagateToListeners (dart:async/future_impl.dart:668:32)
    #9      Future._complete (dart:async/future_impl.dart:473:7)
    #10     _SyncCompleter.complete (dart:async/future_impl.dart:51:12)
    #11     _AsyncAwaitCompleter.complete.<anonymous closure> (dart:async-patch/async_patch.dart:33:20)
    #12     _rootRun (dart:async/zone.dart:1124:13)
    #13     _CustomZone.run (dart:async/zone.dart:1021:19)
    #14     _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:947:23)
    #15     _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
    #16     _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
    #17     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:115:13)
    #18     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:172:5)
    
  7. kangwang1988 commented on May 26, 2019

    @kangwang1988
    Contributor

    Let me make the flutter build logic more clear.
    1.flutter tools would generate a Generated.xcconfig containing the flutter environment:
    image
    2.There is a xcode_backend.sh specified in Xcode project's build phases. It would do two things, copy Flutter.framework and compile App.framework based on environment variables specified in Generated.xcconfig
    image
    3.App.framework and flutter.framework are added to the project by default.
    image
    4.After adding to the project, it's linked and embeded.
    image
    This issue probably could be fixed by comparing your project setting and logic given below.

    @kentcb

  8. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    and removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on May 26, 2019
  9. IvanBean commented on May 26, 2019

    @IvanBean

    In my case, implementing Crashlytics 0.0.4+3 cause the Flutter.framwork and App.framework not be generated on flutter build ios, the build will fail and after that flutter run resulting in ld: framework not found App.

  10. harsha973 commented on Jun 23, 2019

    @harsha973

    I faced the same issue. For me it's because of wrong crashlytics configuration in Build scripts.

    ⛔️ Wrong configuration - Having Fabric and xcode_backend.sh in the same build script.

    Screen Shot 2019-06-24 at 10 25 41 AM

    To fix this, as mentioned in firebase_crashlytics documentation, you need to create separate config for crashlytics separate from Flutter build script.

    ✔️ 1) Separate config for xcode_backend.sh. Good explanation above. Basically this is responsible to copy Flutter.framework and compile App.framework based on environment variables.

    Screen Shot 2019-06-24 at 10 30 29 AM

    ✔️ 2) Separate config for Pods/Fabric

    Screen Shot 2019-06-24 at 10 30 37 AM

    In my case the reason for the problem is, xcode_backend.sh is adding input files as arguments and this script fails to copy Flutter.framework

    Hope this helps to move you in right direction.

  11. no-response commented on Jun 23, 2019

    @no-response

    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.

  12. 15 remaining items

  13. softmarshmallow commented on Mar 30, 2020

    @softmarshmallow

    app, flutter .framework does not exists in newly created dummy project via flutter create sample... wierd..?

  14. jmagman commented on Mar 30, 2020

    @jmagman
    Member

    app, flutter .framework does not exists in newly created dummy project via flutter create sample... wierd..?

    The file won't exist until you run flutter run or flutter build ios. If you're saying that it's not linked and embedded in the Xcode project, then that's behaving correctly, that's what #51453 did.

  15. palexs commented on Apr 12, 2020

    @palexs

    My app was missing App.framework and Flutter.framework and as a result failing to start, because Thin Binary build step contained a mistake. According to https://flutter.dev/docs/development/ios-project-migration it should be:

    /bin/sh "$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh" embed
    /bin/sh "$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh" thin
    

    but in my case it was:

    /bin/sh "$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh" embed_and_thin
    

    Apparently, xcode_backend.sh on channel stable as of the time of writing this is missing embed_and_thin command. Other channels have it, so I was able to run the app on channel beta, for example.

  16. jmagman commented on Apr 13, 2020

    @jmagman
    Member

    My app was missing App.framework and Flutter.framework and as a result failing to start, because Thin Binary build step contained a mistake. According to https://flutter.dev/docs/development/ios-project-migration it should be:

    /bin/sh "$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh" embed
    /bin/sh "$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh" thin
    

    but in my case it was:

    /bin/sh "$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh" embed_and_thin
    

    Apparently, xcode_backend.sh on channel stable as of the time of writing this is missing embed_and_thin command. Other channels have it, so I was able to run the app on channel beta, for example.

    That's exactly right, good investigation. In order to backport from beta/dev/master back to stable, you must have embed and thin separately because embed_and_thin isn't present in stable yet. Most users stay on stable or at least on a particular channel, so we optimize for their use cases, and try to document workarounds for the channel-hoppers.

  17. palexs commented on Apr 13, 2020

    @palexs

    @jmagman Thanks, Jenn! I'm afraid many people experiencing the problem land in #49504, but I couldn't post this solution there, as the conversation was resolved there and limited to collaborators only. Maybe you could post there.

  18. jmagman commented on Apr 13, 2020

    @jmagman
    Member

    @palexs I was hoping "If you are seeing a similar crash on iOS 13.4 or greater, please file a new Flutter GitHub issue so we can take a look." would cover it since there are about a thousand ways for code signing to fail or for the App.framework to be missing, so I don't want to point out #52084 (comment) specifically.

  19. srjmalla commented on Jun 27, 2020

    @srjmalla

    This fixed the issue for me

    flutter channel stable

    flutter upgrade

  20. Sauraus commented on Aug 6, 2020

    @Sauraus

    We just upgrade to 1.20.0 and since then this issue has cropped up. Tried all options so far and nothing.

    Another fun fact, downgrading to 1.19.0-4.3.pre resolves the issue, no more framework not found App... got a love software that makes breaking changes on a minor release.... Semantic versioning anyone? :D https://semver.org/

  21. rubensdemelo commented on Aug 6, 2020

    @rubensdemelo
    Contributor

    We just upgrade to 1.20.0 and since then this issue has cropped up. Tried all options so far and nothing.

    Another fun fact, downgrading to 1.19.0-4.3.pre resolves the issue, no more framework not found App... got a love software that makes breaking changes on a minor release.... Semantic versioning anyone? :D https://semver.org/

    try to delete ios/Flutter/Flutter.framework/ and run again

  22. Sauraus commented on Aug 6, 2020

    @Sauraus

    We just upgrade to 1.20.0 and since then this issue has cropped up. Tried all options so far and nothing.
    Another fun fact, downgrading to 1.19.0-4.3.pre resolves the issue, no more framework not found App... got a love software that makes breaking changes on a minor release.... Semantic versioning anyone? :D https://semver.org/

    try to delete ios/Flutter/Flutter.framework/ and run again

    Our build process runs a flutter clean which wipes all intermediate directories so that's already being done.

    BTW. I can also build the app with 1.17.5 except for some svg issues which is why I need the 1.19.0-4.3.pre version.

  23. jmagman commented on Aug 6, 2020

    @jmagman
    Member

    flutter clean does not delete ios/Flutter/Flutter.framework.

    If you are seeing this problem, please file a new GitHub issue and completely fill out the template, and include the output of your flutter run with the -v verbose command. ld: framework not found App is an extremely generic error (it means your compiled dart framework cannot be found), and I'd like to track down why you are individually seeing it.

    If you think this is related to https://flutter.dev/docs/development/ios-project-migration (did the migration not automatically happen for you?) that's helpful.

  24. Sauraus commented on Aug 6, 2020

    @Sauraus
  25. jmagman commented on Aug 6, 2020

    @jmagman
  26. locked as resolved and limited conversation to collaborators on Aug 6, 2020
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

    customer: crowdAffects or could affect many people, though not necessarily a specific customer.platform-iosiOS applications specificallytoolAffects 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