4

Tidying up this question as there is a lot of different information and progress being made. Originally, the issue was:

flutter run -v

"/Users/sjr/Library/Developer/Xcode/iOS DeviceSupport/13.3.1
(17D50)/Symbols/Developer"
[  +35 ms] (lldb)     command script import
"/tmp/1D186BA70/fruitstrap_4c604fe43a334525340e269626a.py"
[   +4 ms] (lldb)     command script add -f
fruitstrap_4c604fe43a334525340e269626a.connect_command connect
[        ] (lldb)     command script add -s asynchronous -f
fruitstrap_4c604fe43a334525340e269626a.run_command run
[        ] (lldb)     command script add -s asynchronous -f
fruitstrap_4c604fe43a334525340e269626a.autoexit_command autoexit
[        ] (lldb)     command script add -s asynchronous -f
fruitstrap_4c604fe43a334525340e269626a.safequit_command safequit
[        ] (lldb)     connect
[  +52 ms] (lldb)     run
[ +277 ms] success
[        ] (lldb)     safequit
[ +120 ms] Process 434 detached
[  +48 ms] Application launched on the device. Waiting for observatory port.
[   +4 ms] Checking for advertised Dart observatories...
[+5026 ms] mDNS lookup failed, attempting fallback to reading device log.
[        ] Waiting for observatory port.

And at the same time, in XCode:

io.flutter.204.ui (625): signal SIGABRT

and

Failed to find snapshot: /private/var/containers/Bundle/Application/E00E6D3690/Runner.app/Frameworks/App.framework/flutter_assets/kernel_blob.bin

Hundreds of times until:

../../third_party/dart/runtime/vm/clustered_snapshot.cc: 68: error: Out of memory.

Since then I have followed a lot of advice and different attempts and suggestions for getting this working, but nothing has made any difference so far.

UPDATE:

Last night I found a thread in the flutter forums that suggested this was all caused by iOS 13.3, and that 13.4.1 resolves these issues. Installed this on my device but it made no difference at all to this issue.

I then investigated the path in the error:

/private/var/containers/Bundle/Application/E00E6D3690/Runner.app/Frameworks/App.framework/flutter_assets/kernel_blob.bin

And found that in my private/var folder I have no folder called containers at all, so of course it's not going to be able to find it. I am not sure at what point this folder is supposed to become populated with files and data, but perhaps this is the key to the whole mess.

Does anyone know what causes these folders to populate, and why mine might not exist at all?

Bisclavret
  • 1,327
  • 9
  • 37
  • 65
  • Have you tried to delete your ios directory and copyit from newly created app? Flutter had some changes in it's iOS embedding so maybe something went wrong during migration. You will have to reapply all changes (or discard unwanted changes through git) to native part but it may be worth it. – szotp Apr 24 '20 at 20:39
  • Hi szotp, thank you very much for the response. So in previous attempts a user had me upload my application into git, then create a brand new application and pull down from git again. Would this do the same thing as you suggest? – Bisclavret Apr 25 '20 at 02:37
  • This sounds strange, in git you don't need to upload anything, it works locally. My point is: you need to compare what you have inside your ios directory with what flutter makes when creating fresh new project. Perhaps you accidentaly did some changes that broke it. If you had entire git history it would be easy to check... – szotp Apr 25 '20 at 09:35
  • It is a cloud git repo, that's what I mean. It's not really relevant and didn't help with this issue anyway. I have tried multiple different solutions involving removing the ios folder completely and then letting it rebuild, including running flutter build ios from the terminal. It does not resolve this issue. – Bisclavret Apr 26 '20 at 03:35
  • 1
    Are you running on emulator or physical device? – Vamsi Apr 30 '20 at 15:22
  • Physical device. iPhone running iOS 13.4.1 – Bisclavret May 02 '20 at 05:09

2 Answers2

1

Super annoying, yes!

What helped me is:

  1. Run this command from your flutter main directory:
rm -rf ~/Library/Developer/Xcode/DerivedData/rm -rf ~/Library/Caches/CocoaPods/
rm -rf ios/Pods/
pod cache clean --all

# clear flutter - skip the next 3 lines if you're not using flutter
flutter clean
flutter pub get
cd ios

# run pod install
rm Podfile.lock
pod install --repo-update
  1. Restart you Mac (Seriously. Like in Windows XP Times).
  2. If you use Firebase, make sure that your AppDelegate.swift has the correct order.
import UIKit
import Flutter
import Firebase

@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
  override func application(
    _ application: UIApplication,
    didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
  ) -> Bool {
    FirebaseApp.configure()   // <- This line first
    GeneratedPluginRegistrant.register(with: self) // <- This line second
    return super.application(application, didFinishLaunchingWithOptions: launchOptions)
  }
}

(Source: https://github.com/FirebaseExtended/flutterfire/issues/3447#issuecomment-691654019)

Valentin Seehausen
  • 665
  • 1
  • 8
  • 10
0

It's a relatively "known" issue and I have the same one. I'm really tired of this. This bug may disappear for some reason and come up again. You can look at these threads:

https://github.com/FirebaseExtended/flutterfire/issues/326

https://github.com/flutter/flutter/issues/50532

https://github.com/flutter/flutter/issues/47627

I've gathered presumably helpful tips, it didn't help me but you might try:

flutter clean
rm -rf .flutter-plugins
rm -rf .packages
rm -rf build/
rm -rf ios/Pods
rm ios/Podfile*
rm -rf "${HOME}/.pub-cache/"
rm pubspec.lock
rm -rf ios/Runner.xcodeproj/project.xcworkspace
rm -rf "${HOME}/Library/Caches/CocoaPods"
rm -rf "~/Library/Developer/Xcode/DerivedData"
flutter packages get

Paths above may be different on your machine.

UPD: also, before running 'flutter run' try to 'flutter build ios'

Denis Gordin
  • 892
  • 10
  • 22
  • 1
    Yeah I hear you mate. I am getting really tired of Flutter in general. Literally everything they touch turns to dogpoo. If they just left it alone and played sudoku for the last 12 months they would have achieved more. That aside, I have tried all the steps you mentioned above already :( – Bisclavret Apr 26 '20 at 03:01
  • I went through all the posts you linked but they seem to be random errors generated in flutter, no related to this specific issue. Unless I am missing something. But I have also followed all your steps listed above, and I am getting a new error now which I will post in the original question, while I am looking up a possible solution to this new one. – Bisclavret Apr 26 '20 at 04:37
  • Ok, took me a couple of hours but I managed to resolve the new errors. Turns out if I run the app from xcode, it was giving the old -swift.h file missing errors. The fix was to add use_frameworks! and SWIFT_VERSION to the podfile as outlined here: https://stackoverflow.com/questions/51056579/flutter-plugin-geolocator-swift-h-file-not-found. Now I run the project again after all these changes, everything is exactly back how it was. Still the exact same errors when running from command line and Xcode. But thank you very much for the suggestion. – Bisclavret Apr 26 '20 at 07:35
  • @Bisclavret As far as I understand, the core of the problem is that there are some transition issues between GoogleDataTransport version 5.x.x and 6 and, presumably, if you can use/downgrade GoogleDataTransport to 5.x.x the bug may disappear. – Denis Gordin Apr 26 '20 at 15:00
  • I use firebase_auth in my project and I can't downgrade GoogleDataTransport from 6.x to 5.x for some reason. But, I could try to put GoogleDataTransport dependency directly to Podfile, I might work – Denis Gordin Apr 26 '20 at 15:06
  • Hi Denis, that is a great suggestion, but do you know how I might be able to do this? I am researching this topic but not getting any decent results. – Bisclavret Apr 26 '20 at 16:55
  • I'm not an expert in CocoaPods but you could try to put something like "pod 'Firebase/Auth', '< 6.0'" into your Podfile and call "pod install" after that (also open .xcworkspace right after calling pod install). – Denis Gordin Apr 26 '20 at 17:05
  • The problem is that there are many dependencies on this firebase flutter packages tree and I'm sure there will be some packages that will say that they are not compatible with Firebase/Auth lesser than 6.x. You can look at this tree in Podfile.lock file – Denis Gordin Apr 26 '20 at 17:08
  • Ops, I was thinking you have the same "firebase_auth" package problem. Anyway, instead of putting "Firebase/Auth" you can put your needed pod package – Denis Gordin Apr 26 '20 at 17:12
  • Thanks Denis. So the error in the original question is this one: Failed to find snapshot: /private/var/containers/Bundle/Application/E00E6D3690/Runner.app/Frameworks/App.framework/flutter_assets/kernel_blob.bin. Which pod package do you think this refers to? Because to me it doesn't seem to be a specific plugin, from the path name. Or is it? – Bisclavret Apr 27 '20 at 03:35
  • Sorry, but I don't know. You may try "rm -rf ios/Flutter/App.framework". I had some problems with App.framework while I was building the app in the past (don't remember what it was exactly). I'm not sure that it will help but it worths to try – Denis Gordin Apr 27 '20 at 12:42