Thursday, October 3, 2019

The flutter catastrophe

So things are going badly and there are plenty of solutions... sadly nothing that makes flutter a better project. They certainly do not release fast enough or, in my opinion, focus on the useful features that create a better user experience....

"No devices available" (iOS device on a Macbook Air)

This one was one of the first BIG problems that I fixed. In my case I had a brand new laptop and I deployed flutter according to the sensible instructions. Flutter installs with a number of tools in a cache folder. There were some useful additional tools to install like idevice_id and ideviceinfo that are needed by flutter and they can be overridden with homebrew.

To diagnose this problem... flutter doctor -v --bug-report

extract the zip file, try to locate programs like idevice_id and ideviceinfo and then try to execute them... if you receive a dyndna type error or something that looks like it could not locate the OSX equivalent of a missing DLL. Then you at the very least you can delete the flutter tools folder and reinstall. Alternatively and not-verified I have been told that deleting the bin/cache folder forces the flutter tool to reinstall the apps.


Something about "cocoapods ... runner ... target ... customer"

After running pod install I received a warning at the end. It's not very clear, however, in the ios folder there is a file Podfile that has a number of configs in it. Much of this information is static so be careful and save or preserve your work as the flutter tools may overwrite the default or computed config.

This particular error is because the Podfile contains a snippet at the top that sets the target. (debug, release, etc). But it also happens that xcode sets the values and so pod thinks it's a custom configuration with an override and so you get the warning.

To correct cd to the correct folder and just launch xcode. "runner" -> "info" -> "project" -> "runner"... in the configuration tab set configurations to NONE.

Then rerun the pod install and the error should be gone.


"SWIFT_VERSION"....

This is a tough one because [a] it's ruby [b] little or not docs [c] the flutter tools seem to do some overwriting.

unrelated... uncomment out this line at the set the version: platform :ios, '9.0'

It's unclear but you gotta set the SWIFT_VERSION but where... put this one at the top
   ENV['SWIFT_VERSION'] = '4.1'
and at the bottom in the post_install
   config.build_settings['SWIFT_VERSION'] = '4.1'

(I tried 5.1 but that did not work, 4.1 worked... need more documentation on that too)


A shit-ton of failures

One thing I have not gotten used to is that these massive number of errors was caused when the runner->target->runner->signing-> probably need to set the cert or the team... or the password.



warning: non-portable path to file '<protobuf/Any.pbobjc.h>'; specified path differs in case from file name on disk [-Wnonportable-include-path]
     #import <Protobuf/Any.pbobjc.h>



F
another fix -- legacy build .  FILE->WORKSPACE SETTINGS-> BUILD SYSTEM


Application crashes upon start
I have not finished this one... but I'm pretty certain the firebase licensing is failing. The documentation says you download and copy the file but the firebase doc is taking the POV that toy are an iPhone developer and not a flutter developer.  They want you to copy the file to runner/runner but that reference does not exist anyplace except XCode. And XCode has a function in the project viewer to add a file to a project. It's that add file to folder that is the trick. With the file in the "project" the build should assemble something useful.

Application crashes on firebase map
The application crashes and the connection to the mac is also lost. From that point forward the app will restart but will not reconnect to the mac/IDE. Furthermore, trying to re-build and re-attach all failed and then the IDE became unstable. I had to flutter upgrade, then flutter clean, then flutter pub get.

version control
so you think you are going to share code between projects or maybe that you can change the version control project.... forget it. There are too many artifacts that have the folder names baked in and no way to "relocate" the project.

MISC

flutter create -i swift
flutter clean
flutter upgrade
flutter pub get
flutter build

pod cache clean --all
pod install
pod update
sudo gem uninstall cocoapods
sudo gem install cocoapods

No comments:

Post a Comment

another bad day for open source

One of the hallmarks of a good open source project is just how complicated it is to install, configure and maintain. Happily gitlab and the ...