-
Create
.envfile fromexample.envwith your unique values. -
Get a secret token from https://account.mapbox.com/access-tokens/, then set it as
MAPBOX_DOWNLOADS_TOKENin yourgradle.propertiesfile (https://docs.mapbox.com/android/maps/guides/install/) and add it to a~/.netrcfile (https://docs.mapbox.com/ios/maps/guides/install/). -
Add your Google Services' configs to the
androidandiosfolders
/ios/Runner/GoogleService-Info.plist
/android/app/google-services.json
Those folders contain .example files, provided by https://github.com/firebase/quickstart-android and https://github.com/firebase/quickstart-ios, which can help you get the project quickly up and running.
-
Configure your flavor's images and settings in the config folder. See
config/.ntfor examples. -
Init submodules in the
pluginsfolder
git submodule update --init
- Run
flutter pub get
- To be able to build for Android, create a signing key in Android Studio (https://developer.android.com/studio/publish/app-signing#generate-key), then add a
key.propertiesfile to theandroidfolder with contents like this:
storePassword=<password_from_your_key_file>
keyPassword=<password_from_your_key_file>
keyAlias=<alias_from_your_key_file>
storeFile=<full_path_to_you_key_file>
The folder contains keystore.example and key.properties.example for quick start already. Don't forget to change the storeFile path inside key.properties.example to the absolute one.
- To be able to create release builds for iOS, make sure, after configuing the flavor and its package name in XCode, to let it download your provisioning profiles from the AppStore.
- To set up app icons, run
flutter pub run flutter_launcher_icons:main -f config/<YOUR_FLAVOR_SUFFIX>/flutter_launcher_icons.yaml
If you use VSCode, those can be set in advance in tasks.json.
- To set up splash screens, run
flutter pub run flutter_native_splash:create --path config/<YOUR_FLAVOR_SUFFIX>/flutter_native_splash.yaml
If you use VSCode, those can be set in advance in tasks.json.
- To run the app use
flutter run
with the following parameters:
--dart-define=DEFINE_APP_SUFFIX=<YOUR_FLAVOR_SUFFIX>, e.g..nt. The suffix will be used to differentiate the flavor you build, e.g. in the package name, server communication, flavor configuration.--dart-define="DEFINE_APP_NAME=<YOU_APP_NAME>.--dart-define=DEFINE_CONTROL_SERVER_URL=<YOUR_CONTROL_SERVER_URL>, including protocol, host, and port. The control server provides a list of measurement servers, registers measurements and stores their results.--dart-define=DEFINE_CMS_SERVER_URL=<YOUR_CMS_SERVER_URL>, including protocol, host, and port. The CMS contains texts and their translations, decides which features enable or disable for certain flavors.--dart-define=DEFINE_WEBPAGE_URL=<YOUR_WEBPAGE_URL>, including protocol, host, and port. This URL will be used as default for all the paths that require opening the web view.
If you use VSCode, those can be set in advance in launch.json.
-
Error building for iOS:
error: No profiles for 'com.example.nettest.nt' were found: Xcode couldn't find any iOS App Development provisioning profiles matching 'com.example.nettest.nt'Solution: openios/Runner.xcworkspaceand let it to download profiles. -
Error when deploying to TestFlight:
exportArchive: No profiles for 'com.example.nettest.nt' were found. Solution: open and validatebuild/ios/archive/Runner.xcarchive. -
Error when running tests:
The following FormatException was thrown while resolving an image:...Solution: runflutter clean,flutter pub get,flutter pub run build_runner build.