Skip to content

Android 15 crash: android.content.ActivityNotFoundException - io.swan.rnbrowser.helpers.CustomTabActivityHelper.openCustomTab #29

@JeffreyVanelderenACA

Description

@JeffreyVanelderenACA

Before submitting a new issue

  • I tested using the latest release of the library, as maybe the bug has been already fixed.
  • I checked for possible duplicate issues, with possible answers.

Bug summary

I'm having a crash in production on Android: android.content.ActivityNotFoundException.
Only 2 users are having this crash.

OS: Android 15 (SDK 35)

Device1: Samsung a15
Device2: Samsung gta9pwifi (tablet)

Any idea if this is the case when the user has not setup Chrome/a default browser except to the native Samsung one?

Stacktrace:

Exception android.content.ActivityNotFoundException:
  at android.app.Instrumentation.checkStartActivityResult (Instrumentation.java:2443)
  at android.app.Instrumentation.execStartActivity (Instrumentation.java:2005)
  at android.app.Activity.startActivityForResult (Activity.java:6043)
  at androidx.activity.ComponentActivity.startActivityForResult (ComponentActivity.java:780)
  at android.app.Activity.startActivity (Activity.java:6494)
  at androidx.core.content.ContextCompat.startActivity (ContextCompat.java:295)
  at androidx.browser.customtabs.CustomTabsIntent.launchUrl (CustomTabsIntent.java:662)
  at io.swan.rnbrowser.helpers.CustomTabActivityHelper.openCustomTab (CustomTabActivityHelper.java:61)
  at io.swan.rnbrowser.RNSwanBrowserModuleImpl.open$swan_io_react_native_browser_release (RNSwanBrowserModuleImpl.kt:76)
  at io.swan.rnbrowser.RNSwanBrowserModule.open (RNSwanBrowserModule.kt:20)
  at java.lang.reflect.Method.invoke
  at com.facebook.react.bridge.JavaMethodWrapper.invoke (JavaMethodWrapper.java:372)
  at com.facebook.react.bridge.JavaModuleWrapper.invoke (JavaModuleWrapper.java:146)
  at com.facebook.jni.NativeRunnable.run
  at android.os.Handler.handleCallback (Handler.java:959)
  at android.os.Handler.dispatchMessage (Handler.java:100)
  at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage (MessageQueueThreadHandler.kt:20)
  at android.os.Looper.loopOnce (Looper.java:257)
  at android.os.Looper.loop (Looper.java:342)
  at com.facebook.react.bridge.queue.MessageQueueThreadImpl$Companion.startNewBackgroundThread$lambda$1 (MessageQueueThreadImpl.kt:175)
  at com.facebook.react.bridge.queue.MessageQueueThreadImpl$Companion.$r8$lambda$ldnZnqelhYFctGaUKkOKYj5rxo4 (Unknown Source)
  at com.facebook.react.bridge.queue.MessageQueueThreadImpl$Companion$$ExternalSyntheticLambda0.run (D8$$SyntheticClass)
  at java.lang.Thread.run (Thread.java:1119)

Library version

1.0.1

Environment info

System:
  OS: macOS 15.7.1
  CPU: (12) arm64 Apple M3 Pro
  Memory: 724.00 MB / 36.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 22.18.0
    path: /Users/**/.nvm/versions/node/v22.18.0/bin/node
  Yarn: Not Found
  npm:
    version: 10.9.3
    path: /Users/**/.nvm/versions/node/v22.18.0/bin/npm
  Watchman:
    version: 2025.08.18.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods: Not Found
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.5
      - iOS 18.5
      - macOS 15.5
      - tvOS 18.5
      - visionOS 2.5
      - watchOS 11.5
  Android SDK: Not Found
IDEs:
  Android Studio: 2025.1 AI-251.26094.121.2513.14007798
  Xcode:
    version: 16.4/16F6
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.12
    path: /Users/**/.sdkman/candidates/java/current/bin/javac
  Ruby:
    version: 3.3.1
    path: /Users/**/.rvm/rubies/ruby-3.3.1/bin/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 18.0.1
    wanted: ^18.0.1
  react:
    installed: 19.0.0
    wanted: 19.0.0
  react-native:
    installed: 0.79.3
    wanted: 0.79.3
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false

info React Native v0.82.1 is now available (your project is running on v0.79.3).
info Changelog: https://github.com/facebook/react-native/releases/tag/v0.82.1
info Diff: https://react-native-community.github.io/upgrade-helper/?from=0.79.3&to=0.82.1
info For more info, check out "https://reactnative.dev/docs/upgrading?os=macos".

Steps to reproduce

Not sure, cannot reproduce myself. The crash is only happening on Android 15 - Samsung.

Reproducible sample code

await openBrowser(url!, {
        animationType: 'fade',
        dismissButtonStyle: 'close',
        barTintColor: '#FFF',
        controlTintColor,
      });

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions