I created appbundle thinking that everything is fine but I realized after sometimes that package name is not changed in profile and debug in android folder. So, I have to change package name there and if I change package name there, it means I have to build appbundle again. Is that fine to build appbundle again even when having existing appbundle.
Related
I'm storing some settings in String.fromEnvironment('CONFIG_EX'), when I run the app in Debug or Profile mode everything works normally, but now I launched it on the PlayStore in Open Test and it's returning a 403 error and I realized that the compilation generated the empty variables.
it's more or less like this in my run settings:
--dart-define=CONFIG_EX=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I'm generating my appbundle this way:
flutter build appbundle
Is there any way to generate this appbundle with the run settings?
You can extend build commands with extra parameters.
Android:
flutter build appbundle --dart-define=CONFIG_EX=xxx
iOS:
flutter build ios --dart-define=CONFIG_EX=xxx
I'm using Json Serializable in my flutter web app, so during the dev process i used to run the following command to generate the toJson and fromJson code:
flutter pub get && flutter pub run build_runner build --delete-conflicting-outputs
But now i want to build my app to deploy it, so obvisouly i'm deleting the files generated during the dev process, thinking the flutter build web will generate again the sources but in a more definitive way.
Obviously it didn't and I can't understand how to build my app without running the build_runner build. Because, coming from a js background, as it is a dev dependency, it shouldn't be involved in the final build process.
If someone could explain me, it would be very welcome
When I add a dependency to the pubspec.yaml file no matter if the IDE runs the pub get command or if I run it manually, it seems like the packages are being imported correctly (or that is what I think), however, if I "change my mind" and delete the package from the pubspec.yaml file, and again pub get, I am unable to build the app anymore, seems like the packages are still linked somehow to the app, even when there is no code related to them, the only way I can get back to work is by cleaning up all... e.g.
cd ios
cd ..
pod deintegrate
flutter clean
flutter pub cache repair
flutter pub get
cd ios
Pod install
Pod repo update
Maybe I am missing a step when working with dependencies.
I was using fiirebase_admob dependency 0.5.5 which was working great but when I went to release the apk version by flutter build apk --release it gave me error so I had to change the dependency from 0.5.5 to 0.8.0+4 and add API 'com.google.firebase:firebase-ads:16.0.1' in dependency of build>gradle this gave me the app-release.apk but causing app is crashing on startup. So, what should I change my dependency to get the app running smoothly?.
look for the file project.properties and modify the dependencies there with the versions that the error marks, the file build> gradle is modified each time the packager executes, so it does not keep them.
I am trying to build my release app in Flutter and when I run:
flutter run
everything works fine in debugging and test mode. But when I was trying to build a release app with:
flutter build apk
it creates an old first-release app of mine. That I created before and I try to reset the computer reset android and everything but not work what can I do to reset it and clear the cache?
I'm trying almost to delete and reset everything but they don't work.
What command that I have to run to fix it and create new version release apk
The solution is easy.
Just run flutter clean and run flutter build apk after that and it generates the updated app apk.
If you want to install it directly just run flutter install after the build command.
To all the beginners If you wish to release an apk of a flutter app just do:
flutter run --release
(and make sure to connect your device to a phone)
steps to ensure your phone is connected:
1. enable usb debugging mode in your phone
2.click on version number of your phone in system settings to enter into developer mode
3. change the phone mode to transferring file mode
After you run the command
go to build->apps->output->apk
run these command
flutter clean
and after that
flutter build apk --release
Run this command for making a bundle.
flutter build appbundle --target-platform android-arm,android-arm64,android-x64
If flutter clean and flutter build apk also generates apk with old version code in your pubspec.yaml change the version like this version: 1.0.2+2
Before + it is your version name and after + sign it is your version code
NOTE: Your new version number should be in the place of 2. Or you can use different format such as 1.2+2
You can run flutter clean Then run flutter build apk --split-per-abi to split the apk. It will build three apks and you can find them in build/app/outputs/flutter-apk/
Can be done easily by Android Studio