We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

System.NotSupportedException: Unable to activate instance of type Xamarin.Forms.Platform.Android.Platform

Hello,

On our xamarin forms mobile app we are using syncfusion controls and I have run into an issue that I cannot seem to solve / debug anything useful.

It was all working fine until I have just upgraded our syncfusion controls and xamarin packages on nuget to the very latest version of each - this was mainly so that I could get hold of the InputViewPadding on a SfTextInputLayout to reduce the padding because we are not using a hint or helper text and has un-neccesary padding when not using those.

I am running the following versions of packages:

Xamarin.Forms -> v3.6.0.344457
Xamarin.Essentials -> v1.1.0
Syncfusion.Xamarin.* -> v17.1.0.47 (all packages we are using are updated to this version)

Ive made sure every single xamarin package reference is updated to the latest version also.

So the issue:

We have a login screen which displays two SfTextInputLayout controls (username & password) and this shows as intended on our main "StartupPage" - when we login we hide the two controls on this page and show a loading animation - once its successful we then popup a SfPopup to select a team that user has access to. This then shows a ListView within an SfPopup on that screen so still no switching of main pages. The error happens when I select an item from that list which would in turn usually close down the SfPopup still showing the "StartupPage" loading symbol as before and then eventually load into the next page which would be our "TrackingPage".

I get the following error as soon as I press on an item in that list view on the SfPopup:

Unhandled Exception:

System.NotSupportedException: Unable to activate instance of type Xamarin.Forms.Platform.Android.Platform+DefaultRenderer from native handle 0xbee5bf0c (key_handle 0x399cff).

I can't seem to break on this exception even with the setting in visual studio set so cannot see the exact point of the problem, I have worked it as far as I can in my code and originally I thought it was maybe an issue with the page trying to change to another page - however this was working before the upgraded packages and also the SfPopup would hide after selecting an item and then it would wait a while until the next step was hit - so it seems like it is something related to the closure of the SfPopup or at least something at that stage which I cant seem to get through debug.

Do you have any thoughts on this issue at all or any enlightenment with the above exception?

Thanks in advance.

3 Replies

SP Subburaj Pandian Veluchamy Syncfusion Team May 20, 2019 12:12 PM UTC

Hi Luke, 
  
Thank you for contacting Syncfusion support. 
  
We have analyzed your query for the “Application is crashed when we select an item in SfListview which is loaded inside the SfpopupLayout” and it is working fine from our end. We have tested in the same version you have shared. We have attached the tested sample for you reference and you can download the same from the below link.  
  
  
Please provide following information to investigate the issue further, 
 
·       Code snippet of popup control and listview definition in your application. 
·       Call Stack for the exception. 
·       You have mentioned that application is crashed when we select an item in the listview, share the code snippet or action in the selection event and how you are closing popupview. 
  
If possible, please modify the attached sample to reproduce the issue which will be helpful for us to validate the issue and provide you the solution at earlier.  
  
Regards,
Subburaj Pandian V    



MA Mr Andrew Cope August 9, 2019 08:07 AM UTC

I have finally found the reason for this. It turns out we were trying to close a PopupLayout twice. This works without apparent harm with 16.x but blows with 17.x


SP Subburaj Pandian Veluchamy Syncfusion Team August 9, 2019 12:00 PM UTC

Hi Andrew,  
   
Thank you for update. 
 
We have checked the issue “Application is crashed while closing the popup twice” but could not able to replicate the issue at our end.  We have tried by navigating to popup page where the PopupView displays while opening the page. After selecting an item, the PopupView closes.  
 
 
Note: In the attached sample just enter any text in the username and password entry to login. 
 
Note: We have checked with the Xamarin.Forms v3.6.0.344457 and Syncfusion NuGet version v17.2.0.40 
 
To avoid further delay, we would to like to setup web-meeting, so created new incident under your account. Please follow-up with the incident for further updates. 
 
Regards,
Subburaj Pandian V  
 


Loader.
Live Chat Icon For mobile
Up arrow icon