728x90
반응형
SMALL
참고 : https://flutter-ko.dev/docs/deployment/android
keystore 만들기
Google Play 앱 서명 키 사용 시 여기서 만든 keystore 키는 구글 플레이 콘솔에서 업로드 키로 사용된다.
실제 앱 서명 키는 구글에서 관리한다.
keytool -genkey -v -keystore /{keystore 저장 경로}/key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias key
ex)
keytool -genkey -v -keystore ~/key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias key
<app dir>/android/key.properties 파일을 생성
storePassword=<keystore 생성시 등록한 비밀번호>
keyPassword=<keystore 생성시 등록한 비밀번호>
keyAlias=key
storeFile=<key store 파일 위치>
<app dir>/android/app/build.gradle 파일을 수정
- SDK 버전 수정
compileSdkVersion 29
targetSdkVersion 29
- android {} 위에 아래 내용 등록
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
android{...}
- buildTypes {} 코드를 다음과 같이 수정
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']
}
}
buildTypes {
release {
signingConfig signingConfigs.release
minifyEnabled true
useProguard true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
<app dir>/android/app/proguard-rules.pro 파일을 생성하고 다음과 같은 규칙을 추가
## Flutter wrapper
-keep class io.flutter.app.** { *; }
-keep class io.flutter.plugin.** { *; }
-keep class io.flutter.util.** { *; }
-keep class io.flutter.view.** { *; }
-keep class io.flutter.** { *; }
-keep class io.flutter.plugins.** { *; }
-dontwarn io.flutter.embedding.**
<app dir>/android/app/src/main/AndroidManifest.xml 수정
- 퍼미션 추가
<manifest>
<!-- 퍼미션 추가 -->
<uses-permission android:name="android.permission.INTERNET"/>
<application>
...
</application>
</manifest>
- 앱 이름 확인
<android:label...> 에 앱 설치시 표시될 이름 확인
APK 빌드
flutter build apk --split-per-abi
728x90
반응형
LIST
'Program > Flutter' 카테고리의 다른 글
Flutter + FCM : Android 기준 (0) | 2020.08.10 |
---|---|
Flutter Splash Screen 적용 (0) | 2020.08.07 |
Mac Flutter 개발 환경 (0) | 2020.07.15 |
Dart 기본 문법 (0) | 2020.07.08 |
Flutter Card Widget Sample (0) | 2019.10.02 |