Flutter - Build and Release an Android App | App Signing [2022] ,Fix All Problems With Steps

Опубликовано: 25 Февраль 2022
на канале: HDEV Coder
4,739
61

1-Change App Icon
A. flutter_launcher_icons: ^0.9.2
B. flutter_icons:
android: true
ios: true
image_path: "assets/icon.jpg"
C. assets:
assets/
D. flutter pub run flutter_launcher_icons:main
E. minSdkVersion 19
2-Rename App
A. pub global activate rename
B. pub global run rename --bundleId com.hdev.badge
C. pub global run rename --appname "New Badge"
D. nfo.plist
key CFBundleDisplayName /key
string New Badge /string


2-Signing the app

keytool -genkey -v -keystore ~/upload-keystore.jks -keyalg RSA -keysize 2048 -validity 10000 -alias upload

If not woking use android studio java

A. Delete old version that have same name


B. Flutter doctor -v
Will show you the java location
/Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
C. /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/
D. Any space use \ like /Android\Studio.app
/Applications/Android\ Studio.app/Contents/jre/Contents/Home/bin/keytool -genkey -v -keystore ~/upload-keystore.jks -keyalg RSA -keysize 2048 -validity 10000 -alias upload

E. add File key.properties
storePassword=password from previous step
keyPassword=password from previous step
keyAlias=upload
storeFile=location of the key store file, such as /Users/user name/upload-keystore.jks

def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}

android {

signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
}
buildTypes {
release {
signingConfig signingConfigs.release
}
}
Pubspc.yaml
version: 1.0.0+1
To update
3-Signing the app

D. [project]/android/app/build.gradle
android {
    defaultConfig {
        ...
      minSdkVersion 19
multiDexEnabled true
targetSdkVersion flutter.targetSdkVersion
    }
    ...
}

dependencies {
    implementation "androidx.multidex:multidex:2.0.1"
}

#
Terminal
flutter clean
3-Build AAB

# flutter build appbundle

If this show
Warning: Mapping new ns http://schemas.android.com/repository... to old ns http://schemas.android.com/repository...
Warning: Mapping new ns http://schemas.android.com/repository... to old ns http://schemas.android.com/repository...
Warning: Mapping new ns http://schemas.android.com/sdk/androi... to old ns http://schemas.android.com/sdk/androi...
Warning: Mapping new ns http://schemas.android.com/sdk/androi... to old ns http://schemas.android.com/sdk/androi...
Warning: Mapping new ns http://schemas.android.com/sdk/androi... to old ns http://schemas.android.com/sdk/androi...

App gradle
classpath 'com.android.tools.build:gradle:7.1.0'

Grade wrapper
/gradle-7.2-all.zip


Flutter Launcher Icons - Dart packages:
https://pub.dev/packages/flutter_laun...
Flutter Rename - Dart packages:

https://pub.dev/packages/renamehttps:...
Flutter - Build and Release an Android App | App
Flutter Tutorial - How To [2022] Build, Release App
how to create flutter build first appbundle release file aab
🔥 Subscribe for more:    / @hdevcoder  

🎓More tutorials you may like
● Fix Flutter Firebase Common Problems [2022] :    • Fix Flutter Firebase Common Problems ...  
● Onboarding Screen Design from Scratch without any library:   • Flutter Onboarding Screen Design from...  



📡 Social Media
GitHub: https://github.com/HDEVCODER
Twitter:   / coderhdev  

#Flutter #Tutorial #hdevcoder

Thanks for watching!
Make sure to like + Subscribe For More!