Hey Team,
I was trying to build a MAUI Multi-Window App with Telerik listView project. It always crashed when ran on MAC , but it works on Windows.
Error Message: Terminating app due to uncaught exception 'NSObjectNotAvailableException', reason: 'UIAlertView is deprecated and unavailable for UIScene based applications, please use UIAlertController!'
I just setup multi-window with the instructions here: https://docs.microsoft.com/en-us/dotnet/maui/fundamentals/windows
But If I remove configuration( Info.plist and SceneDelegate.cs). then it works on Mac.
I attached a simple project.
MAUI: 6.0.312; DotNet SDK: 6.0.300; Telerik.UI.for.MAUI.trial 1.0.1
Is that any way to handle this issue?
And I'm also wondering is there any other component(s) have this issue?
Thanks
Allen
1 Answer, 1 is accepted
Hi Allen,
Thank you for the provided project. I have tried to run on my side but without a success, the solution cannot restore packages.
I have created a new project using the latest .NET Maui version and Telerik .NET MAUI 2.1.0 and I cannot reproduce the crash on mac.
I have attached my test project. The project has 2 pages. From the MainPage when pressing the Button it opens a new window(Page1) with RadListView control in it. Download the attached file and test on your side.
Let me know whether the issue can be reproduced in it. If yes, then send me the exact version of mac and visual studio for mac you use.
Regards,
Didi
Progress Telerik
Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.
Hey Didi,
I downloaded your project, And I didn't find SceneDelegate cs file under Maccatalyst folder.
Actually We are still working on Telerik 1.0.1 with MAUI 6.0.312(GA version). Could you please try on that? we do not run with Visual Studio. just build and run with command.
Let me know if you have any other questions.
Thanks
Allen
Hi Allen,
The SceneDelegate is added to the Mac folder inside the Program.cs file.
using ObjCRuntime;
using UIKit;
using Foundation;
namespace MWindow;
public class Program
{
// This is the main entry point of the application.
static void Main(string[] args)
{
// if you want to use a different Application Delegate class from "AppDelegate"
// you can specify it here.
UIApplication.Main(args, null, typeof(AppDelegate));
}
}
[Register("SceneDelegate")]
public class SceneDelegate : MauiUISceneDelegate
{
}
Did you test the attached project? Is it working on your side? I cannot test with Telerik 1.0.1 version and Maui 6.0.312 as I have updated my visual studio 2022 preview for mac with the latest .net maui workloads installed.
I suggest you use the latest versions of Maui and Telerik. In this way, you can use the latest features and improvements.
Could you please share what are the issue you have for updating the maui version?
There are new versions of Maui from the GA version and it is recommended to use latest versions of .NET Maui as well as Telerik versions. I constantly update my mac machine and development environment to use the latest features and improvements.
The issue may be related to the concrete version of Maui and Telerik as I cannot reproduce it with the latest versions.
An update for you, based on MAUI 400 + Telerik 2.0, your project crashed when we tried to run on Mac, will try on 408 +Telerik 2.1
Thanks
Allen
I am not sure why the app crashes on your machine. On my side, it works as expected. I have attached a video. I am using macOS Monterey 12.4 version. Please send me the error from the exception.
If the issue is on our side and we provide a fix for it - this fix cannot be included in the Telerik MAUI 1.0.1 version. The fix will be released in some of the upcoming versions above 2.1.0.
I asked my teams help to test it. all of them have same issue.
below is pervious error message
[16996:1196003] *** Terminating app due to uncaught exception 'NSObjectNotAvailableException', reason: 'UIAlertView is deprecated and unavailable for UIScene based applications, please use UIAlertController!'*** First throw call stack:
(
0 CoreFoundation 0x00007ff8022c07b3 __exceptionPreprocess + 242
1 libobjc.A.dylib 0x00007ff802020bc3 objc_exception_throw + 48
2 CoreFoundation 0x00007ff8022c061a +[NSException exceptionWithName:reason:userInfo:] + 0
3 UIKitCore 0x00007ff91050749b -[UIAlertView initWithFrame:] + 264
4 UIKitCore 0x00007ff910507abd -[UIAlertView initWithTitle:message:delegate:cancelButtonTitle:otherButtonTitles:] + 214
5 ************* 0x0000000102e28c14 -[TKDemoAlert init] + 276
6 ************* 0x0000000102e28adc __29+[TKDemoAlert sharedInstance]_block_invoke + 28
7 libdispatch.dylib 0x00007ff801fc7317 _dispatch_client_callout + 8
8 libdispatch.dylib 0x00007ff801fc84fa _dispatch_once_callout + 20
9 ************* 0x0000000102e28a9a +[TKDemoAlert sharedInstance] + 74
10 ************* 0x0000000102f54281 -[TKListView initWithFrame:] + 1665
11 UIKitCore 0x00007ff9102612e1 -[UIView init] + 44
12 libxamarin-dotnet.dylib 0x00000001034376bc xamarin_dyn_objc_msgSendSuper + 220
13 ??? 0x00000001102a62fa 0x0 + 4566180602
)
libc+abi: terminating with uncaught exception of type NSException
I have logged this error in our feedback portal on your behalf. https://feedback.telerik.com/maui/1573078-listview-maccatalyst-crash-on-multi-window-on-some-mac-machines Follow the item in order to receive an email notification when there is an update. I have escalated this error to the development team for further research.
From the attached video in my previous reply, you can see that I open a new window on a mac and the ListView is inside this window. There isn't a crash and the control behaves as expected.
I got a chance to test on MAUI workload 408 with Telerik 2.1.0, The crash issue still there.
And we can run app successfully, but when we click "click me" button, it crash.
You can see my highlight, when it tried to open SecondWindow, it crashed;
Thanks
Allen
Hi Allen,
Thank you for the provided images.
I have noticed the trial message and yes I reproduced the issue when using the trial Telerik .NET MAUI NuGet package. When testing with the licensed dlls, no issues, and no exceptions.
I assume the exception occurs because of the dialog which displays the trial message. It is a native control. I will escalate this to the development team.
Thank you for all the information and your patience on this case.
Hi Allen,
Yes, the native controls have the issue. The native trial message is displayed when using native controls.
I have updated the public item and included this information.
Hey Team,
Any update for issue?