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

Add back button press handling on android #12

Closed
wants to merge 1 commit into from

Conversation

no-dap
Copy link

@no-dap no-dap commented Nov 25, 2020

Resolve #11

Android IamportActivity에서 webview가 생성된 후에 back button press 시 handleOnActivityResult로 null intent가 전달되면서
아래와 같은 에러가 발생합니다.

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:8110)
        at android.app.ActivityThread.deliverResults(ActivityThread.java:4838)

Full stacktrace

E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.woot.wootAppRelease, PID: 13011
    java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=6018, result=0, data=null} to activity {com.woot.wootAppRelease/com.woot.wootAppRelease.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:776)
        at com.getcapacitor.BridgeActivity.onActivityResult(BridgeActivity.java:214)
        at android.app.Activity.dispatchActivityResult(Activity.java:8110)
        at android.app.ActivityThread.deliverResults(ActivityThread.java:4838)

@SoleeChoi
Copy link
Contributor

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

귀하의 PR에 힌트를 얻어 해당 버그 수정하였지만 보다 나은 해결 방법을 적용하게 되면서
안타깝게도 해당 PR은 머지되지 못했습니다. 양해 부탁드립니다.

적용된 코드는 아래에서 확인하실 수 있습니다.

감사합니다.

@no-dap no-dap closed this Nov 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

capacitor 모듈 사용 중 앱 crash 문제
2 participants