JosephNK / flutter_kakao_login

A Flutter plugin for using the native Kakao Login SDKs on Android and iOS.
BSD 2-Clause "Simplified" License
35 stars 15 forks source link

Got an error in android release mode #52

Closed parkindani closed 3 years ago

parkindani commented 3 years ago

안녕하세요. 유용한 패키지 만들어주셔서 잘 쓰고 있습니다. 카카오 로그인을 시도하는데, ios, android dev, android profile 모드에서는 로그인이 되지만 android release 로 apk 파일을 빌드해서 설치한 뒤 adb log를 찍어보면, 카카오 로그인 시도 후에 카카오 웹 페이지 열린 뒤에 다음과 같은 에러가 나옵니다.

flutter : LOGIN_ERR 로그인 실패

빌드를 하기 위해 사용하는 명령어는 다음과 같습니다.

flutter build apk --release --flavor production --dart-define=ENV=prd

flutter doctor 결과는 다음과 같습니다.

[✓] Flutter (Channel stable, 2.5.1, on macOS 11.6 20G165 darwin-x64, locale ko-KR)
    • Flutter version 2.5.1 at /Users/parkinpum/dev/mobile/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision ffb2ecea52 (13 days ago), 2021-09-17 15:26:33 -0400
    • Engine revision b3af521a05
    • Dart version 2.14.2

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/parkinpum/Library/Android/sdk
    • Platform android-30, build-tools 30.0.3
    • ANDROID_HOME = /Users/parkinpum/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 13.0, Build version 13A233
    • CocoaPods version 1.10.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2020.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)

[✓] VS Code (version 1.60.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.26.0

[✓] Connected device (2 available)
    • SM G955N (mobile) • ce0417145cfa18a70c • android-arm64  • Android 9 (API 28)
    • Chrome (web)      • chrome             • web-javascript • Google Chrome 94.0.4606.61

• No issues found!

build.gradle 은 다음과 같습니다.

       release {
           keyAlias keystoreProperties['keyAlias']
           keyPassword keystoreProperties['keyPassword']
           storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
           storePassword keystoreProperties['storePassword']
        }
    }

    buildTypes {
        release {
            signingConfig signingConfigs.release
           # 이 부분을 proguardFiles 'proguard-kakao.pro' 로도 해 보았으나 동일한 문제가 발생합니다.
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-kakao.pro'
        }
    }

해결책이 있을지 문의드립니다. 감사합니다.

in English: My flutter app with your package works well in iOS, Android debug and Android profile environment but not working in Android release mode and got one a line of error message.

parkindani commented 3 years ago

hashkey 문제였습니다. release mode 와 debug 모드에서 hashkey 가 달랐네요...