jfversluis / FilePicker-Plugin-for-Xamarin-and-Windows

FilePicker Plugin for Xamarin and Windows
MIT License
157 stars 80 forks source link

NRE when selecting a file on some Android versions #143

Closed VitalyKnyazev closed 5 years ago

VitalyKnyazev commented 5 years ago

Expected Behavior

No crash, NuGet libs built using Release configuration

Actual Behavior

NRE crash as NiGet libs build using Debug configuration

Steps to Reproduce the Problem

  1. WindsongAOB device (apparently a Bot Device owned by Google playstore Review Team)
  2. NRE within FilePickerActivity.OnActivityResult when picking a file and probably cancelling

Specifications

vividos commented 5 years ago

I'm surprised by this, but you're right, the 2.1.-Versions contain the debug version of the assemblies (visible in ILspy).

@jfversluis Could you please check the Azure build steps if we're building Debug instead of Release?

I normally wouldn't expect that a call to System.Diagnostics.Debug.Write() would produce a NRE in a Release setting, but maybe the WindsongAOB device is very picky. File picking works for me on Android, tested on various devices.

jfversluis commented 5 years ago

Hm, oddly enough I didn’t specify a build configuration. So it might as well be that it builds the debug one by default. However I think that should originate from before 2.1.x. 🤔

Anyway, I have triggered a new build with the right configuration and that is on MyGet now. @VitalyKnyazev would you be able to try the latest version here: https://www.myget.org/F/filepicker-plugin/api/v3/index.json ?

vividos commented 5 years ago

I checked out the 2.1.31 build on MyGet by opening the Android 9.0 assembly with ILspy and it now has the [assembly: AssemblyConfiguration("release")] attribute and no calls to Debug.Write() in OnActivityResult. @VitalyKnyazev please test this, I think it fixes the bug you're getting. Otherwise it's a different problem all along.

vividos commented 5 years ago

@VitalyKnyazev could you please update to 2.1.32-beta and verify that the error doesn't appear in the App enter fatals anymore? Thanks!

DeerSteak commented 5 years ago

Pre-release fixed this issue for me on an ancient Moto Droid Turbo. Thanks all!

vividos commented 5 years ago

Closing this issue, as it seems to be fixed.