Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

[XAML][REALDEVICE] Problems with JIT/AOT and ResourceDictionary

$
0
0

Hi all,

@JasonASmith@CraigDunn

Today I first deployed my app on a real iPhone. I knew I would have to fix some issues but I came across an issue that I didn't fully understand.

So I have this code almost in every XAML page :

  <OnPlatform x:Key="rowPadding" x:TypeArguments="Thickness">
    <OnPlatform.iOS>15, 0, 5, 0</OnPlatform.iOS>
    <OnPlatform.Android>5, 0, 5, 0</OnPlatform.Android>
  </OnPlatform>

  <OnPlatform x:Key="rowHeight" x:TypeArguments="x:Int32">
    <OnPlatform.iOS>44</OnPlatform.iOS>
    <OnPlatform.Android>44</OnPlatform.Android>
  </OnPlatform>

All well working in the iOS simulator but when run on the real device I get the following error (or similar depending on the type used) :

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ExecutionEngineException: Attempting to JIT compile method 'Xamarin.Forms.OnPlatform`1:.ctor ()' while running with --aot-only. See http://docs.xamarin.com/ios/about/limitations for more information.

Also I get this error when loading an Image Async from an URL that I specified in XAML. After researching the problem I found out why this was happening :

stackoverflow.com/questions/12837517/system-executionengineexception-attempting-to-jit-compile-method-only-in-debug

ehm.... so as stated in the answer :
"iOS devices do not allow JITting code (Apple's restriction) so AOT is used. The iOS simulator does not have this restriction, so the JIT is used (because it's a lot faster than AOTing code)."

So why doesn't the documentation talk about this issue ? And why hasn't anyone complained about it. Am I the first to test it on an actual device using XAML for all my pages ? Is there a workaround ?

Thanks in advance!


Viewing all articles
Browse latest Browse all 58056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>