title: MvvmCross Could not find a Setup class for application
body: <p>I have an Xamarin Forms Android Application with MvvmCross and I see several of these exceptions in my insights.</p>
  
  <p>When the app starts from scratch everything works fine. As far as I can tell this error happens, wenn the app is moved to hibernation and is started again.</p>
  
  <p>I have a SplashScreenActivity which defines the Setup class as follows:</p>
  
  <pre><code>MvxFormsSplashScreenActivity&lt;ApplicationSetup, CoreApp, App&gt;
  </code></pre>
  
  <p>In case it helps, the Project is open source and the code lies here: <a href="https://github.com/MoneyFox/MoneyFox" rel="nofollow noreferrer">https://github.com/MoneyFox/MoneyFox</a></p>
  
  <p>How can I fix that?</p>
  
  <p>Error:</p>
  
  <pre><code>Package: com.applysolutions.moneyfox
  Version Code: 2019099001
  Version Name: 5.1.2019099.001
  Android: 9
  Android Build: PQ2A.190405.003
  Manufacturer: Google
  Model: Pixel 3
  CrashReporter Key: c69e70df-a610-4112-be05-e3869f130474
  Date: undefined
  
  Xamarin Exception Stack:
  MvvmCross.Exceptions.MvxException: Failed to create setup instance
    at MvvmCross.Core.MvxSetupSingleton.CreateSetup () [0x00017] in &lt;5379a95ac98a4680b7bb47f5b716a158&gt;:0
    at MvvmCross.Core.MvxSetupSingleton.EnsureSingletonAvailable[TMvxSetupSingleton] () [0x00045] in &lt;5379a95ac98a4680b7bb47f5b716a158&gt;:0
    at MvvmCross.Platforms.Android.Core.MvxAndroidSetupSingleton.EnsureSingletonAvailable (Android.Content.Context applicationContext) [0x00000] in &lt;5379a95ac98a4680b7bb47f5b716a158&gt;:0
    at MvvmCross.Forms.Platforms.Android.Views.MvxFormsAppCompatActivity.OnCreate (Android.OS.Bundle bundle) [0x00006] in &lt;4ea0c9ab37e14fd8aa188ddf8fa8736e&gt;:0
    at MoneyFox.Droid.MainActivity.OnCreate (Android.OS.Bundle bundle) [0x00052] in &lt;2cfc40e7b7be4d839b84f168044b373f&gt;:0
    at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_savedInstanceState) [0x00011] in &lt;8ac02975c09144d5ae9c10aecc6be0c2&gt;:0
    at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.9(intptr,intptr,intptr)
  --- End of inner exception stack trace ---
    MvvmCross.Exceptions.MvxException: Could not find a Setup class for application
      at MvvmCross.Core.MvxSetupExtensions.CreateSetup[TSetup] () [0x00019] in &lt;5379a95ac98a4680b7bb47f5b716a158&gt;:0
      at MvvmCross.Core.MvxSetup.Instance () [0x00015] in &lt;5379a95ac98a4680b7bb47f5b716a158&gt;:0
      at MvvmCross.Core.MvxSetupSingleton.CreateSetup () [0x00000] in &lt;5379a95ac98a4680b7bb47f5b716a158&gt;:0
  
  Thread 2:
  0   dalvik.system.VMStack.getThreadStackTrace(VMStack.java:-2)
  1   java.lang.Thread.getStackTrace(Thread.java:1538)
  2   java.lang.Thread.getAllStackTraces(Thread.java:1588)
  3   com.microsoft.appcenter.crashes.Crashes.saveUncaughtException(Crashes.java:943)
  4   com.microsoft.appcenter.crashes.WrapperSdkExceptionManager.saveWrapperException(WrapperSdkExceptionManager.java:50)
  5   md5a0013181b845adff0c8407b475a96272.MainActivity.n_onCreate(MainActivity.java:-2)
  6   md5a0013181b845adff0c8407b475a96272.MainActivity.onCreate(MainActivity.java:30)
  7   android.app.Activity.performCreate(Activity.java:7144)
  8   android.app.Activity.performCreate(Activity.java:7135)
  9   android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
  10  android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2931)
  11  android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3086)
  12  android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
  13  android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
  14  android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
  15  android.app.ActivityThread$H.handleMessage(ActivityThread.java:1816)
  16  android.os.Handler.dispatchMessage(Handler.java:106)
  17  android.os.Looper.loop(Looper.java:193)
  18  android.app.ActivityThread.main(ActivityThread.java:6718)
  19  java.lang.reflect.Method.invoke(Method.java:-2)
  20  com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
  21  com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
  
  Thread 6698:
  0   java.lang.Object.wait(Object.java:-2)
  1   java.lang.Daemons$ReferenceQueueDaemon.runInternal(Daemons.java:178)
  2   java.lang.Daemons$Daemon.run(Daemons.java:103)
  3   java.lang.Thread.run(Thread.java:764)
  
  Thread 6699:
  0   java.lang.Object.wait(Object.java:-2)
  1   java.lang.Object.wait(Object.java:422)
  2   java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:188)
  3   java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:209)
  4   java.lang.Daemons$FinalizerDaemon.runInternal(Daemons.java:232)
  5   java.lang.Daemons$Daemon.run(Daemons.java:103)
  6   java.lang.Thread.run(Thread.java:764)
  
  Thread 6700:
  0   java.lang.Thread.sleep(Thread.java:-2)
  1   java.lang.Thread.sleep(Thread.java:373)
  2   java.lang.Thread.sleep(Thread.java:314)
  3   java.lang.Daemons$FinalizerWatchdogDaemon.sleepFor(Daemons.java:342)
  4   java.lang.Daemons$FinalizerWatchdogDaemon.waitForFinalization(Daemons.java:364)
  5   java.lang.Daemons$FinalizerWatchdogDaemon.runInternal(Daemons.java:281)
  6   java.lang.Daemons$Daemon.run(Daemons.java:103)
  7   java.lang.Thread.run(Thread.java:764)
  
  Thread 6707:
  0   android.os.MessageQueue.nativePollOnce(MessageQueue.java:-2)
  1   android.os.MessageQueue.next(MessageQueue.java:326)
  2   android.os.Looper.loop(Looper.java:160)
  3   android.os.HandlerThread.run(HandlerThread.java:65)
  
  Thread 6709:
  0   android.os.MessageQueue.nativePollOnce(MessageQueue.java:-2)
  1   android.os.MessageQueue.next(MessageQueue.java:326)
  2   android.os.Looper.loop(Looper.java:160)
  3   android.os.HandlerThread.run(HandlerThread.java:65)
  
  Thread 6710:
  0   android.os.MessageQueue.nativePollOnce(MessageQueue.java:-2)
  1   android.os.MessageQueue.next(MessageQueue.java:326)
  2   android.os.Looper.loop(Looper.java:160)
  3   android.os.HandlerThread.run(HandlerThread.java:65)
  </code></pre>
  
  <p>EDIT: I tried if it behaves differently, when I deactivate linking. But that didn't have an effect.</p>