Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

capacitor 모듈 사용 중 앱 crash 문제 #11

Closed
MartianLee opened this issue Nov 16, 2020 · 5 comments
Closed

capacitor 모듈 사용 중 앱 crash 문제 #11

MartianLee opened this issue Nov 16, 2020 · 5 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@MartianLee
Copy link

MartianLee commented Nov 16, 2020

안녕하세요? 우선 iamport에서 capacitor 모듈을 지원해 주어서 감사하다는 말씀을 먼저 드립니다.
그런데 저희가 Android, iOS 모두 결제 도중 crash가 발생해 유저가 결제완료 창을 확인하지 못하는 문제가 있어 디버깅을 해보았습니다.
우선 저희 코드상에는 모두 예외처리가 되어 있어서 native 문제로 추측해 로그를 확인해 보았습니다.

상황

  1. 결제 버튼 눌러서 결제창 진입
  2. 그 뒤 결제 완료 혹은 그냥 뒤로가기를 눌렀을 때 일정한 확률로 app crash 발생

에러 (안드로이드 로그)

2020-10-30 18:43:21.002 2212-2212/com.fumi.app D/Capacitor/App: Firing change: false
2020-10-30 18:43:21.002 2212-2212/com.fumi.app V/Capacitor/App: Notifying listeners for event appStateChange
2020-10-30 18:43:21.002 2212-2212/com.fumi.app D/Capacitor/App: No listeners found for event appStateChange
2020-10-30 18:43:21.002 2212-2212/com.fumi.app D/Capacitor: App stopped
2020-10-30 18:43:21.004 2212-2212/com.fumi.app D/Capacitor: Saving instance state!
2020-10-30 18:43:21.010 2212-2212/com.fumi.app D/ViewRootImpl@10567e[MainActivity]: Relayout returned: old=(0,0,1080,2280) new=(0,0,1080,2280) req=(1080,2280)8 dur=2 res=0x5 s={false 0} ch=false
2020-10-30 18:43:21.024 2212-2249/com.fumi.app D/OpenGLRenderer: makeCurrent EglSurface : 0x0 -> 0x7abe19cd00
2020-10-30 18:43:21.413 2212-2212/com.fumi.app I/chromium: [INFO:CONSOLE(6)] "Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.", source: https://d3ulhu45f99mlj.cloudfront.net/js/jquery-1.10.2.min.js (6)
2020-10-30 18:43:22.794 2212-2212/com.fumi.app I/chromium: [INFO:CONSOLE(6110)] "Mixed Content: The page at 'https://ksmobile.inicis.com/smart/wcard/' was loaded over a secure connection, but contains a form that targets an insecure endpoint 'com.fumi.app://?imp_uid=imp_######%26merchant_uid=#######%26m_redirect_url=http%3A%2F%2Flocalhost%2Fiamport%3Fimp_uid%3Dimp_953999196723%26merchant_uid%3D#########'. This endpoint should be made available over a secure connection.", source: https://ksmobile.inicis.com/smart/wcard/ (6110)
2020-10-30 18:43:26.601 2212-2212/com.fumi.app D/ViewRootImpl@1dc3b65[IamportActivity]: ViewPostIme pointer 0
2020-10-30 18:43:26.640 2212-2212/com.fumi.app D/ViewRootImpl@1dc3b65[IamportActivity]: ViewPostIme pointer 1
2020-10-30 18:43:26.647 2212-2212/com.fumi.app D/InputMethodManager: prepareNavigationBarInfo() DecorView@6ff5a7e[IamportActivity]
2020-10-30 18:43:26.647 2212-2212/com.fumi.app D/InputMethodManager: getNavigationBarColor() -855310
2020-10-30 18:43:26.647 2212-2212/com.fumi.app V/InputMethodManager: Starting input: tba=com.fumi.app ic=null mNaviBarColor -855310 mIsGetNaviBarColorSuccess true , NavVisible : true , NavTrans : false
2020-10-30 18:43:26.648 2212-2212/com.fumi.app D/InputMethodManager: startInputInner - Id : 0
2020-10-30 18:43:26.648 2212-2212/com.fumi.app I/InputMethodManager: startInputInner - mService.startInputOrWindowGainedFocus
2020-10-30 18:43:26.649 2212-2212/com.fumi.app D/InputTransport: Input channel destroyed: 'ClientS', fd=178
2020-10-30 18:43:26.665 2212-2212/com.fumi.app D/InputMethodManager: HSIFW - flag : 0
2020-10-30 18:43:31.010 2212-2212/com.fumi.app D/ViewRootImpl@1dc3b65[IamportActivity]: ViewPostIme pointer 0
2020-10-30 18:43:31.073 2212-2212/com.fumi.app D/ViewRootImpl@1dc3b65[IamportActivity]: ViewPostIme pointer 1
2020-10-30 18:43:31.089 2212-2212/com.fumi.app D/InputMethodManager: HSIFW - flag : 0
2020-10-30 18:43:31.904 2212-2212/com.fumi.app D/ViewRootImpl@1dc3b65[IamportActivity]: ViewPostIme key 0
2020-10-30 18:43:31.910 2212-2212/com.fumi.app D/ViewRootImpl@1dc3b65[IamportActivity]: ViewPostIme key 1
2020-10-30 18:43:31.916 2212-2212/com.fumi.app D/OneSignal: curActivity is NOW: null
2020-10-30 18:43:31.929 2212-2212/com.fumi.app D/AndroidRuntime: Shutting down VM
    
    
    --------- beginning of crash
2020-10-30 18:43:31.929 2212-2212/com.fumi.app E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.fumi.app, PID: 2212
    java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=6018, result=0, data=null} to activity {com.fumi.app/com.fumi.app.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.os.Bundle android.content.Intent.getExtras()' on a null object reference
        at android.app.ActivityThread.deliverResults(ActivityThread.java:5237)
        at android.app.ActivityThread.handleSendResult(ActivityThread.java:5278)
        at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:51)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2220)
        at android.os.Handler.dispatchMessage(Handler.java:107)
        at android.os.Looper.loop(Looper.java:237)
        at android.app.ActivityThread.main(ActivityThread.java:8016)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1076)
     Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.os.Bundle android.content.Intent.getExtras()' on a null object reference
        at kr.iamport.capacitor.IamportCapacitor.handleOnActivityResult(IamportCapacitor.java:45)
        at com.getcapacitor.Bridge.onActivityResult(Bridge.java:776)
        at com.getcapacitor.BridgeActivity.onActivityResult(BridgeActivity.java:214)
        at android.app.Activity.dispatchActivityResult(Activity.java:8294)
        at android.app.ActivityThread.deliverResults(ActivityThread.java:5230)
        at android.app.ActivityThread.handleSendResult(ActivityThread.java:5278) 
        at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:51) 
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) 
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2220) 
        at android.os.Handler.dispatchMessage(Handler.java:107) 
        at android.os.Looper.loop(Looper.java:237) 
        at android.app.ActivityThread.main(ActivityThread.java:8016) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1076) 
2020-10-30 18:43:31.949 2212-2212/com.fumi.app I/Process: Sending signal. PID: 2212 SIG: 9

위와 같은 에러가 발생합니다.
null을 돌려받는다고 적혀있는데, 아임포트 모듈의 문제가 아닐까 하여 이렇게 질문 드립니다.
확인 부탁드립니다.
감사합니다.

@SoleeChoi
Copy link
Contributor

SoleeChoi commented Nov 17, 2020

안녕하세요 아임포트 기술지원팀입니다.

혹시 iamport-capacitor 모듈이 내장하고 있는 예제 프로젝트(example 또는 exampleForAngular)를
고객님이 테스트하고 계신 환경(기기와 상황)에서 돌려봤을때
동일하게 재현되는지 확인 가능하실까요?

감사합니다.

@no-dap
Copy link

no-dap commented Nov 26, 2020

저도 같은 이슈를 겪고있는데 example project로 재현해도 동일한 현상이 재현됩니다.
(On Pixel 3 API 29 emulator)

E/AndroidRuntime: FATAL EXCEPTION: main
    Process: io.ionic.starter, PID: 19183
    java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=6018, result=0, data=null} to activity {io.ionic.starter/io.ionic.starter.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.os.Bundle android.content.Intent.getExtras()' on a null object reference
        at android.app.ActivityThread.deliverResults(ActivityThread.java:4845)
        at android.app.ActivityThread.handleSendResult(ActivityThread.java:4886)
        at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:51)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016)
        at android.os.Handler.dispatchMessage(Handler.java:107)
        at android.os.Looper.loop(Looper.java:214)
        at android.app.ActivityThread.main(ActivityThread.java:7356)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
     Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.os.Bundle android.content.Intent.getExtras()' on a null object reference
        at kr.iamport.capacitor.IamportCapacitor.handleOnActivityResult(IamportCapacitor.java:45)
        at com.getcapacitor.Bridge.onActivityResult(Bridge.java:775)
        at com.getcapacitor.BridgeActivity.onActivityResult(BridgeActivity.java:209)
        at android.app.Activity.dispatchActivityResult(Activity.java:8110)
        at android.app.ActivityThread.deliverResults(ActivityThread.java:4838)

#12 확인해주세요

@SoleeChoi
Copy link
Contributor

안녕하세요 아임포트 기술지원팀입니다.

이번주 중으로 해당 내용 확인 후 머지 및 배포하도록 하겠습니다.

감사합니다.

@SoleeChoi
Copy link
Contributor

안녕하세요 아임포트 기술지원팀입니다.

생각한 것 보다 다소 시간이 걸려서, 머지 및 배포가 지연되고 있습니다.
현재 작업 진행하고 있으니 양해 부탁드립니다.

감사합니다.

@SoleeChoi
Copy link
Contributor

SoleeChoi commented Nov 30, 2020

안녕하세요 아임포트 기술지원팀입니다.

해당 버그 수정해 v0.11.0에 배포하였습니다.

@no-dap 안드로이드에서 뒤로가기시 단순히 액티비티를 종료하기 보다는
뒤로 갈 수 있으면(webview.canGoBack()) 뒤로 가고(webview.goBack())
뒤로 갈 수 없으면 액티비티를 종료하거나 특정 함수가 실행되도록 callbackOnBack 이라는 함수를 추가하게 되면서
부득이하게 귀하의 PR은 merge 할 수 없게 됐습니다. 양해 부탁드립니다.

해당 함수는 안드로이드에서만 동작하며, 선택 입력 필드입니다.
입력하지 않을 경우엔 기본적으로 액티비티가 단순히 종료됩니다.
아래는 callbackOnBack 함수가 적용된 예시 링크입니다.

이용에 참고 부탁드립니다.
감사합니다.

@SoleeChoi SoleeChoi added bug Something isn't working good first issue Good for newcomers labels Nov 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants