Error when running in Release mode #2915
-
DescriptionHello i develop entire app with prism on MAUI, i use Prism.DryIoc.Maui Version 8.1.273-pre In debug mode the app runs nice, but in realse the app open then close automatic with erro bellow. Any hits? My startup code is
Steps to ReproduceCreate a app with version 8.1.273-pre Platform with bug.NET MAUI Affected platformsAndroid Did you find any workaround?No Relevant log output07-14 15:12:35.536 5839 5839 E AndroidRuntime: FATAL EXCEPTION: main
07-14 15:12:35.536 5839 5839 E AndroidRuntime: Process: *, PID: 5839
07-14 15:12:35.536 5839 5839 E AndroidRuntime: android.runtime.JavaProxyThrowable: System.NotImplementedException: Either set MainPage or override CreateWindow.
07-14 15:12:35.536 5839 5839 E AndroidRuntime: at Microsoft.Maui.Controls.Application.CreateWindow(IActivationState activationState)
07-14 15:12:35.536 5839 5839 E AndroidRuntime: at Microsoft.Maui.Controls.Application.Microsoft.Maui.IApplication.CreateWindow(IActivationState activationState)
07-14 15:12:35.536 5839 5839 E AndroidRuntime: at Microsoft.Maui.Platform.ApplicationExtensions.CreatePlatformWindow(Activity activity, IApplication application, Bundle savedInstanceState)
07-14 15:12:35.536 5839 5839 E AndroidRuntime: at Microsoft.Maui.MauiAppCompatActivity.OnCreate(Bundle savedInstanceState)
07-14 15:12:35.536 5839 5839 E AndroidRuntime: at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_(IntPtr jnienv, IntPtr native__this, IntPtr native_savedInstanceState)
07-14 15:12:35.536 5839 5839 E AndroidRuntime: at Android.Runtime.JNINativeWrapper.Wrap_JniMarshal_PPL_V(_JniMarshal_PPL_V callback, IntPtr jnienv, IntPtr klazz, IntPtr p0)
07-14 15:12:35.536 5839 5839 E AndroidRuntime: at crc6488302ad6e9e4df1a.MauiAppCompatActivity.n_onCreate(Native Method)
07-14 15:12:35.536 5839 5839 E AndroidRuntime: at crc6488302ad6e9e4df1a.MauiAppCompatActivity.onCreate(MauiAppCompatActivity.java:49)
07-14 15:12:35.536 5839 5839 E AndroidRuntime: at android.app.Activity.performCreate(Activity.java:8305)
07-14 15:12:35.536 5839 5839 E AndroidRuntime: at android.app.Activity.performCreate(Activity.java:8284)
07-14 15:12:35.536 5839 5839 E AndroidRuntime: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1417)
07-14 15:12:35.536 5839 5839 E AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3626)
07-14 15:12:35.536 5839 5839 E AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3782)
07-14 15:12:35.536 5839 5839 E AndroidRuntime: at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:101)
07-14 15:12:35.536 5839 5839 E AndroidRuntime: at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
07-14 15:12:35.536 5839 5839 E AndroidRuntime: at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
07-14 15:12:35.536 5839 5839 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2307)
07-14 15:12:35.536 5839 5839 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:106)
07-14 15:12:35.536 5839 5839 E AndroidRuntime: at android.os.Looper.loopOnce(Looper.java:201)
07-14 15:12:35.536 5839 5839 E AndroidRuntime: at android.os.Looper.loop(Looper.java:288)
07-14 15:12:35.536 5839 5839 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:7872)
07-14 15:12:35.536 5839 5839 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
07-14 15:12:35.536 5839 5839 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
07-14 15:12:35.536 5839 5839 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936) |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
If i override CreateWindow(IActivationState activationState) and add MainPage = new Startup(); the crash is:
R8 is disable |
Beta Was this translation helpful? Give feedback.
-
Try reverting override CreateWindow and instead inherit the main app in App.Xaml from PrismApplication
|
Beta Was this translation helpful? Give feedback.
-
The error message and the actual error are usually unrelated in my experience. It happens when something fails before or when navigating to the first page. I use something like this to log navigation errors:
|
Beta Was this translation helpful? Give feedback.
-
Sorry for the lack of example, However I discovered the problem, it was the XAML that had a color that did not exist. I found it by putting: MainPage = new Page() Putting it like that already gave me the description of the error. Thank you for your help |
Beta Was this translation helpful? Give feedback.
The error message and the actual error are usually unrelated in my experience. It happens when something fails before or when navigating to the first page.
I use something like this to log navigation errors: