Reference https://flutter.dev/docs/deployment/android Making release build to the device flutter run --release -d <YourDeviceID from adb devices> Building app bundles with code obfuscations flutter build appbundle --obfuscate --split-debug-info=/debug_info Building universal apk flutter build apk --obfuscate --split-debug-info=/debug_info Building apk for 32bit flutter build apk --target-platform=android-arm --obfuscate --split-debug-info=/debug_info Building apk for 64bit flutter build apk --target-platform=android-arm64 --obfuscate --split-debug-info=/debug_info Spliting apk flutter build apk --split-per-abi --obfuscate --split-debug-info=/debug_info Building for web Switch to beta channel flutter channel beta Note : If the blank screen error occur, go to dev channel flutter channel dev Upgrade to get the latest build flutter upgrade Enable web support flutter config --enable-web Check whether the required chrome debugger is instal...
If you're calling to another URL from your flutter app, you need to manually allows the origin domains to avoid CORS policy for extra security. This is time consuming if you're setting up the policy on your production API server. So how do we solve it? We can solve it by two methods. 1- Allow your trusted domain from your development API server 2 - Run chrome with disable web security The second one is the easiest method so we'll start with the second method unless your app is already running on production server. Run chrome with disable web security Right click on desktop, add new shortcut. Add the target as "[PATH_TO_CHROME]\chrome.exe" --disable-web-security --disable-gpu --user-data-dir=~/chromeTemp. Click OK. Make sure you run the created shortcut with admin rights. Allow your trusted domain from your development API server
Here are the several problems of the crashing flutter app when making a debug build. First of all, it's always right to see the debugging messages. But what if the messages are not shown in default IDE? Capturing debug log in Visual Studio Code Press Ctrl + Shift + P and type Dart:Capture Logs and click OK Now start debugging your code. Run > Start Debugging You will see debug log messages which is useful to find out what went wrong! Some possible cause of app crashings Did you install new plugin and missing it's meta information in androidmanifest.xml? For example, if you're using admob plugin, you need to declare AdmobAppID in manifest file and if you didn't your app may crassh. <meta-data android :name ="com.google.android.gms.ads.APPLICATION_ID" android :value ="@string/admob_app_id" />
Comments
Post a Comment