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

java.lang.IllegalStateException You must ensure the ActivityResultLauncher is registered before calling launch(). #367

Open
zhangwenxiang26 opened this issue Feb 13, 2025 · 0 comments
Labels

Comments

@zhangwenxiang26
Copy link

Expected behavior

An exception is caught and an error message is returned.

Actual behavior


java.lang.IllegalStateException

Attempting to launch an unregistered ActivityResultLauncher with contract androidx.activity.result.contract.ActivityResultContracts$StartActivityForResult@178d905 and input Intent { act=android.intent.action.VIEW dat=kakaotalk://kakaopay/payweb?bg_color=bg_grey&color_scheme=light&min_version=9.8.5&navigation=hide&t=y&t_obj=payment.a.pay-link&talk_min_version=9.8.5&url=https://fest.kakao.com/rudolph?barcode=https://global.alipay.com/281002040098Yvix6HaN75Ap1j0a3gj8Xo31 }. You must ensure the ActivityResultLauncher is registered before calling launch().


Error log:

androidx.activity.result.ActivityResultRegistry$register$2.launch(Unknown Source:90)
androidx.activity.result.ActivityResultLauncher.launch(SourceFile:1)
co.omise.android.ui.AuthorizingPaymentActivity.openDeepLink(Unknown Source:17)
co.omise.android.ui.AuthorizingPaymentActivity.access$openDeepLink(Unknown Source:0)
co.omise.android.ui.AuthorizingPaymentActivity$setupWebViewClient$1.shouldOverrideUrlLoading(Unknown Source:64)
org.chromium.android_webview.AwContentsClientBridge.shouldOverrideUrlLoading(chromium-TrichromeWebViewGoogle6432.aab-stable-683416333:118)
android.os.MessageQueue.nativePollOnce(Native Method)
android.os.MessageQueue.next(MessageQueue.java:340)
android.os.Looper.loopOnce(Looper.java:168)
android.os.Looper.loop(Looper.java:299)
android.app.ActivityThread.main(ActivityThread.java:8280)
java.lang.reflect.Method.invoke(Native Method)
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:576)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1073)

Steps to reproduce the issue

Click KakaoPay

Logs

No response

Screenshots

No response

Name and version information

Android Studio Hedgehog | 2023.1.1 Patch 2 AGP 8.2.2

implementation ('co.omise:omise-android:5.5.0')

Android 12,level 31 XiaoMi/MIUI arm64-v8a M2003J15SC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant