Respawnsive / Apizr

Refit based web api client management, but resilient (retry, connectivity, cache, auth, log, priority, etc...)
https://www.apizr.net
Apache License 2.0
140 stars 12 forks source link

Android crashes after "set to SDK and user assembly" #4

Closed dorisoy closed 3 years ago

dorisoy commented 4 years ago

Hi,JeremyBP !

I used apizr for production builds in my xamarin ,when linker setting: "AndroidLinkMode = SdkOnly" , an error occurred at runtime。

called ArgumentException --> services.UseApizrFor();

System.ArgumentException: 'Your Apizr manager class must inherit from IApizrManager generic interface or derived'

I think the apizr assembly should be removed by linker,do you provide preserve attribute , or falseflag to solve the issue ?

Jerome-Liger commented 4 years ago

Hi @dorisoy ! (I'm a collegue of @JeremyBP, he's on hollidays currently ;-) ) We may forgot some preserve attribute, but it's a "classic linker problem" for a lot of tiers-packages/methods to be removed unfortunatly by the linker...

To solve your issue quickly, you can add the Apizr assembly/methods on a "LinkDescription.xml" file (Android & iOS if needed) to preserve it : [https://docs.microsoft.com/en-us/xamarin/cross-platform/deploy-test/linker]

I hope this can help you, and when Jeremy will come back, he will watch on this "preserve" attribute, and get back to you.

JeremyBP commented 3 years ago

Thanks for reporting this issue. Preserve attribute added and LinkDescription.xml works great to