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

Bug: CoinbaseWalletSDK .launch(intent) ActivityNotFoundException {org.toshi/org.toshi.MainActivity} #256

Open
kotoMJ opened this issue Sep 20, 2023 · 11 comments
Labels
type: bug Something isn't working

Comments

@kotoMJ
Copy link

kotoMJ commented Sep 20, 2023

Describe the bug

On some devices launching the intent (dat=cbwallet://wsegue/... pkg=org.toshi cmp=org.toshi/.MainActivity) obtained from CoinbaseWalletSDK.openIntent causes ActivityNotFoundException

Steps

  1. follow com.coinbase:coinbase-wallet-sdk:1.0.4 setup and ensure is added to queries in manifest
  2. initialize client CoinbaseWalletSDK
  3. when client is not connected call client.initiateHandshake
  4. this init will trigger openIntent callback on the CoinbaseWalletSDK client
  5. use compose activity launcher rememberLauncherForActivityResult and launch the given intent: coinbaseConnectLauncher.launch(intent)
  6. On some devices step 5 cause app failure with: android.content.ActivityNotFoundException: Unable to find explicit activity class {org.toshi/org.toshi.MainActivity}

Expected behavior

Since we are following CoinbaseWalletSDK setup https://github.com/coinbase/wallet-mobile-sdk/tree/master/android#setup there has to be 100% of devices starting the coinbase wallet app. But now for some reason some devices are failing to call it.

Failing devices:

  • Google Pixel 6 Pro, Android 13, Coinbase Wallet App 28.60.0
  • Samsung Galaxy A52s 5G - Android 13, One UI 5.1 - Coinbase Wallet App 28.60.0

Devices without any issue:*
Google Pixel 6 - Android 13 - Coinbase 28.60.0
Google Pixel 3 - Android 12 - Coinbase 28.59.0 (28.60.0)
Samsung A3 - Android 8 - Coinbase 28.60.0

Version

com.coinbase:coinbase-wallet-sdk:1.0.4

Additional info

android.content.ActivityNotFoundException: Unable to find explicit activity class {org.toshi/org.toshi.MainActivity}; have you declared this activity in your AndroidManifest.xml, or does your intent not match its declared <intent-filter>? at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:2171) at android.app.Instrumentation.execStartActivity(Instrumentation.java:1805) at android.app.Activity.startActivityForResult(Activity.java:5596) at androidx.activity.ComponentActivity.startActivityForResult(ComponentActivity.java:753) at androidx.core.app.ActivityCompat$Api16Impl.startActivityForResult(ActivityCompat.java:809) at androidx.core.app.ActivityCompat.startActivityForResult(ActivityCompat.java:246) at androidx.activity.ComponentActivity$2.onLaunch(ComponentActivity.java:258) at androidx.activity.result.ActivityResultRegistry$3.launch(ActivityResultRegistry.java:246) at androidx.activity.compose.ActivityResultLauncherHolder.launch(ActivityResultRegistry.kt:154) at androidx.activity.compose.ManagedActivityResultLauncher.launch(ActivityResultRegistry.kt:143) at androidx.activity.result.ActivityResultLauncher.launch(ActivityResultLauncher.java:47)

Desktop

No response

Smartphone

Failing devices:

  • Google Pixel 6, Android 13, Coinbase Wallet App 28.60.0
  • Samsung Galaxy A52s 5G - Android 13, One UI 5.1 - Coinbase Wallet App 28.60.0

Devices without any issue:*
Google Pixel 6 - Android 13 - Coinbase 28.60.0
Google Pixel 3 - Android 12 - Coinbase 28.59.0 (28.60.0)
Samsung A3 - Android 8 - Coinbase 28.60.0

@kotoMJ kotoMJ added the type: bug Something isn't working label Sep 20, 2023
@AmjadKhan2k18
Copy link

@kotoMJ I have same issue on Pixel 4, did you find any solution?

@kotoMJ
Copy link
Author

kotoMJ commented Oct 27, 2023

@AmjadKhan2k18 actually I have no solution so far. But I have found the issue on Samsung Galaxy A52s 5G where the problem was happening now just disappeared. There are many subtle changes in the app libraries and phone system update that was made, but one big change is we started targeting Android 14. This required some changes in using intents internally, and it also might have some fixes related to this issue. But actually I have no idea what exactly might fix this issue on that one particular device.

I will keep you guys posted here if also other devices previously having this issue are fixed with targeting Android 14 (and related libraries updates).

@kotoMJ
Copy link
Author

kotoMJ commented Oct 28, 2023

@AmjadKhan2k18 just confirmation from our QA department that also other devices originally crashing with above described issue are now working.
The main change is compile/target sdk version 34
Other small updates (not sure if they are worth mentioning, but...):

  • building on JavaVersion.VERSION_17
  • kotlin 1.8.21
  • agp 8.1.2

Anyway with mentioned updates, coinbase sdk version 1.0.4 and coinbase app wallet version 28.65 is the issue not occurring anymore.

@AmjadKhan2k18
Copy link

@kotoMJ Thanks for the update, I will update compile/target sdk to 34

@kotoMJ
Copy link
Author

kotoMJ commented Oct 29, 2023

Hope it helps to you too @AmjadKhan2k18 . Let us know if it helped so we can have kinda verified solution for this issue ;-)

@AmjadKhan2k18
Copy link

AmjadKhan2k18 commented Oct 30, 2023

@kotoMJ didn't worked for me I did the following

I have Coinbase wallet version 28.66
Google Pixel 4

sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
ext.kotlin_version = '1.8.21'
classpath 'com.android.tools.build:gradle:8.1.2'

kotlinOptions {
        jvmTarget = '1.8'
}

compile/target sdk 34

@AmjadKhan2k18
Copy link

I try to update java version to 17 but still didn't worked

sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17

jvmTarget = '17'

@kotoMJ
Copy link
Author

kotoMJ commented Nov 7, 2023

It's weird what might fix this issue on our app. Anyway I think I really occasionally still experienced this issue, but when I wanted to repro it, it was working well. I hope there will be someone else mapping this issue or the better someone from coinbase might explain what is going wrong here 🙏.

@AmjadKhan2k18
Copy link

@bangtoven It's been 3 months of this issue and there is no response from Coinbase team on this, do you guys have any clue what could be issue ? any solution for this ?

@bangtoven
Copy link
Member

sorry for the late response folks.
@fan-zhang-sv can you take a look please

@xemniz
Copy link

xemniz commented Nov 1, 2024

still have this from time to time, see it on our crashlytics 🥲

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants