MetaMask / metamask-android-sdk

MetaMask SDK for Android
Other
41 stars 13 forks source link

[Bug]: Demo crashes when clicking connect #98

Closed Leney closed 6 months ago

Leney commented 6 months ago

Provide environment information

After I run the demo and click Connect and other buttons, a crash occurs. When introduced as a Mave repository in my app, the same crash occurs using api connect. Can I only introduce it into my project as source code and then remove this judgment? WX20240229-001205@2x

MetaMask Android SDK Version

0.5.0

MetaMask Mobile app Version

v7.16.0

Android Version

Android 7.1.1 and Android 12

Describe the Bug

After I run the demo and click Connect and other buttons, a crash occurs. When introduced as a Mave repository in my app, the same crash occurs using api connect.

Expected Behavior

After I run the demo and click Connect and other buttons, a crash occurs. When introduced as a Mave repository in my app, the same crash occurs using api connect.

Link to reproduction - Issues with a link to complete (but minimal) reproduction code will be addressed faster

No response

To Reproduce

The code location where the exception occurred:io.metamask.androidsdk.CommunicationClient 2

@RequiresApi(Build.VERSION_CODES.TIRAMISU) private fun isQA(): Boolean { val packageManager = appContextRef.get()?.packageManager

    return try {
        packageManager?.getPackageInfo("io.metamask.qa", PackageManager.PackageInfoFlags.of(0))
        true
    } catch (e: PackageManager.NameNotFoundException) {
        false
    }
}
elefantel commented 6 months ago

Hi @Leney The SDK has targetSdk 33. I see you are on Android 12. We have mad a change to fix the crash in this MR. So the demo app should work fine now. We have not released a new version with this change though for now.

christopherferreira9 commented 6 months ago

Closing this issue for now. Please feel free to open a new issue if you encounter any other issues.

philos3 commented 5 months ago

any release version update ? it is still 0.5.0

elefantel commented 5 months ago

@philos3 0.5.1 fixes the issue, thanks!