Flutter
Flutter Naver Login Android 이슈
용용수수
2023. 3. 14. 11:48
flutter_naver_login을 이용하여 네이버 아이디로 로그인 기능을 구현했다. iOS에서는 문제없이 잘 동작했지만 안드로이드에서 lateinit property launcher has not been initialized ~ 라는 에러메시지를 출력하고 기능이 동작하지 않았다.
해결법은
public class MainActivity extends FlutterActivity
에서
public class MainActivity extends FlutterFragmentActivity
로 변경해주면 된다.
위에서 출력된 이슈는 해결되었지만 java.lang.IllegalStateException: You need to use a Theme.AppCompat theme ~
라는 새로운 에러메시지가 출력되었고, 해결법은 다음과 같다.
/android/app/src/main/res/values/styles.xml
<style name="LaunchTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
<item name="android:windowBackground">@drawable/launch_background</item>
</style>
AndroidManifest.xml
<activity
android:name="com.navercorp.nid.oauth.NidOAuthBridgeActivity"
android:exported="true"
tools:replace="android:theme"
android:theme="@style/Theme.AppCompat"/>
<activity
android:name="com.navercorp.nid.oauth.activity.NidOAuthWebViewActivity"
android:exported="true"
tools:replace="android:theme"
android:theme="@style/Theme.AppCompat"/>
<activity
android:name="com.navercorp.nid.oauth.activity.NidOAuthCustomTabActivity"
android:exported="true"
tools:replace="android:theme"
android:theme="@style/Theme.AppCompat"/>
추가해주면 해결된다.