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

url_launcher java.lang.RuntimeException: Unable to destroy activity, java.lang.IllegalArgumentException: Receiver not registered #127014

Closed
2 tasks done
SilkeSiip opened this issue May 17, 2023 · 9 comments
Labels
c: crash Stack traces logged to the console c: fatal crash Crashes that terminate the process found in release: 3.10 Found to occur in 3.10 found in release: 3.11 Found to occur in 3.11 has reproducible steps The issue has been confirmed reproducible and is ready to work on p: url_launcher Plugin to launch external applications P1 High-priority issues at the top of the work list package flutter/packages repository. See also p: labels. platform-android Android applications specifically waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds

Comments

@SilkeSiip
Copy link

Is there an existing issue for this?

Steps to reproduce

  1. open a in app browser on a android device
  2. close the in app browser again

Expected results

The app should not crash when closing a in app browser.

Actual results

The error mentioned in the title throws and the app crashes.

A more extensive bug report and a (temporary solution) can be found here: https://stackoverflow.com/questions/76244218/flutter-url-launcher-plugin-throws-java-lang-illegalargumentexception-receiver

Code sample

Code sample
GestureDetector(
    onTap: () => launchUrl(
          Uri.parse(myStringUrl),
        ),
),

Screenshots or Video

No response

Logs

No response

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.7.10, on macOS 13.0.1 22A400 darwin-x64, locale nl-NL)
    • Flutter version 3.7.10 on channel stable at /Users/myUserName/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 4b12645012 (6 weeks ago), 2023-04-03 17:46:48 -0700
    • Engine revision ec975089ac
    • Dart version 2.19.6
    • DevTools version 2.20.1

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0-rc1)
    • Android SDK at /Users/myUserName/Library/Android/sdk
    • Platform android-33, build-tools 33.0.0-rc1
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14C18
    • CocoaPods version 1.12.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)

[✓] VS Code (version 1.78.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.64.0

[✓] Connected device (3 available)
    • iPhone (mobile) • 10980a6ed605f82f401441bf424597d5a4a7eb8e • ios            • iOS
      16.1.2 20B110
    • macOS (desktop)             • macos                                    • darwin-x64     •
      macOS 13.0.1 22A400 darwin-x64
    • Chrome (web)                • chrome                                   • web-javascript •
      Google Chrome 98.0.4758.109

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!
@huycozy huycozy added the in triage Presently being triaged by the triage team label May 17, 2023
@huycozy
Copy link
Member

huycozy commented May 17, 2023

Thanks for the report. I also can reproduce this issue on the latest plugin version.

  • Sample code: url_launcher example

  • Affected on:

    • launch mode: LaunchMode.inAppWebView
    • platform: Android
    • version: url_launcher: ^6.1.11 and url_launcher_android: ^6.0.33
  • The issue doesn't happen on url_launcher_android: 6.0.31. May be introduced by PR 3973. Labeling the issue for further investigation.

Crash log
D/AndroidRuntime(14071): Shutting down VM
E/AndroidRuntime(14071): FATAL EXCEPTION: main
E/AndroidRuntime(14071): Process: com.example.reproduce_issues, PID: 14071
E/AndroidRuntime(14071): java.lang.RuntimeException: Unable to destroy activity {com.example.reproduce_issues/io.flutter.plugins.urllauncher.WebViewActivity}: java.lang.IllegalArgumentException: Receiver not registered: io.flutter.plugins.urllauncher.WebViewActivity$1@faac413
E/AndroidRuntime(14071): 	at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:5478)
E/AndroidRuntime(14071): 	at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:5507)
E/AndroidRuntime(14071): 	at android.app.servertransaction.DestroyActivityItem.execute(DestroyActivityItem.java:44)
E/AndroidRuntime(14071): 	at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:176)
E/AndroidRuntime(14071): 	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
E/AndroidRuntime(14071): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2328)
E/AndroidRuntime(14071): 	at android.os.Handler.dispatchMessage(Handler.java:106)
E/AndroidRuntime(14071): 	at android.os.Looper.loop(Looper.java:255)
E/AndroidRuntime(14071): 	at android.app.ActivityThread.main(ActivityThread.java:8212)
E/AndroidRuntime(14071): 	at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(14071): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:632)
E/AndroidRuntime(14071): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1049)
E/AndroidRuntime(14071): Caused by: java.lang.IllegalArgumentException: Receiver not registered: io.flutter.plugins.urllauncher.WebViewActivity$1@faac413
E/AndroidRuntime(14071): 	at android.app.LoadedApk.forgetReceiverDispatcher(LoadedApk.java:1533)
E/AndroidRuntime(14071): 	at android.app.ContextImpl.unregisterReceiver(ContextImpl.java:1674)
E/AndroidRuntime(14071): 	at android.content.ContextWrapper.unregisterReceiver(ContextWrapper.java:725)
E/AndroidRuntime(14071): 	at io.flutter.plugins.urllauncher.WebViewActivity.onDestroy(WebViewActivity.java:170)
E/AndroidRuntime(14071): 	at android.app.Activity.performDestroy(Activity.java:8404)
E/AndroidRuntime(14071): 	at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1344)
E/AndroidRuntime(14071): 	at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:5463)
E/AndroidRuntime(14071): 	... 11 more
W/eproduce_issue(14071): Attempt to remove non-JNI local reference, dumping thread
I/Process (14071): Sending signal. PID: 14071 SIG: 9
Lost connection to device.
flutter doctor -v (stable and master)
[✓] Flutter (Channel stable, 3.10.0, on macOS 13.0.1 22A400 darwin-x64, locale en-VN)
    • Flutter version 3.10.0 on channel stable at /Users/huynq/Documents/GitHub/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 84a1e904f4 (35 hours ago), 2023-05-09 07:41:44 -0700
    • Engine revision d44b5a94c9
    • Dart version 3.0.0
    • DevTools version 2.23.1

[✓] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
    • Android SDK at /Users/huynq/Library/Android/sdk
    • Platform android-33, build-tools 32.0.0
    • ANDROID_HOME = /Users/huynq/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14E222b
    • CocoaPods version 1.11.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)

[✓] VS Code (version 1.78.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.62.0

[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-x64     • macOS 13.0.1 22A400 darwin-x64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 113.0.5672.92

[✓] Network resources
    • All expected network resources are available.

• No issues found!
[!] Flutter (Channel master, 3.11.0-6.0.pre.85, on macOS 13.0.1 22A400 darwin-x64, locale en-VN)
    • Flutter version 3.11.0-6.0.pre.85 on channel master at /Users/huynq/Documents/GitHub/flutter_master
    ! Warning: `flutter` on your path resolves to /Users/huynq/Documents/GitHub/flutter/bin/flutter, which is not inside your current Flutter SDK checkout at /Users/huynq/Documents/GitHub/flutter_master. Consider adding /Users/huynq/Documents/GitHub/flutter_master/bin to the front of your path.
    ! Warning: `dart` on your path resolves to /Users/huynq/Documents/GitHub/flutter/bin/dart, which is not inside your current Flutter SDK checkout at /Users/huynq/Documents/GitHub/flutter_master. Consider adding /Users/huynq/Documents/GitHub/flutter_master/bin to the front of your path.
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 2919572fb3 (71 minutes ago), 2023-05-15 19:01:28 -0700
    • Engine revision c4d4b40c65
    • Dart version 3.1.0 (build 3.1.0-113.0.dev)
    • DevTools version 2.23.1
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.

[✓] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
    • Android SDK at /Users/huynq/Library/Android/sdk
    • Platform android-33, build-tools 32.0.0
    • ANDROID_HOME = /Users/huynq/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14E222b
    • CocoaPods version 1.11.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)

[✓] VS Code (version 1.78.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.64.0

[✓] Connected device (3 available)
    • RMX2001 (mobile) • EUYTFEUSQSRGDA6D • android-arm64  • Android 11 (API 30)
    • macOS (desktop)  • macos            • darwin-x64     • macOS 13.0.1 22A400 darwin-x64
    • Chrome (web)     • chrome           • web-javascript • Google Chrome 113.0.5672.92

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.

@huycozy huycozy added c: crash Stack traces logged to the console platform-android Android applications specifically p: url_launcher Plugin to launch external applications package flutter/packages repository. See also p: labels. has reproducible steps The issue has been confirmed reproducible and is ready to work on c: fatal crash Crashes that terminate the process found in release: 3.10 Found to occur in 3.10 found in release: 3.11 Found to occur in 3.11 and removed in triage Presently being triaged by the triage team labels May 17, 2023
@venomanse
Copy link

Having same issue

@gmackall
Copy link
Member

gmackall commented May 18, 2023

The revert here: flutter/packages#4027 should have fixed this issue, can you confirm whether on the latest version of url_launcher_android you are still encountering this issue?

@gmackall gmackall added waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds P1 High-priority issues at the top of the work list labels May 18, 2023
@joknjokn
Copy link

I'm getting crashytlics reports of this crash + I can reproduce by opening a site with url_launcher, then returning to the app.

url_launcher version 6.1.11.

@lstonussi
Copy link

Same issue here, with url_launcher version 6.1.11.
@gmackall

@gmackall
Copy link
Member

Sorry, I should have clarified that this is fixed specifically in the latest version of url_launcher_android (6.0.34). There was not an associated version change to url_launcher. I've revised my previous comment to avoid confusion.

I've also confirmed locally that the issue is reproducible in the (now retracted) version 6.0.33 of url_launcher android, but fixed in 6.0.34. Because of that I'm going to close this as fixed, but please report if you run into this issue while using the latest version of url_launcher_android and we can re-open.

@GeylanKalafMohe
Copy link

To upgrade the transitive dependency use this command in the terminal:

flutter pub upgrade url_launcher_android

@yadaniyil
Copy link

dependency_overrides:
  url_launcher_android: 6.0.35

Works for me

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
c: crash Stack traces logged to the console c: fatal crash Crashes that terminate the process found in release: 3.10 Found to occur in 3.10 found in release: 3.11 Found to occur in 3.11 has reproducible steps The issue has been confirmed reproducible and is ready to work on p: url_launcher Plugin to launch external applications P1 High-priority issues at the top of the work list package flutter/packages repository. See also p: labels. platform-android Android applications specifically waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds
Projects
None yet
Development

No branches or pull requests

8 participants