Just a few useful notes about Flutter I want to remember:
- Open PowerShell as Administrator
- Run:
Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force
- Run:
npm install -g npm-windows-upgrade
- Run:
npm-windows-upgrade
Update Android app APK version:
- Go to android/app/build.gradle
- Increment the
versionCode
found inside the defaultConfig settings - Update the
versionName
accordingly
- Find where the Flutter SDK is located
- Open your bash profile, i.e.
sudo vi ~/.bash_profile
- Add the following:
export PATH=[PATH_TO_FLUTTER_GIT_DIRECTORY]/flutter/bin:$PATH
- Save changes
Change Package Name for an Existing app:
- Go to your AndroidManifest.xml file
- Change the label name:
<application
android:name="io.flutter.app.FlutterApplication"
android:label="[APP_NAME]" - Change the package name:
xmlns:android="http://schemas.android.com/apk/res/android"
package="your.package.name"> - Then go to your android/app/build.gradle file
- Update the
applicationId
found inside the defaultConfig settings - with the package name:
defaultConfig { applicationId "your.package.name" }
- And finally, go to the MainActivity.java file:
package your.package.name;
Change Package Name for a New app:
- Run:
flutter create --org com.yourdomain appname