Skip to main content

Xcode 15 + Flutter Development

As you may already know, Xcode 15 was released on 18 September. Which incorporates support for Swift 5.9 and a lot of improvements for developers in the ecosystem. If as a Flutter developer you are thinking of making the leap to this new version, what I have to tell you is of interest to you. 

The Xcode 15 IDE with Swift code and the SwiftUI previewer.

This new major version brings with it several changes that affect the CocoaPods dependency manager. In case you didn't know, Flutter doesn't use Swift Package Manager and depends on CocoaPods because the latter supports the parameter passing used internally by Flutter. But I will explain this in detail in another post.



The first thing we will need to do is to update our dependencies and for that we will go from the terminal to the ios folder of our project. Then, we will run pod update to ignore the versions in the Podfile.lock file and get the latest versions available.

The Android Studio terminal by moving in bash to the iOS project folder and executing the pod update command.

If we try to run our application on an iOS device we will encounter the following error.

Android Studio terminal unsuccessfully trying to run Flutter with cocoapods version lower than 1.13.0

What has happened in this new version?

If we google a bit about it we can find the following open issue in the CocoaPods project on GitHub. We can see that the bug has been fixed and planned for CocoaPods version 1.13.0 released on September 23rd. So now all that remains is to update CocoaPods.

The macOS terminal running in bash brew upgrade to update the brew packages.

If I now run the Flutter Clean command and start the execution from the beginning...

Android Studio terminal by running the flutter clean command.

And voila! It works!

Android Studio successfully running a Flutter project on an iPhone 14 Pro simulator.

Conclusions

Many people will probably not upgrade to Xcode 15 yet, and others will be lucky enough to upgrade at the same time as CocoaPods. But if, like me, this problem has happened to you, I hope you find it useful.

See you in other posts!





Comments

© 2020 Mobile Dev Hub