• Skip to main content
  • Skip to footer

Durvesh Naik

Freelancer. Marketer. Programmer.

  • Home
  • About Me
  • Contact Form
13 issues, 23 hours of fixing, I finally released ios app made with Flutter. How did I do it?

13 issues, 23 hours of fixing, I finally released ios app made with Flutter. How did I do it?

posted on August 29, 2019

I just released my Digital Marketing Meme app on the app store (And on play store). And in this post, I write down my experience of what are the difficulties and problems I faced while deploying it to the app store

One month ago I come across flutter and its use of accessibility and cross-platform features suddenly caught my eyes. I thought this is the framework I was looking for all these years.

I went on to learn a lot of things about flutter. Having done game development for the past 5 years means I knew about most of the programming terminology so it was quite a simple ride for me. Plus Angela Yu’s The Complete Flutter Development Bootcamp with Dart course (My affiliate link with 90% discount) helped me a lot in understanding the basics of flutter.

After I got a good grasp over Flutter basics, I decided to build an app that will give me the hands-down the experience of complete flutter app lifecycle.

After some research, I plan to develop a memes app on Digital Marketing. It would be a simple app with basic functionality like image (meme) fetch from server, different categories of memes, and an option to share the image (meme) on social media.

After around a week, I completed the app and wanted to release it finally on the app store.

Here’s how it looks like:

Remember in this article I share what type of issues I faced while deploying a flutter app on AppStore. It doesn’t include issues I faced while developing an app.

Now with that out of the way, let’s move on to,

How I approached Flutter deployment to iOS and app store?

First I opened flutter’s official document on “Preparing an iOS app for release”. I followed everything instructed inside of it.

I ran,

1
flutter doctor

and found that we need to integrate some homebrew and pods commands.

But, I didn’t have homebrew and pods installed on my machine. So first I opened https://brew.sh/ and installed the brew on my mac. While cocoa pods and other stuff are being downloaded, I created certificates and keychains. (I already had Xcode)

Cocoapods installation was still going on so I also created an app id in the app store connect.

After Flutter doctor gave me “green checkmarks”, I thought “now I am done, let’s run the command “flutter build ios”” and release the app on app store.

But little did I know that it was just the beginning of things to get worse.

I typed,

1
flutter build ios

And boom I faced an issue, it was written something like:

1. “Cannot find “xcodebuild”. Xcode 9.0 or greater is required to develop for iOS.”

This StackOverflow answer helped me with that

2. As soon as I solved it, I got this error on next “flutter build ios”

1
 “Error running pod install”

Thankfully this answered on stackoverflow helped me with that 

3. Once that issue was solved I was stuck in this issue: 

1
“#0 throwToolExit (package:flutter_tools/src/base/common.dart:28:3)”

Finding an answer to this question landed me on this thread which solved it for me. me:https://github.com/flutter/flutter/issues/36655

4. One another problem I faced is:

1
“[!] Automatically assigning platform `ios` with version `8.0` on target `Runner` because no platform was specified. Please specify a platform for this target in your Podfile……”

Thankfully someone from StackOverflow already faced this issue so I am able to solve it quickly:

It was just a matter of uncommenting one command from the podfile.

5. After that, I also stuck at finding podfile.lock. 

Not sure how, but later I did get podfile.lock just below my podfile. It could be solved by restarting android studio or after solving the other issues. I don’t really remember (sorry 🙁 )

6. Then the biggest problem arrived. This issue wasted a heck of a time and brain energy. 

The plugins I was using for sharing functionality inside of flutter (Esys Share)  was developed with swift code but flutter by default creates an Objective-C codebase project.

And as a result ios build was giving me this error:

1
2
=== BUILD TARGET flutter_inappbrowser OF PROJECT Pods WITH CONFIGURATION Debug ===
The "Swift Language Version" (SWIFT_VERSION) build setting must be set to a supported value for targets which use Swift. Supported values are: 3.0, 4.0, 4.2. This setting can be set in the build settings editor

Note that this is the issue with all the plugins that are made with swift code.

And the solution is to either create a new project with swift code enabled option. Like this:

1
flutter create -i swift awesome_project

Or if we already have a project created with nonswift code enabled then you have to delete “ios” folder from the android studio and then run below command in the terminal to rebuild the project with swift code enabled.

1
flutter create -i swift .

After that you might also need to add the following lines in the podfile:

1
2
3
4
5
6
7
8
9
10
11
12
13
target 'Runner' do
use_frameworks! # required by simple_permission
 
end
 
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '4.0'  # required by simple_permission
config.build_settings['ENABLE_BITCODE'] = 'NO'
end
end
end

7. This one is minor but worth mentioning:

When I executed, “flutter build ios” , apple asked for keychain login.

I was typing the password but the pop-up box was popping up almost instantly. The reason being flutter build ios command was running lots of things behind the scene which required the keychain password. So I had to press “Always allow” to get rid of that pop up once and for all.

Now after this command I was able to successfully build the ios project. I opened the project inside of xcode, and now  here are some issues I faced:

8. “Recent Issues Command PhaseScriptExecution failed with a nonzero exit code”
Answer over here helped me

  1. Go to General, then under Linked Frameworks and libraries, delete the Pods framework and add it back.
  2. Clean the project
  3. Compile again and it will work.

9. Answer to the question below is one of my favourites as the author explained it quite thoroughly with images. But first the issue:

1
“Xcode error: Could not locate device support files on iPhone with Xcode”

To fix it we have to add some latest version of dmg files, you can check it here on stackoverflow:

10. I also faced one issue, which I solved by Going to “Schemes > Edit Scheme” and selected the release certificate, as I didn’t have the debug certificate integrated into the machine.

After the above issue got resolved, I was able to successfully installed the app on my ipad, but the app was crashing on open. I checked the xcode and found this issue.

11. App crash issue :

Thread 1: signal SIGABRT :

1
flutter app crash on startup could not create a VM instance for dart

The answer was to: Add App.framework and Flutter.framework to Embedded Binaries works for me ( in release). Src

12. Use of unresolved identifier ‘GeneratedPluginRegistrant’

We have to bridge the headers as mentioned over here on github thread.

13. Now after all these got solved, and after It got satisfied with the app on the iPad, I decided to publish it on the app store.

So I pressed “Product > Archive”. But to my surprise the “Archive” option was disabled.

The answer is to make sure you have “Generic ios device” selected in your devices.

Woosh, finally I saw the “Archive” option. I first did “Analyze” and then pressed “archive” and uploaded my first flutter app on the app store.

Hurray.

How it feels after you finally solve all the flutter errors and publish an app on the appstore

In total it took me 23 hours to solve all these issues but in the end it all worth it.

Nothing in this world can beat the satisfaction of developing an app or game.

BTW If you want to download it on your phone then press here to download the app for android. And Press here to download the app for iOS

Filed Under: Flutter, ios development Tagged With: flutter development, flutter ios

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Footer CTA

Pages

  • About Me
  • Confirm Subscription
  • Contact Form
  • Disclaimer
  • Game Development Masterclass
  • Premium Game Development Course
  • Privacy Policy
  • Thank You Page
  • Thank You Page
  • Thank You Page
  • Thank You Page
  • Thank You Page
  • Unity Masterclass

Copyright © 2021 Durvesh Naik