Xamarin.Forms.UWP crash in OnLaunched() Native Toolchain ON

When build-setting "Compile with .NET Native tool chain" is ON, I get the following exceptions in Xamarin.Forms.Forms.Init(e); in OnLaunched():

Exception thrown: 'System.IO.FileNotFoundException' in System.Private.Reflection.Core.dll
Additional information: Cannot load assembly 'ClrCompression'. No metadata found for this assembly.

Exception thrown: 'System.IO.FileNotFoundException' in System.Private.Reflection.Core.dll
Additional information: Cannot load assembly 'sqlite3'. No metadata found for this assembly.

Exception thrown: 'System.IO.FileNotFoundException' in System.Private.Reflection.Core.dll
Additional information: Cannot load assembly 'ucrtbased'. No metadata found for this assembly.

I can just continue and the app seems to run fine, but when the app is installed from AppStore, it just crashes.

Any ideas?

Tom

Best Answer

  • ThomasFlemmingThomasFlemming DE ✭✭
    Accepted Answer

    Its ok, problem is solved, don't know why, maybe an update from Xamarin or MS, but its fine now.

Answers

  • RaymondKellyRaymondKelly USMember ✭✭✭
    edited July 2016

    I just started getting the clrcompression failed to load as well and I dont know what I did to cause it. I tried rolling back XF and UWP core and still no luck. A new app seems ok and I cant find a difference.

  • SteffenMaucySteffenMaucy USMember ✭✭

    Got this error too and have no idea why. It's "a little bit" frustrating.

    Regards

    Steffen

  • RenaudLaloireRenaudLaloire BEUniversity ✭✭

    Has anybody found the problem yet ? I have exactly the same problem ... No clue what causes the problem but if I unselect "Compile with Native Tool Chain", it runs smoothly on the device ...

  • CraigDunnCraigDunn USXamarin Team Xamurai

    Not sure if related (the error message seems different) but if you have other components in your solution, check out this advice:

    https://developer.xamarin.com/guides/xamarin-forms/platform-features/windows/installation/universal/#Target_Invocation_Exception_when_using_Compile_with_.NET_Native_tool_chain

  • ThomasFlemmingThomasFlemming DEMember ✭✭

    Yes, I have several PCL in the project, some of them also referencing other PCLs.
    I tried this advise, but with no succed, but maybe I was doing it wrong.

  • RenaudLaloireRenaudLaloire BEUniversity ✭✭

    Me too I have tried what your are mentioning but I have a lot of third party components that I use in addition to several pcl projects on my own that are referencing other components. If at least, the debugger would tell me which class to register, I would maybe sort that out (even if the list of classes to register would be very very very long).

    That being said, the exception is 'System.IO.FileNotFoundException' in System.Private.Reflection.Core.dll and is not 'Target Invocation Exception' as mentioned in the link so I am not even sure we are talking about the same thing.

    Does anybody have a clue about where System.Private.Reflection.Core.dll is used ? Could it be linked to that bug : https://bugzilla.xamarin.com/show_bug.cgi?id=40743

    Is Xamarin aware about this issue ?

  • ThomasFlemmingThomasFlemming DEMember ✭✭
    edited September 2016

    @RenaudLaloire said:
    Is Xamarin aware about this issue ?

    I had several emails with support already, but the only answer is, that they want a project reproducing the issue. I can't provide that because of the complexity of our projects.

    Although Xamarin was taken over by Microsoft, there doesn't seem to be much interest in fixing bugs with UWP.
    There is even a lot more things in Xamarin.Forms.UWP long time reported but still unfixed.

    We gave up and stopped UWP-development in the meanwhile.
    We wasted too much time already.

    Tom

  • RenaudLaloireRenaudLaloire BEUniversity ✭✭

    Well it is very shame because my app works perfectly. I would publish my app right away if the store was not rejecting my package because of no native tool chain selected.

    I am sure Xamarin is working on it, how could it be different considering UWP is such a big one.

    What I don't understand though is why my app (and yours) is different from others regarding this issue. I must admit that the lack of communication from Xamarin is frustrating.

  • RenaudLaloireRenaudLaloire BEUniversity ✭✭

    @TheRealJasonSmith any idea why this is happening while enabling native tool chain compilation on UWP ?

  • Same problem here, cannot activate Native tool chain !

  • @ThomasFlemming said:

    @RenaudLaloire said:
    Is Xamarin aware about this issue ?

    I had several emails with support already, but the only answer is, that they want a project reproducing the issue. I can't provide that because of the complexity of our projects.

    Although Xamarin was taken over by Microsoft, there doesn't seem to be much interest in fixing bugs with UWP.
    There is even a lot more things in Xamarin.Forms.UWP long time reported but still unfixed.

    We gave up and stopped UWP-development in the meanwhile.
    We wasted too much time already.

    Tom

    I can provide a solution with that problem if needed ...

  • RenaudLaloireRenaudLaloire BEUniversity ✭✭

    Yes it is more than needed ;)

    @Jean-DanielGasser What did you find out ?

  • @ThomasFlemming Can you please provide me the e-mail address where I can send my code sample?

  • GroegGroeg ATMember ✭✭

    Any news?

  • GroegGroeg ATMember ✭✭

    I have created a bugzilla entry:
    https://bugzilla.xamarin.com/show_bug.cgi?id=51565

  • ThomasFlemmingThomasFlemming DEMember ✭✭

    For me this was solved after updating to Microsoft.NETCore.UniversalWindowsPlatform 5.2.2
    Don't use NETCore 5.3, unless you are using VS 2017 RC

  • GroegGroeg ATMember ✭✭

    I've already been using 5.2.2 but with VS 2017 RC --> tried upgrading to 5.3.0-beta2 with the same results - so going back to 5.2.2 again.
    But thanks anyway! :)
    IMHO the loading of the assemblies should be less fragile anyway... it could also be an optimization to be able to exclude some assemblies from being loaded into xamarin

  • ThomasFlemmingThomasFlemming DEMember ✭✭

    I'm using VS 2015, don't like betas, previews, RCs....

  • GroegGroeg ATMember ✭✭

    Actually solved it as well.
    I cloned my repository once more checked out now it works... seems to be some kind of IDE bug maybe?
    Deleting obj & bin folders didn't help, so somewhere some files must have broken the whole thing.
    Thanks for the help!

  • Jean-DanielGasserJean-DanielGasser CHMember ✭✭

    @ThomasFlemming Sorry for the delay,I had to work on another App. I'm now back to the one I can't run in release mode. Unfortunately I cannot send you the solution because my boss don't want it to be sent.

    I will try to solve the problem thanks to other comments in this thread and on Internet. I'll keep you inform if I find a solution.

  • ThomasFlemmingThomasFlemming DEMember ✭✭
    Accepted Answer

    Its ok, problem is solved, don't know why, maybe an update from Xamarin or MS, but its fine now.

Sign In or Register to comment.