-
-
Notifications
You must be signed in to change notification settings - Fork 286
Build and run the app
Smooth-App is the official mobile application for Open Food Facts, which relies on Flutter's framework.
To build the application, we currently depend on the latest stable version of Flutter (3.7.x as of writing this article). You can download and install the framework, by following the instructions on the official website.
The application only - and officially - supports Android and iOS (whereas Flutter supports both web and desktop).
The application can be deployed on multiple stores:
- iOS: only the App Store
- Android: Google Play, F-Droid, Huawei AppGallery and Samsung Gallery
Each store has its own configuration to use a different barcode scanning engine and a way to rate the app, that's why you have multiple entry points :
-
packages/smooth_app/lib/entrypoints/ios/main_ios.dart
to deploy on the App Store -
packages/smooth_app/lib/entrypoints/android/main_amazon_appstore.dart
to deploy on the Amazon Appstore -
packages/smooth_app/lib/entrypoints/android/main_fdroid.dart
to deploy on F-Droid -
packages/smooth_app/lib/entrypoints/android/main_google_play.dart
to deploy on the Google Play -
packages/smooth_app/lib/entrypoints/android/main_huawei_appgallery.dart
to deploy on the Huawei AppGallery -
packages/smooth_app/lib/entrypoints/android/main_samsung_gallery.dart
to deploy on the Samsung Gallery
At the top of the screen, you have multiple Run configurations available, which link to the correct store/platform you want to test:
- Move to the
packages/smooth_app
directory - Run the
flutter pub get
command to fetch the dependencies - Run the
flutter run -t [path/to/the/entrypoint.dart]
command to build and then launch the application in debug mode
For example, on iOS, the command is: flutter run -t packages/smooth_app/lib/entrypoints/ios/main_ios.dart
When you run the flutter run
command with an iOS device or simulator and if you have this kind of error:
Error: CocoaPods's specs repository is too out-of-date to satisfy
dependencies.
To update the CocoaPods specs, run:
pod repo update
Error running pod install
Error launching application on iPhone 14 Pro.
In that case, you simply need to:
- Move to the
ios
folder (within packages/smooth_app/) - Run the
pod update
command - Go back to the main folder and re-run
flutter run