[안드로이드] 푸시 노티 설정 시 "android:exported needs to be explicitly specified" 에러 해결 방법
ㅁ 에러 문구
Manifest merger failed : android:exported needs to be explicitly specified for element <receiver#com.dieam.reactnativepushnotification.modules.RNPushNotificationBootEventReceiver>. Apps targeting Android 12 and higher are required to specify an explicit value for `android:exported` when the corresponding component has an intent filter defined
아마 제가 중간에 문서를 참조하면서 놓친 부분인 것 같습니다.
ㅁ 원인
안드로이드 12를 타게팅 하는 경우, AndroidManifest.xml 파일에서 activities, services, receivers 등에 android:exported를 설정해야 함
(https://ddolcat.tistory.com/1065)
ㅁ 해결책
activities, receivers등에 android:exported를 설정하면 됩니다.
참조 차 제 AndroidManifest.xml 공유합니다.
<application
android:usesCleartextTraffic="true"
android:name=".MainApplication"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:allowBackup="false"
android:theme="@style/AppTheme">
<meta-data
android:name="com.naver.maps.map.CLIENT_ID"
android:value="71l7g40qjh" />
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
android:launchMode="singleTask"
android:windowSoftInputMode="adjustResize"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data android:name="com.dieam.reactnativepushnotification.notification_foreground"
android:value="true"/>
<!-- Change the resource name to your App's accent color - or any other color you want -->
<meta-data android:name="com.dieam.reactnativepushnotification.notification_color"
android:resource="@color/white"/> <!-- or @android:color/{name} to use a standard color -->
<receiver android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationActions" android:exported="true" />
<receiver android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationPublisher" android:exported="true" />
<receiver android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationBootEventReceiver" android:exported="true">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.QUICKBOOT_POWERON" />
<action android:name="com.htc.intent.action.QUICKBOOT_POWERON"/>
</intent-filter>
</receiver>
<service
android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationListenerService"
android:exported="false" >
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
</application>
답변 1
앱실행시 네이버맵 [401] 에러
0
1063
2
스타일링 라이브러리
0
160
2
expo, cli 선택 중에 고민이 있습니다.
0
180
2
JDK 버전이 달라도 괜찮나요?
0
240
2
dimenstion usewindowdeminstion
0
130
3
[맥 전용]환경 설정하기 1편 & [맥 전용]환경 설정하기 2편의 영상이 안나옵니다.
0
217
1
jdk11 버전과 gradle 버전의 호환성 관련 질문드립니다.
0
407
2
강의 외 질문입니다!
0
164
2
react native랑 맞는 ui 라이브러리 어떤게 좋을까요?
0
1552
2
react native와 spring boot 연결
0
365
1
java가 아닌 .kt에서 code push 에러가 발생합니다.
0
222
2
flipper 239 에러가 발생합니다.
0
172
2
package.json에 /lib/panino.js 문제입니다.
0
480
2
window - mac 협업 과정 질문합니다
0
221
1
ios 빌드 중 RCTBridgeDelegate.h import 오류
0
294
2
ios 앱 빌드 중 hermesEnabled 관련 오류발생
0
249
2
Socket 연결시 질문 드립니다.!
0
157
2
wifi 환경에서 axios 통신이 로컬서버에서 안됩니다.
0
430
2
iOS render error 질문드립니다.
0
417
2
iOS 가상머신 오류
0
173
2
npc react init 명령어 실행시 발생되는 오류
0
224
1
nom start 시 오류
0
122
1
NextJS 기반으로 만들어서 웹뷰 React Native로 배포 가능한가요?
0
1019
2
안드로이드 rn75 버전에 맞게 설정 중에 android13 다운로드에 대해서 막혔습니다!
0
187
2





