A Bug's Unfortunate Fate - 00

A Bug's Unfortunate Fate - 00

work-log-00_finding-the-app-crashing-bug

I had a very interesting issue sometime last week, I had just updated my OS to Sonoma and also updated my Xcode and other dev tools.

I was responsible for managing a flutter app, the app has been on Google Play for some time and I was tasked to publish it to the Apple app store.

After some back and forth with the app about privacy issues and location permission description. Apple kept reporting that the app was crashing during start-up.

We have tested thoroughly on our end and I am very certain that the app does not crash. I took a look at the Firebase crashlytics dashboard, but no crash has been recorded.

That is weird.

We have had some issues with the app during development and staging, there should be crash logs in these environments. So how come there is no log on the development and staging crashlytics dashboard?

I took another look at the iOS configuration for crashlytics, we did not set that up properly. Setting this up helped me understand some of the intricacies of Xcode and Apple development cycle like schemas, target, build script (for schemas and target), and build phase. I triggered a crash and voila, crashlytics is up and running on all environments.

I bumped the build number up; did another round of testing and then sent it out to App Connect. A few hours later Apple review team responded.

Rejected!

Why? What? I asked - I hate Apple!

I hurried to crashlytics, hoping this time I would see the log on crashlytics. No record of the crash! What is going on?

In other not to give my "enemies" the joy to laugh over my career choice, I took a break by googling the issue on my phone.

Stackoverflow suggested I check the crash log the Apple review team sent with the notice. I have checked. I can't make sense out of it. The file content is in JSON and has values (hexadecimal values) that reminded me of the Window blue screen of death.

I read further and saw someone said something about symbolicating the file that was sent. Symbolicate? What is that?

From my understanding, how your app is built (compiled) determines this process. There is a whole process to this and it also involves using a file called `dysm`. To resolve my issue I did not have to go this route. See Apple Docs for Crash logs

All I did was to change the extension of the crash log Apple sent back from `.txt` to `.ips`.

Double-tap the file to open it. This time the log was much more readable.

Few lines into the log I could see, stuff like, "Triggered by Thread: 0", `nanopb`, `FirebaseSession` and `GoogleDataTransport`.

Now I know Firebase is the cause of the crash but I still have more questions

  1. Which Firebase package?
  2. Why does it not crash on my end?
  3. How do I resolve this?

Question #2 would have been answered earlier only if I had paid more attention. All our physical test devices are below iOS version 17.4. Apple was testing with iOS 17.4; but I should have picked up the crash since my simulator is now on iOS 17.4, right? Well, for some unknown reason(s), the simulator does not crash. I guess because it's in debug mode.

I headed off to Google again, I took the values of the `Exception Type`, and `Exception Subtype` from the the log file and then added `FirebaseSession` to streamline my search.

There it was, the first result on Google was from the Firebase FlutterFire GitHub repository (Issue 12442), someone had the same issue as mine. I browsed through the conversation, hoping and praying it was not one of those issues that had not been fixed yet. There is a solution and it is not a hacky one.

There was a lot of conversation about this issue, and it was caused by Firebase analytics. The issue was caused because a library (nanopb) used in the Firebase library was compiled with the wrong options. It also seem that it happens only on systems with arm architecture. Follow this GitHub thread for more info. I will follow up on the details later.

Someone on the GitHub thread pointed out that the issue was fixed in a new version. So, I updated my Firebase Flutter packages.

You would think this would fix my issue, No. The new Firebase packages are not compatible with my Flutter version. It is a good thing we are using Flutter version manager on the project (fvm). I updated my Flutter version from 3.13.x to 3.19.x.

You would think it is over, stability has been returned to my world, well you see, just like me, you are wrong.

Updating Flutter, exposed some bad code on my end and broke some packages. I fixed all the dependency conflicts and also made changes to my code where necessary, changes that will take more time were turned into actionable items on the board.

Test, Test and Test.

Everything is back to normal, but what is normal nowadays?

None of my testers want to update their iPhone to iOS 17.4 now I must rely on Apple to see that all my changes work on iOS 17.4.

It is the weekend, review is going to take longer than usual. I went out pretending not to care about the review and the match between Arsenal and Manchester United. I need Arsenal to win. It is important we win.

We won! Arsenal won!

All I have to do now is pretend not to care about Tottenham and Manchester City.

It is Monday, checking my email.

I don't care if it was... wait!

It was accepted! Let's go!

That is what, I am talking about. Who is the best programmer in the world!? Who!?

:)

Congratulations! Your submission was accepted for distribution

I am so happy, This back-and-forth with Apple spanned a little over a month.

I am glad it is over.

I have been programming professionally for over 6 years and this feeling still feels awesome.

Now, to the next bug, whatever that may be. I will write to you again when I resolve that.

Alex Alieja

Technical Project & Product Manager | AI & Agile Expert | Scrum Master | Proven Track Record in IT and FinTech | Driving Innovation, Efficiency, and Scalable Solutions | Passionate about AI, Blockchain, and Cybersecurity

9 个月

Jide, I appreciate your writing, you need to start writing more and I found your story to be very relatable. I felt as though I was experiencing the same emotions as you. Although I must admit, the anxiety was almost too much for me to handle, overall, it was a compelling and engaging read. Thank you for sharing.

Victor AJ

Software Engineer

9 个月

Congratulations my boss ??

要查看或添加评论,请登录

Jidechi Ukor的更多文章

社区洞察

其他会员也浏览了