SignClient.initialize ANR
Describe the bug
An ANR occurs while initializing SignClient
SDK Version
- Client: Android BOM
- Version 1.4.1
To Reproduce Steps to reproduce the behaviour:
- Call
SignClient.initialize
Expected behaviour No ANR
Screenshots If applicable, add screenshots to help explain your problem.
Device (please complete the following information):

Additional context Stacktrace 1 Stacktrace 2
@ankudryavtsev Thanks for reporting this issue. Can you provide repro steps?
We call SignClient.initialize in Application.onCreate so all you need is to launch the app.
It's a production issue but I managed to reproduce it with ANRWatchDog with a small timeout.
Hey @ankudryavtsev we've created a PR with a potential fix. Could you fetch and check if it helps with your issue? We have been trying to repro but with no lack :)
Hello @jakubuid @TalhaAli00. We're experiencing the same issue on the same devices after calling SignClient.initialize
This issue has 329 ANR events affecting 141 users.
To confirm, because I didn't include the PR in the previous comment, did you try this solution: https://github.com/WalletConnect/WalletConnectKotlinV2/pull/675 ?
Our team had trouble with the reproduction.
- Can you share what app are we talking about?
- Can you share a code snippet of how you initialize lib? Or by any chance is your project open source?
- Is it happening only on Samsung devices?
We didn't try this solution: #675 because also can't reproduce it. We're getting issue notifications on Firebase in production only.
Is it happening only on Samsung devices?
No, it happened on other devices too.
Can you share a code snippet of how you initialize lib? Or by any chance is your project open source?
Yes, we initialize lib like this:
class WalletApplication : Application() {
companion object {
var wcLibraryIsInitialize: Boolean? = null
}
init {
setupBouncyCastle()
}
override fun onCreate() {
super.onCreate()
//initialization of other services
initWC()
}
private fun initWC() {
val serverUrl = "wss://${Constant.WCData.WALLET_CONNECT_URL}?projectId=${"wallet_connect_project_id"}"
val connectionType = ConnectionType.AUTOMATIC
try {
CoreClient.initialize(
relayServerUrl = serverUrl,
connectionType = connectionType,
application = this,
metaData = getAppMetaData()
) { throwable ->
when (throwable.throwable) {
is GenericException -> {
//do nothing
}
else -> {
wcLibraryIsInitialize = false
}
}
}
if (wcLibraryIsInitialize == null) {
SignClient.initialize(
Sign.Params.Init(core = CoreClient),
::onWCInitializeSuccess
) { _ ->
wcLibraryIsInitialize = false
}
}
} catch (exc: Exception) {
wcLibraryIsInitialize = false
exc.printStackTrace()
}
}
private fun onWCInitializeSuccess() {
wcLibraryIsInitialize = true
}
private fun getAppMetaData(): Core.Model.AppMetaData {
return Core.Model.AppMetaData(
name = "app",
description = "InitDescription",
url = "url",
icons = listOf("https://icon.svg/"),
redirect = "kotlin-wallet-wc:/request"
)
}
}
Can you share what app are we talking about?
LOBSTR wallet
@let-it-snow can you tell if this issue is still there? Did you upgrade to the newest SDK version by any chance? 🙏
@ankudryavtsev @let-it-snow what dependency injection framework do you use in your Android apps?