crossplatformkorea / react-native-kakao-login

react-native native module for Kakao sign in.
MIT License
358 stars 135 forks source link

Android 빌드 에러 (Failed to apply plugin 'kotlin-android') #312

Closed jisoo-log closed 2 years ago

jisoo-log commented 2 years ago

Version of kakao-login libraries

4.2.1

Version of react-native

0.68.2

Platforms you faced the error (IOS or Android or both?)

Android

Expected behavior

안드로이드 빌드

Actual behavior

안드로이드 스튜디오에서 앱 빌드 시 아래와 같은 오류가 나면서 빌드가 되지 않습니다.

Build file '.../node_modules/@react-native-seoul/kakao-login/android/build.gradle' line: 20

An exception occurred applying plugin request [id: 'kotlin-android']
> Failed to apply plugin 'kotlin-android'.
   > Extension with name 'android' does not exist. Currently registered extension names: [ext, kotlin, kotlinTestRegistry]

관련 오류를 검색해보니 plugin 순서 문제라고 해서, 라이브러리의 build.gradle 파일을 아래와 같이 강제로 순서를 변경하고 sync를 했더니 빌드에 성공했습니다.

+ plugins { id 'com.android.library' }
plugins { id 'kotlin-android' }
- plugins { id 'com.android.library' }
plugins { id "io.invertase.gradle.build" version "1.5" }

올라온 이슈가 따로 없어서 저만 이런걸 겪고있나 싶기도 한데, 한 번 확인 부탁드립니다. 혹은 다른 방식으로 해결이 가능하다면 말씀해주시면 감사하겠습니다.

Tested environment (Emulator? Real Device?)

hyochan commented 2 years ago

감사합니다. 관련 이슈를 겪는 분들이 계시면 코멘트 달아주시면 좋겠네요 :)

ppsea commented 2 years ago

kakao-login 4.2.1 react-native 0.68.2 동일 이슈 발생하네요 😢

bang9 commented 2 years ago

kotlin-gradle-plugin 의 버전이 1.6.0 미만인 경우에 이슈가 발생하네요 임시로는 프로젝트 android/build.gradle 에 추가한 classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion" 의 코틀린 버전을 1.6.0 이상으로 올리시면 됩니다.

해결해서 PR 올리도록 하겠습니다!