-
Notifications
You must be signed in to change notification settings - Fork 536
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
Unable to activate instance of type Android.Util.SparseArray #4795
Comments
Cross-referencing note for the Xamarin team There is a matching Developer Community item reported against Xamarin.Android 10.3.99.259 (d16-7) in Visual Studio 2019 version 16.7 Preview 2: https://developercommunity.visualstudio.com/content/problem/1071004/vs-1670-preview-2-sparcearray-notsupportedexceptio.html |
@wuhuangjia can you attach a simple project which triggers the problem for you? Thanks! |
ok, will try to make a sample, thanks a lot |
should be the same issue |
Thanks for the note about the BarcodeScanner.XF sample app! I was able to reproduce the problem with that sample using the following steps:
Result: Shortly after the the new view opens and the screen starts showing an image from the camera, the app encounters the unhandled exception:
Notes: As JimmyPun610 found, this problem is fairly dependent on the particular set of assemblies and versions of assemblies used in an app, so in some cases, changing the target framework version of the app or updating NuGet packages might help avoid the issue, but it looks like this issue will need a fix in Xamarin.Android. Cross-referencing note for the Xamarin team: This issue might have same underlying cause as #4809. Version information:
The issue also occurs with Visual Studio 2019 version 16.7 Preview 2:
Testing device: arm64-v8a Android 9.0 Pie (API level 28) Google Pixel 3 |
One other result I should mention to be thorough is that like Although this additional result isn't especially helpful for the development scenario, it means there is a margin of safety for the final app publication scenario in the Release configuration. |
Status update A candidate fix for this issue has been added to the xamarin-android/d16-7 development branch in bb0f7eb. This change is not yet available in a published version. I will update this item again when a published version is available that includes the fix. Fix verification Fix verified. Using a development build that includes the fix, I retested the steps to reproduce from before. I verified that I could no longer reproduce the problem with the development version and confirmed that the problem reappeared if I switched back the current published versions of Xamarin.Android. Development build tested: Xamarin.Android SDK version 11.0.0.1 (d16-7@17cc49e) |
This problem happens to me ONLY after using a splash screen and moving Xamarin initializations to Splash activity, but disappeared when setting Linker Properties Linking to |
Release status update A new Preview version of Xamarin.Android has now been published that includes the fix for this item. The fix is not yet included in a Release version. I will update this again when a Release version is available that includes the fix. Fix included in Xamarin.Android 11.0.0.3. Fix included on Windows in Visual Studio 2019 version 16.7 Preview 4. To try the Preview version that includes the fix, check for the latest updates in Visual Studio Preview. Fix included on macOS in Visual Studio 2019 for Mac version 8.7 Preview 4. To try the Preview version that includes the fix, check for the latest updates on the Preview updater channel. |
Release status update A new Release version of Xamarin.Android has now been published that includes the fix for this issue. Fix included in Xamarin.Android SDK version 11.0.0.3. Fix included on Windows in Visual Studio 2019 version 16.7. To get the new version that includes the fix, check for the latest updates or install the most recent release from https://visualstudio.microsoft.com/downloads/. Fix included on macOS in Visual Studio 2019 for Mac version 8.7. To get the new version that includes the fix, check for the latest updates on the Stable updater channel. |
Steps to Reproduce
The text was updated successfully, but these errors were encountered: