Recently, i added some features to my side project flutter app.
The app is available on both platforms: Google Play Store and App Store.
If I release to both platforms at once and some bugs occur, it would be difficult to handle.
So I decided to release my new build to the Google Play Store first.
After the new build was released on the Google Play Store, I installed the app.
But something went wrong.
I couldn't access the main page. The app was stuck on the splash screen.
At that moment, something came to my mind.
I had just resolved an issue related to the sign_button package.
I was using the sign_button package on the login page, but the Apple login button didn't render correctly.
So I replaced it with the sign_in_button package and added it to dependencies in the pubspec.yaml file.
I started to think that I might have messed up the pubspec.yaml structure while doing this.
I might have placed the package in the wrong section.
It should have been in dependencies, but I accidentally added it to dev_dependencies.
I checked my pubspec.yaml again and realized that I had placed the package in dev_dependencies.
So I modified it and submitted a new build again. After that, the problem was solved.
If Flutter packages are placed in the dev_dependencies section, the app can still build while running in the debug environment.
But if they have runtime dependencies, they should be placed in the dependencies section.
Otherwise, crash problems can happen.
Actually, most Flutter packages have runtime dependencies, except for a few packages,
such as flutter_test, flutter_lints, and flutter_launcher_icons.
These have nothing to do with running the app.
Google Play Store reviewers are not that strict, i think.
I assume they didn't test my new build in the release environment.
Anyway, I fixed the packages in pubspec.yaml properly.

Top comments (0)