0

I'm learning xamarin, and i have a problem, My app start up more than 9 sec in flagship phone (P30 pro). It start in MI a1 about 15 sec. In logcat i found a time intervall when noting happen.

How can i speed up boot time? I use aot, llvm, linker...

In profiler: (huawei P30) https://i.stack.imgur.com/AzXVi.png

07-29 13:43:44.615  Xiaomi Mi A1    Debug   11097   Mono    Loading reference 4 of /storage/emulated/0/Android/data/com.ME.alma/files/.__override__/Xamarin.Forms.Platform.Android.dll asmctx DEFAULT, looking for System.Core, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
07-29 13:43:44.615  Xiaomi Mi A1    Debug   11097   Mono    Requesting loading reference 4 (of 22) of /storage/emulated/0/Android/data/com.ME.alma/files/.__override__/Xamarin.Forms.Platform.Android.dll
07-29 13:43:44.599  Xiaomi Mi A1    Error   3142    ActivityTrigger activityResumeTrigger: not whiteListedcom.ME.alma/crc640afa5b30e7a96399.MainActivity/9
07-29 13:43:44.599  Xiaomi Mi A1    Debug   3142    ActivityTrigger activityResumeTrigger: The activity in ApplicationInfo{988ba77 com.ME.alma} is now in focus and seems to be in full-screen mode
07-29 13:43:44.593  Xiaomi Mi A1    Error   3142    ActivityTrigger activityResumeTrigger: not whiteListedcom.ME.alma/crc640afa5b30e7a96399.MainActivity/9
07-29 13:43:44.593  Xiaomi Mi A1    Debug   3142    ActivityTrigger activityResumeTrigger: The activity in ApplicationInfo{988ba77 com.ME.alma} is now in focus and seems to be in full-screen mode
07-29 13:43:44.592  Xiaomi Mi A1    Error   3142    ActivityTrigger activityStartTrigger: not whiteListedcom.ME.alma/crc640afa5b30e7a96399.MainActivity/9
07-29 13:43:44.592  Xiaomi Mi A1    Debug   3142    ActivityTrigger activityStartTrigger: Activity is Triggerred in full screen ApplicationInfo{988ba77 com.ME.alma}
07-29 13:43:44.586  Xiaomi Mi A1    Info    3142    ActivityManager START u0 {cmp=com.ME.alma/crc640afa5b30e7a96399.MainActivity} from uid 10099
07-29 13:43:36.615  Xiaomi Mi A1    Info    3142    ActivityManager Displayed com.ME.alma/crc640afa5b30e7a96399.SplashActivity: +1s663ms
07-29 13:43:36.505  Xiaomi Mi A1    Debug   11097   Mono    Loading reference 2 of /storage/emulated/0/Android/data/com.ME.alma/files/.__override__/Xamarin.Forms.Platform.Android.dll asmctx DEFAULT, looking for Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065
07-29 13:43:36.505  Xiaomi Mi A1    Debug   11097   Mono    Requesting loading reference 2 (of 22) of /storage/emulated/0/Android/data/com.ME.alma/files/.__override__/Xamarin.Forms.Platform.Android.dll
07-29 13:43:36.505  Xiaomi Mi A1    Debug   11097   Mono    Loading reference 0 of /storage/emulated/0/Android/data/com.ME.alma/files/.__override__/Xamarin.Forms.Platform.Android.dll asmctx DEFAULT, looking for mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
07-29 13:43:36.505  Xiaomi Mi A1    Debug   11097   Mono    Requesting loading reference 0 (of 22) of /storage/emulated/0/Android/data/com.ME.alma/files/.__override__/Xamarin.Forms.Platform.Android.dll
07-29 13:43:36.502  Xiaomi Mi A1    Debug   11097   Mono    Loading reference 0 of /storage/emulated/0/Android/data/com.ME.alma/files/.__override__/Xamarin.Forms.Core.dll asmctx DEFAULT, looking for netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
07-29 13:43:36.502  Xiaomi Mi A1    Debug   11097   Mono    Requesting loading reference 0 (of 3) of /storage/emulated/0/Android/data/com.ME.alma/files/.__override__/Xamarin.Forms.Core.dll
07-29 13:43:36.501  Xiaomi Mi A1    Debug   11097   Mono    Loading reference 1 of /storage/emulated/0/Android/data/com.ME.alma/files/.__override__/Xamarin.Forms.Platform.Android.dll asmctx DEFAULT, looking for Xamarin.Forms.Core, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null
07-29 13:43:36.501  Xiaomi Mi A1    Debug   11097   Mono    Requesting loading reference 1 (of 22) of /storage/emulated/0/Android/data/com.ME.alma/files/.__override__/Xamarin.Forms.Platform.Android.dll
07-29 13:43:36.501  Xiaomi Mi A1    Debug   11097   Mono    Loading reference 7 of /storage/emulated/0/Android/data/com.ME.alma/files/.__override__/Xamarin.Forms.Platform.Android.dll asmctx DEFAULT, looking for Xamarin.AndroidX.AppCompat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
07-29 13:43:36.501  Xiaomi Mi A1    Debug   11097   Mono    Requesting loading reference 7 (of 22) of /storage/emulated/0/Android/data/com.ME.alma/files/.__override__/Xamarin.Forms.Platform.Android.dll
07-29 13:43:36.500  Xiaomi Mi A1    Debug   11097   Mono    Loading reference 4 of /storage/emulated/0/Android/data/com.ME.alma/files/.__override__/alma.Android.dll asmctx DEFAULT, looking for Xamarin.Forms.Platform.Android, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null
07-29 13:43:36.500  Xiaomi Mi A1    Debug   11097   Mono    Requesting loading reference 4 (of 30) of /storage/emulated/0/Android/data/com.ME.alma/files/.__override__/alma.Android.dll```

gyb001
  • 19
  • 1
  • 4
  • it depends a lot on what you are doing at the startup as well, e.g. if you use reflection or initialize libraries that have long startup times. We'd need more information about what you are doing on the init part of the app like on your splash screen and the first view you present or if you use some framework like MvvmCross or Prism and you are setting up lots of stuff that could lead to that time – fmaccaroni Jul 29 '20 at 15:57
  • Have you tried Startup Tracing? Here's the article where it was announced https://devblogs.microsoft.com/xamarin/faster-startup-times-with-startup-tracing-on-android/ You can also Start without debugging. Also if enable "Shared Mono Runtime", it enables you to also enable "Fast Assembly Deployment" It should take that long, what is your linker behavior and AOT set at? – Saamer Aug 05 '20 at 05:31

0 Answers0