Bug: CoinbaseWalletSDK .launch(intent) ActivityNotFoundException {org.toshi/org.toshi.MainActivity}
Opened this issue · 11 comments
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
- follow com.coinbase:coinbase-wallet-sdk:1.0.4 setup and ensure is added to queries in manifest
- initialize client CoinbaseWalletSDK
- when client is not connected call client.initiateHandshake
- this init will trigger openIntent callback on the CoinbaseWalletSDK client
- use compose activity launcher rememberLauncherForActivityResult and launch the given intent: coinbaseConnectLauncher.launch(intent)
- 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 I have same issue on Pixel 4, did you find any solution?
@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).
@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.
@kotoMJ Thanks for the update, I will update compile/target sdk to 34
Hope it helps to you too @AmjadKhan2k18 . Let us know if it helped so we can have kinda verified solution for this issue ;-)
@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
I try to update java version to 17 but still didn't worked
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
jvmTarget = '17'
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 🙏.
@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 ?
sorry for the late response folks.
@fan-zhang-sv can you take a look please
still have this from time to time, see it on our crashlytics 🥲