Rotation issue on created project
DevonHansen opened this issue · 3 comments
When creating a new project using the wizard and running it with no alterations there seems to be a bug when rotating on an Android device.
You can rotate once, but when rotate back you get the following error:
System.NotSupportedException: 'Unable to activate instance of type Xamarin.Forms.Platform.Android.AppCompat.MasterDetailPageRenderer from native handle 0x79 (key_handle 0xe57b367).'
Setup:
- Master Detail application
- All test applications
- Android and iOS
- Visual Studio 2019
- Extension version: 1.3.0
Not an MVVM Cross issue by default, as have another template app setup from MVVM Cross directly but doesn't have the same issues.
@DevonHansen thanks for reporting this. I can confirm I'm able to replicate this crash when running the template generate project. Strangely this does not seem to occur when running from the template source code, so I'll need to track down what is causing the issue.
I think I may have found what it could be. In MainViewModel.cs that is generated "ShowDetailPageAsyncCommand" is using MvxAsyncCommand. I've found changing this back to a synchronous command instead seems to be fine. I'll check with a clean version (as currently done this on a modified version) and report back when I can.
The issue seems to be resolved in version 1.4.0 of the template with the latest Xamarin Forms builds. Let me know if you still experience the issue :)