Error: FAILURE: Build failed with an exception.

AtoZ·2023년 8월 10일
0

이슈 해결

목록 보기
5/6
post-thumbnail

🤔 문제상황

React-native에서 카카오 소셜로그인 연동중에 발생함

FAILURE: Build failed with an exception.

💻 프로젝트 환경

  1. MonoRepo(yarn berry)
  2. Nest.js
  3. React-native 0.72.3

🔍 원인

해당 이슈는 log만 잘 읽어봐도 해결할 수 있는 문제이다.
해당 이슈의 원인은 안드로이드 12이상에서 부터는 activity의 intent-filter추가시 exported 옵션을 명시적으로 설정해주어야 한다.

📌 해결

[AS-IS]

<!-- androidManifest.xml -->
 <activity android:name="com.kakao.sdk.auth.AuthCodeHandlerActivity">
  <intent-filter>
      <action android:name="android.intent.action.VIEW" />
      <category android:name="android.intent.category.DEFAULT" />
      <category android:name="android.intent.category.BROWSABLE" />

      <data android:host="oauth"
          android:scheme="{카카오앱키}" />
  </intent-filter>
</activity>

[TO-BE]

<activity android:name="com.kakao.sdk.auth.AuthCodeHandlerActivity"
        android:exported="true">
    <intent-filter>
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <data android:host="oauth"
            android:scheme="{카카오앱키}" />
    </intent-filter>
</activity>

참고

https://developer.android.com/guide/topics/manifest/activity-element?hl=ko#exported

profile
코딩으로 글쓰는 작가

1개의 댓글

comment-user-thumbnail
2023년 8월 10일

정보에 감사드립니다.

답글 달기