본문 바로가기

Flutter

[Flutter] 안드로이드 appbundle에 서명되는 업로드 키를 분실했을 때 대처방안

1. 다음 명령어로 새로 키스토어를 만든다. 

keytool -genkey -v -keystore key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias key

2. 만들어진 key.jks 파일을 /android/app 밑에 넣는다. 

3. /android 밑에 key.properties 파일을 생성하고 다음을 작성한다

storePassword=[비번]
keyPassword=[비번]
keyAlias=key
storeFile=./key.jks
 

4. /android/app/build.gradle의 android{} 위에 다음 내용을 추가한다. 

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

android {

5. /android/app/build.gradle의 buildTypes { 위에 다음 내용을 추가한다. 

signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']
}
}
 
 

6.  buildTypes의 release안에 signingConfigs를 release로 바꿔준다. 

release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.release
}
 

7.  터미널에서 flutter build appbundle을 실행한다. 

8. 실행 후 구글 콘솔에 앱번들 파일을 업로드 하면 다음처럼 오류가 뜰 것이다.

9. 그러면 keytool -export -rfc -alias key  -file upload_certificate.pem -keystore key.jks 명령어로 upload_certificate.pem를 만들어서 구글에 업로드키 재설정을 요청한다. 

https://support.google.com/googleplay/android-developer/answer/9842756?hl=ko&visit_id=638011712760707818-237464336&rd=1 

 

Play 앱 서명 사용하기 - Play Console 고객센터

도움이 되었나요? 어떻게 하면 개선할 수 있을까요? 예아니요

support.google.com

위의 링크에 들어가서

지원팀에 문의하여 키를 재설정 - 여기를 클릭한다. 

여기서 upload_certificate.pem 파일을 첨부하고 재설정 요청을 하면 된다. 

'Flutter' 카테고리의 다른 글

JSON Serialization  (0) 2021.10.22
flutter ios app Firebase Distribution으로 배포  (0) 2021.10.21