현재 로그인을 한 상태인데 권한동의 인 앱이 뜨다가 사라집니다.
2022-09-05 21:11:29.347 1353-3612/? E/WindowManager: win=Window{ad38c37 u0 com.mashup.chinchin/com.kakao.sdk.auth.AuthCodeHandlerActivity} destroySurfaces: appStopped=true win.mWindowRemovalAllowed=false win.mRemoveOnExit=false win.mViewVisibility=4 caller=com.android.server.wm.ActivityRecord.destroySurfaces:5860 com.android.server.wm.ActivityRecord.destroySurfaces:5841 com.android.server.wm.ActivityRecord.notifyAppStopped:5905 com.android.server.wm.ActivityRecord.activityStopped:6547 com.android.server.wm.ActivityClientController.activityStopped:254 android.app.IActivityClientController$Stub.onTransact:596 com.android.server.wm.ActivityClientController.onTransact:130
해시키 제대로 등록했는데 다음과 같은 에러가 발생해요
app id : 763476
sdk오류.zip (1.4 MB)
sdk 버전
implementation “com.kakao.sdk:v2-user:2.10.0”
2022-09-05 21:38:03.408 1353-9542/? I/ActivityTaskManager: START u0 {flg=0x10000000 cmp=com.mashup.chinchin/com.kakao.sdk.auth.AuthCodeHandlerActivity (has extras)} from uid 10472
2022-09-05 21:38:03.409 1353-9542/? D/ActivityTaskManager: TaskLaunchParamsModifier:task=null activity=ActivityRecord{84ac2eb u0 com.mashup.chinchin/com.kakao.sdk.auth.AuthCodeHandlerActivity display-area-from-source=DefaultTaskDisplayArea@46104928 display-id=0 display-windowing-mode=1 suggested-display-area=DefaultTaskDisplayArea@46104928
2022-09-05 21:38:03.409 1353-9542/? D/ActivityTaskManager: TaskLaunchParamsModifier:task=Task{34073e1 #13361 type=standard A=10472:com.mashup.chinchin U=0 visible=true mode=fullscreen translucent=false sz=2} activity=ActivityRecord{84ac2eb u0 com.mashup.chinchin/com.kakao.sdk.auth.AuthCodeHandlerActivity t-1} display-area-from-source=DefaultTaskDisplayArea@46104928 display-id=0 display-windowing-mode=1 suggested-display-area=DefaultTaskDisplayArea@46104928 inherit-from-source=fullscreen activity-options-fullscreen=Rect(0, 0 - 0, 0) non-freeform-display display-area=DefaultTaskDisplayArea@46104928 maximized-bounds
2022-09-05 21:38:03.416 1315-1388/? I/SurfaceFlinger: id=243122 createSurf (0x0),-1 flag=80004, ActivityRecord{84ac2eb u0 com.mashup.chinchin/com.kakao.sdk.auth.AuthCodeHandlerActivity t13361}#0
2022-09-05 21:38:03.485 1315-1388/? I/SurfaceFlinger: id=243123 createSurf (0x0),-1 flag=80004, 15923bf com.mashup.chinchin/com.kakao.sdk.auth.AuthCodeHandlerActivity#0
2022-09-05 21:38:03.491 1353-9542/? I/ActivityTaskManager: START u0 {act=android.intent.action.VIEW dat=https://kauth.kakao.com/... pkg=com.sec.android.app.sbrowser cmp=com.sec.android.app.sbrowser/.SBrowserLauncherActivity (has extras)} from uid 10472
2022-09-05 21:38:03.504 1353-9542/? V/WindowManager: Relayout Window{15923bf u0 com.mashup.chinchin/com.kakao.sdk.auth.AuthCodeHandlerActivity}: viewVisibility=0 req=1080x2640 d0
2022-09-05 21:38:03.505 1315-1388/? I/SurfaceFlinger: id=243125 createSurf (1080x2640),-3 flag=40004, com.mashup.chinchin/com.kakao.sdk.auth.AuthCodeHandlerActivity$_17500#0
2022-09-05 21:38:03.506 1353-9542/? D/WindowManager: makeSurface duration=2 name=com.mashup.chinchin/com.kakao.sdk.auth.AuthCodeHandlerActivity$_17500
2022-09-05 21:38:03.507 1353-9542/? V/WindowManager: Changing focus from null to Window{15923bf u0 com.mashup.chinchin/com.kakao.sdk.auth.AuthCodeHandlerActivity} displayId=0 Callers=com.android.server.wm.RootWindowContainer.updateFocusedWindowLocked:583 com.android.server.wm.WindowManagerService.updateFocusedWindowLocked:6496 com.android.server.wm.WindowManagerService.relayoutWindow:2769 com.android.server.wm.Session.relayout:242
2022-09-05 21:38:03.522 1315-1315/? I/SurfaceFlinger: [15923bf com.mashup.chinchin/com.kakao.sdk.auth.AuthCodeHandlerActivity#0] FrameRatePriority: 1
2022-09-05 21:38:03.524 1353-9542/? D/WindowManager: finishDrawingWindow: Window{15923bf u0 com.mashup.chinchin/com.kakao.sdk.auth.AuthCodeHandlerActivity} mDrawState=DRAW_PENDING
2022-09-05 21:38:03.530 1353-7907/? V/WindowManager: Changing focus from Window{15923bf u0 com.mashup.chinchin/com.kakao.sdk.auth.AuthCodeHandlerActivity} to null displayId=0 Callers=com.android.server.wm.RootWindowContainer.updateFocusedWindowLocked:583 com.android.server.wm.WindowManagerService.updateFocusedWindowLocked:6496 com.android.server.wm.ActivityTaskManagerService.setResumedActivityUncheckLocked:5498 com.android.server.wm.Task.onActivityStateChanged:2888
2022-09-05 21:38:03.540 1353-4239/? D/InputDispatcher: Focus request (0): 15923bf com.mashup.chinchin/com.kakao.sdk.auth.AuthCodeHandlerActivity but waiting because NOT_VISIBLE
2022-09-05 21:38:03.553 17500-17500/com.mashup.chinchin D/InsetsSourceConsumer: ensureControlAlpha: for ITYPE_NAVIGATION_BAR on com.mashup.chinchin/com.kakao.sdk.auth.AuthCodeHandlerActivity
2022-09-05 21:38:03.553 17500-17500/com.mashup.chinchin D/InsetsSourceConsumer: ensureControlAlpha: for ITYPE_STATUS_BAR on com.mashup.chinchin/com.kakao.sdk.auth.AuthCodeHandlerActivity
2022-09-05 21:38:03.555 1315-1315/? I/SurfaceFlinger: [15923bf com.mashup.chinchin/com.kakao.sdk.auth.AuthCodeHandlerActivity#0] FrameRatePriority: -1
2022-09-05 21:38:03.575 1353-4239/? I/ActivityTaskManager: START u0 {act=android.intent.action.VIEW dat=https://kauth.kakao.com/... pkg=com.sec.android.app.sbrowser cmp=com.sec.android.app.sbrowser/.custom_tab.SeparateTaskCustomTabActivity (has extras)} from uid 10281
2022-09-05 21:38:03.606 1353-7907/? V/WindowManager: Relayout Window{15923bf u0 com.mashup.chinchin/com.kakao.sdk.auth.AuthCodeHandlerActivity}: viewVisibility=4 req=1080x2640 d0
2022-09-05 21:38:03.610 1353-7907/? V/WindowManager: Setting visibility of Window{15923bf u0 com.mashup.chinchin/com.kakao.sdk.auth.AuthCodeHandlerActivity}: false, caller=com.android.server.wm.WindowContainer.sendAppVisibilityToClients:1110 com.android.server.wm.WindowToken.setClientVisible:448 com.android.server.wm.ActivityRecord.setClientVisible:7027 com.android.server.wm.ActivityRecord.notifyAppStopped:5903 com.android.server.wm.ActivityRecord.activityStopped:6547
2022-09-05 21:38:03.610 1353-7907/? E/WindowManager: win=Window{15923bf u0 com.mashup.chinchin/com.kakao.sdk.auth.AuthCodeHandlerActivity} destroySurfaces: appStopped=true win.mWindowRemovalAllowed=false win.mRemoveOnExit=false win.mViewVisibility=4 caller=com.android.server.wm.ActivityRecord.destroySurfaces:5860 com.android.server.wm.ActivityRecord.destroySurfaces:5841 com.android.server.wm.ActivityRecord.notifyAppStopped:5905 com.android.server.wm.ActivityRecord.activityStopped:6547 com.android.server.wm.ActivityClientController.activityStopped:254 android.app.IActivityClientController$Stub.onTransact:596 com.android.server.wm.ActivityClientController.onTransact:130
2022-09-05 21:38:03.610 1353-7907/? I/WindowManager: Destroying surface Surface(name=com.mashup.chinchin/com.kakao.sdk.auth.AuthCodeHandlerActivity$_17500)/@0x2e9bf81 called by com.android.server.wm.WindowStateAnimator.destroySurface:987 com.android.server.wm.WindowStateAnimator.destroySurfaceLocked:518 com.android.server.wm.WindowState.destroySurfaceUnchecked:4236 com.android.server.wm.WindowState.destroySurface:4210 com.android.server.wm.ActivityRecord.destroySurfaces:5860 com.android.server.wm.ActivityRecord.destroySurfaces:5841 com.android.server.wm.ActivityRecord.notifyAppStopped:5905 com.android.server.wm.ActivityRecord.activityStopped:6547
2022-09-05 21:38:03.621 1315-1315/? I/Layer: id=243125 removedFromDrawingState com.mashup.chinchin/com.kakao.sdk.auth.AuthCodeHandlerActivity$_17500#0 (174)
2022-09-05 21:38:03.622 1315-1315/? I/SurfaceFlinger: id=243125 Removed com.mashup.chinchin/com.kakao.sdk.auth.AuthCodeHandlerActivity$_17500#0 (174)
2022-09-05 21:38:03.623 1315-1315/? I/Layer: id=243125 Destroyed com.mashup.chinchin/com.kakao.sdk.auth.AuthCodeHandlerActivity$_17500#0
2022-09-05 21:38:03.627 1353-9542/? V/WindowManager: Relayout Window{15923bf u0 com.mashup.chinchin/com.kakao.sdk.auth.AuthCodeHandlerActivity}: viewVisibility=8 req=1080x2640 d0
2022-09-05 21:38:03.928 1353-9542/? I/ActivityTaskManager: START u0 {act=android.intent.action.VIEW cat=[android.intent.category.BROWSABLE] dat=kakaobc61de35a211c5b1381325b4a4f0ce70://oauth?code=jf_MmxZRktntTYRvfg8Asoh3glsuioZc3dd-xZPvlI2UUox8r7vZsboIL8D2VdkO3SdF-AopcFEAAAGDDahrHA flg=0x14000000 cmp=com.mashup.chinchin/com.kakao.sdk.auth.AuthCodeHandlerActivity (has extras)} from uid 10281
2022-09-05 21:38:03.929 1353-9542/? D/ActivityTaskManager: TaskLaunchParamsModifier:task=null activity=ActivityRecord{9b5b2ce u0 com.mashup.chinchin/com.kakao.sdk.auth.AuthCodeHandlerActivity display-area-from-source=DefaultTaskDisplayArea@46104928 display-id=0 display-windowing-mode=1 suggested-display-area=DefaultTaskDisplayArea@46104928
2022-09-05 21:38:03.930 1353-9542/? D/ActivityTaskManager: TaskLaunchParamsModifier:task=Task{34073e1 #13361 type=standard A=10472:com.mashup.chinchin U=0 visible=true mode=fullscreen translucent=false sz=4} activity=ActivityRecord{9b5b2ce u0 com.mashup.chinchin/com.kakao.sdk.auth.AuthCodeHandlerActivity t-1} display-area-from-source=DefaultTaskDisplayArea@46104928 display-id=0 display-windowing-mode=1 suggested-display-area=DefaultTaskDisplayArea@46104928 inherit-from-source=fullscreen activity-options-fullscreen=Rect(0, 0 - 0, 0) non-freeform-display display-area=DefaultTaskDisplayArea@46104928 maximized-bounds
2022-09-05 21:38:03.947 1353-9542/? V/WindowManager: Setting visibility of Window{15923bf u0 com.mashup.chinchin/com.kakao.sdk.auth.AuthCodeHandlerActivity}: true, caller=com.android.server.wm.WindowContainer.sendAppVisibilityToClients:1110 com.android.server.wm.WindowToken.setClientVisible:448 com.android.server.wm.ActivityRecord.setClientVisible:7027 com.android.server.wm.ActivityRecord.setVisibility:5442 com.android.server.wm.ActivityRecord.setVisibility:5337
2022-09-05 21:38:03.961 1353-7907/? V/WindowManager: Relayout Window{15923bf u0 com.mashup.chinchin/com.kakao.sdk.auth.AuthCodeHandlerActivity}: viewVisibility=4 req=1080x2640 d0
2022-09-05 21:38:03.978 1353-4239/? W/ActivityTaskManager: Duplicate finish request for r=ActivityRecord{84ac2eb u0 com.mashup.chinchin/com.kakao.sdk.auth.AuthCodeHandlerActivity t13361 f}}
2022-09-05 21:38:03.979 1353-4239/? V/WindowManager: Relayout Window{15923bf u0 com.mashup.chinchin/com.kakao.sdk.auth.AuthCodeHandlerActivity}: viewVisibility=0 req=1080x2640 d0
2022-09-05 21:38:03.979 1315-1388/? I/SurfaceFlinger: id=243151 createSurf (1080x2640),-3 flag=40004, com.mashup.chinchin/com.kakao.sdk.auth.AuthCodeHandlerActivity$_17500#0
2022-09-05 21:38:03.980 1353-4239/? D/WindowManager: makeSurface duration=1 name=com.mashup.chinchin/com.kakao.sdk.auth.AuthCodeHandlerActivity$_17500
2022-09-05 21:38:03.990 1353-4239/? D/WindowManager: finishDrawingWindow: Window{15923bf u0 com.mashup.chinchin/com.kakao.sdk.auth.AuthCodeHandlerActivity} mDrawState=DRAW_PENDING
2022-09-05 21:38:04.037 1353-4239/? W/InputManager-JNI: Input channel object '15923bf com.mashup.chinchin/com.kakao.sdk.auth.AuthCodeHandlerActivity (client)' was disposed without first being removed with the input manager!
2022-09-05 21:38:04.038 1353-4239/? I/WindowManager: Destroying surface Surface(name=com.mashup.chinchin/com.kakao.sdk.auth.AuthCodeHandlerActivity$_17500)/@0x6fc6097 called by com.android.server.wm.WindowStateAnimator.destroySurface:987 com.android.server.wm.WindowStateAnimator.destroySurfaceLocked:518 com.android.server.wm.WindowState.removeImmediately:2960 com.android.server.wm.WindowState.removeIfPossible:3151 com.android.server.wm.WindowState.removeIfPossible:2984 com.android.server.wm.WindowManagerService.removeWindow:2265 com.android.server.wm.Session.remove:225 android.view.IWindowSession$Stub.onTransact:746
2022-09-05 21:38:04.040 1353-4239/? I/ActivityTaskManager: Removing activity ActivityRecord{84ac2eb u0 com.mashup.chinchin/com.kakao.sdk.auth.AuthCodeHandlerActivity t13361 f}}(activityDestroyed) from stack callers=com.android.server.wm.ActivityRecord.destroyed:4099 com.android.server.wm.ActivityClientController.activityDestroyed:288 android.app.IActivityClientController$Stub.onTransact:604 com.android.server.wm.ActivityClientController.onTransact:130 android.os.Binder.execTransactInternal:1220
2022-09-05 21:38:04.054 1315-1315/? I/Layer: id=243151 removedFromDrawingState com.mashup.chinchin/com.kakao.sdk.auth.AuthCodeHandlerActivity$_17500#0 (186)
2022-09-05 21:38:04.054 1315-1315/? I/Layer: id=243123 removedFromDrawingState 15923bf com.mashup.chinchin/com.kakao.sdk.auth.AuthCodeHandlerActivity#0 (186)
2022-09-05 21:38:04.054 1315-1315/? I/SurfaceFlinger: id=243123 Removed 15923bf com.mashup.chinchin/com.kakao.sdk.auth.AuthCodeHandlerActivity#0 (186)
2022-09-05 21:38:04.055 1315-1315/? I/SurfaceFlinger: id=243151 Removed com.mashup.chinchin/com.kakao.sdk.auth.AuthCodeHandlerActivity$_17500#0 (186)
2022-09-05 21:38:04.055 1315-1315/? I/Layer: id=243123 Destroyed 15923bf com.mashup.chinchin/com.kakao.sdk.auth.AuthCodeHandlerActivity#0
2022-09-05 21:38:04.055 1315-1315/? I/Layer: id=243151 Destroyed com.mashup.chinchin/com.kakao.sdk.auth.AuthCodeHandlerActivity$_17500#0
2022-09-05 21:38:04.070 1315-1315/? I/Layer: id=243122 removedFromDrawingState ActivityRecord{84ac2eb u0 com.mashup.chinchin/com.kakao.sdk.auth.AuthCodeHandlerActivity t13361}#0 (184)
2022-09-05 21:38:04.071 1315-1315/? I/SurfaceFlinger: id=243122 Removed ActivityRecord{84ac2eb u0 com.mashup.chinchin/com.kakao.sdk.auth.AuthCodeHandlerActivity t13361}#0 (184)
2022-09-05 21:38:04.071 1315-1315/? I/Layer: id=243122 Destroyed ActivityRecord{84ac2eb u0 com.mashup.chinchin/com.kakao.sdk.auth.AuthCodeHandlerActivity t13361}#0
2022-09-05 21:38:04.526 1353-4089/? D/PkgPredictorService-IpmNapPreloadController: app:0_&_com.sec.android.app.sbrowser die, remove from <launchTime:2022-09-05 21:27:21 hour:21 day:2 previous:[com.sec.android.app.sbrowser, com.sec.android.app.sbrowser, com.mashup.chinchin] running:com.sec.android.app.sbrowser/com.sec.android.app.sbrowser.custom_tab.SeparateTaskCustomTabActivity apkVersion:18.0.0.58 userId:0 screenOrientation:1 wifi:3 bt:12 predictTime:2 launching Time:154 predicted:true prediction:[0_&_com.kakao.talk, 0_&_com.mashup.chinchin, 0_&_com.sec.android.app.sbrowser] preloaded:false preloading:[0_&_com.kakao.talk, 0_&_com.mashup.chinchin, 0_&_com.sec.android.app.sbrowser]>
위아래 상세 로그입니다.
tim.l
9월 5, 2022, 12:32오후
3
카카오측 로그상 추가항목동의받기 friends 항목 정상처리된 것으로 확인됩니다.
첨부해주신 로그에서 어떤 부분이 문제인지 부연 설명 부탁드립니다.
관련 코드 블럭도 공유 부탁드려요.
빠른 답변 감사합니다. 관련 코드 첨부합니다 ㅎㅎ
/** kakao에 친구목록 불러오는 권한 요청 */
private fun requestGetKakaoFriendsPermission(context: Context) {
UserApiClient.instance.me { user, error ->
if (error != null) {
Log.e(TAG, "사용자 정보 요청 실패", error)
} else if (user != null) {
val scopes = mutableListOf("friends")
if (scopes.isNotEmpty()) {
Log.d(TAG, "사용자에게 추가 동의를 받아야 합니다.")
//scope 목록을 전달하여 카카오 로그인 요청
UserApiClient.instance.loginWithNewScopes(context, scopes) { token, error ->
if (error != null) {
Log.e(TAG, "사용자 추가 동의 실패", error)
} else {
Log.d(TAG, "allowed scopes: ${token!!.scopes}")
if (token.scopes?.contains("friends") == true) {
setAgreeKakaoFriendsPermission(true)
}
// 사용자 정보 재요청
UserApiClient.instance.me { user, error ->
if (error != null) {
Log.e(TAG, "사용자 정보 요청 실패", error)
} else if (user != null) {
Log.i(TAG, "사용자 정보 요청 성공")
}
}
}
}
}
}
}
}
logcat
2022-09-05 21:41:29.701 17500-17500/com.mashup.chinchin I/RecommendFriendsViewModel: 동의 정보 확인 성공
현재 가지고 있는 동의 항목 ScopeInfo(id=2404801415, scopes=[Scope(id=friends, displayName=카카오 서비스 내 친구목록(프로필사진, 닉네임, 즐겨찾기 포함), type=PRIVACY, using=true, delegated=null, agreed=false, revocable=null)])
2022-09-05 21:41:29.790 17500-17500/com.mashup.chinchin D/RecommendFriendsViewModel: 사용자에게 추가 동의를 받아야 합니다.
2022-09-05 21:41:30.750 17500-17500/com.mashup.chinchin D/RecommendFriendsViewModel: allowed scopes: [profile_image, profile_nickname]
2022-09-05 21:41:30.870 17500-17500/com.mashup.chinchin I/RecommendFriendsViewModel: 사용자 정보 요청 성공
본문에 재현된 동영상 첨부하였습니다 → sdk오류.zip
확인해주시면 감사하겠습니다!
tim.l
9월 6, 2022, 12:34오전
5
영상과 logcat 기준으로 이미 friends 권한 동의 되어 있어서 동의창 안뜨는 것 같고
배치하신 로직 모두 정상 처리된것 같은데요.
오류라 판단하신 이유가 어떤건가요?
sodp2
9월 6, 2022, 1:33오전
6
새로 로그인한 계정으로 권한 요청 버튼을 클릭하였을 때 권한을 체크할 수 있는 상태가 아에 나오질 않습니다ㅠㅠ…
웹브라우저가 바로 떴다가 닫혀서요
로그에서 보면 현재 가지고 있는 동의 항목에 friends scope의 agreed가 false로 나옵니다.
또한 저희가 만든 로직상 권한 요청하는 버튼이 다시 나오지 않아야하거든요…
맨 처음 만들었을 때는 웹브라우저에서 추가 권한을 동의하는 부분이 나왔었고, 저희가 만든 권한 요청하는 버튼도 나오지 않게 되었었는데, 추가 작업을 진행하지 않았으나 웹브라우저로 권한을 동의하기 전에 바로 닫히는 현상입니다.
tim.l
9월 6, 2022, 2:54오전
7
추가 항목 동의 받기로 friends scope설정해서 인가 요청 했지만,
첨부해주신 영상처럼 동의 화면이 안떠서 추가 동의를 할 수 없다는 말씀이셨군요.
기재해주신 SDK버전으로 저도 테스트 앱 만들어 재현 한뒤 피드백 드릴게요.
1개의 좋아요
tim.l
9월 6, 2022, 3:16오전
8
테스트 해봤지만, 정상적으로 추가 동의 받기 처리되어 재현 할 수 없었습니다.
카카오 로그인이나 추가항목 동의 받기나 동일한 kauth 인가요청 기능을 사용하는데요.
카카오 로그인은 정상 처리되나요?
Kakao Developers
Android SDK Full Source & Samples 다운로드 받으셔서 동일한 증상 발생하는지 확인해보시겠어요?
1개의 좋아요
sodp2
9월 6, 2022, 4:52오후
9
카카오 로그인은 정상적으로 처리됩니다…!
링크로 주신 샘플을 통해서 확인 진행해보았는데요~
me - new scopes에 있는 UserApiClient.rx.me () 안에 friends를 scopes에 추가하고 실행시켜보았는데 지난 답변의 영상처럼 웹브라우저가 나왔다가 바로 종료되는것 처럼 보여집니다.
2022-09-07 01:48:12.382 21311-21311/com.kakao.sdk.sample I/KakaoSDKSample: 사용자 정보 요청 실패
ClientError(reason=Cancelled, msg=user cancelled.)
developers에서 권한을 제가 잘못 설정한것일까요…ㅠㅠ
샘플앱에서 코드로 되어있는 부분(생일 등등…)은 developers에서 이용중 동의로 설정한 경우 정상적으로 권한 동의를 하는 웹브라우저가 나오는데, friends만 나오지 않네요…
전에 답변 남겼던 방식대로 friends를 요청하면 정상적으로 요청이 되지 않는걸까요…?
sodp2
9월 18, 2022, 7:08오전
10
혹시 위에 남겼던 것 처럼 friends 권한을 요청하는 방식이 따로 있는건가요?
권한체크를 할 때 friends만 권한이 있는지 확인하는 코드가 없는 것 같아서요…!