One wrong activity caused me 10+ hours of debugging

One wrong activity caused me 10+ hours of debugging

BackerLeader posted 1 min read

The music app I vibe coded is working fine but I wanted to improve it. So I decided to add some extra features like playing in the background so that I can control playback from notification bar. Cool right ?

I also wanted to refactor my code because It would give me huge pain if I scale it just from here. I started working on it, I fixed all errors of refactoring but when I say

flutter run

It gives me an error which forced me scratch my head for days.

The Activity class declared in your AndroidManifest.xml is wrong...

Now I'm trying to fix things in xml file which I needed to actually make change in MainActivity.kt . The only thing I needed to replace below code

class MainActivity: FlutterFragmentActivity() {}

with this

class MainActivity: AudioServiceFragmentActivity() {}

Finally I'm a bit relieved. I did learn a lot as I actually reverse engineered code, refactored so much just to find answers. Now I really need a break lol.....................

If you read this far, tweet to the author to show them you care. Tweet a Thanks
0 votes
0 votes

More Posts

After facing weird permission issues, I built my own music app in 6 hours.

yogirahul - Jul 14

UI issues are beautiful.....

yogirahul - Jul 25

Why I Started Creating Models in My Flutter Project

yogirahul - Aug 20

How I Paid Off a Little Technical Debt in My Flutter Music App

yogirahul - Aug 15

When to Use setState, Provider, and Consumer in Flutter

yogirahul - Aug 11
chevron_left