안드로이드 스튜디오를 디버깅 해보니 아래와 같은 오류가 발생하여 실행이 되지않았다.
Manifest merger failed : 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. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details.
해결방법을 찾아보니 Manifest의 activity 부분에 android:exported를 추가해주면 되었다.
<activity android:name=".MainActivity"
android:exported="true">
android:exported는 다른 애플리케이션의 구성요소로 Activity를 시작할 수 있는지를 설정한다. 다른 앱에서 Activity를 시작할 수 있으면 true
로 설정하고 다른 앱에서 Activity를 시작할 수 없으면 false
로 설정하면 된다.
false
로 설정된 경우 해당 Activity는 같은 앱 또는 사용자 ID가 같은 앱에서만 시작할 수 있다.