0

I just made a class that can translate an Excel file into a list of C# objects. I am currently working on Xamarin.Android. All worked fine in debug mode, the file was opening correctly. But when I changed to release mode, it just crashes without any exception message, but only the stacktrace (that I don't understand :s)

I believe my permissions are correctly setup, I checked them in the application settings.

I tried with a Windows application, it works.

I tried to change the file's location, but nothing changed.

try
{
     book = new XSSFWorkbook(filePath.GetStream());
}
catch (Exception e) // Exception without message
{
    onResult(new SyncProductsSummary(false, 0, 0, e));
    return;
}

filePath.GetStream works just fine, I get the actual file size, and I also tried NOT using this, but by giving the filePath as string, nothing changed.

Here's the stacktrace I get: stacktrace

If the image doesn't work (I'm not sure how to use this): https://pasteboard.co/IgbV96W.jpg

  • 1
    try changing the linker settings for Release mode to "Don't LInk" or "Link Framework Only" – Jason May 24 '19 at 14:43
  • @Jason It worked changing the Link method to "dont link", but my APK is not 61Mo. I guess I should look into the answer below. Thank you – Jérémy Schaefer May 27 '19 at 06:21

1 Answers1

1

If it is working in the debug configuration, but not the release configuration, it is likely due to the linker settings. Like Jason mentioned, your release configuration may be trying to "Link All" which would require linker configuration for use. Try using one of the other two settings.

If you are unfamiliar, you can find these settings in your project build settings.

Xamarin Android Project Linker Settings

Garrett Manley
  • 337
  • 3
  • 11