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

SfPopupLayout - Java.Lang.IllegalArgumentException

I have a problem with reopening SfPopupLayout on Android (iOS is OK). After quick open and close popup several times in a row I get error: "Java.Lang.IllegalArgumentException: 'width and height must be > 0" 
Some devices work fine but some are witch error and application fall after reopening popup. (For example: Huawei P10 (android 9) - OK, Xiaomi, Redmi 4 (android 6) - ERROR, simulator (as attached picture)- ERROR). Please how to solve this problem? (I Attached notes with my codes).
Next question:
I can´t find a way how (and where) to write "try" "catch" in this case.

Thank you

Attachment: SfPopupLayoutCode_a215d768.zip

5 Replies

BS Balasubramani Sundaram Syncfusion Team October 22, 2019 10:03 AM

Hi Tomas,  
Thank you for contacting Syncfusion support.   
Based on your provided code snippet we have analyzed the issue “Java.Lang.IllegalArgumentException”. Due to the unavailability of the specified device as you have mentioned so we have checked the issue with similar device Huawei 9N and Redmi Note 4 in that we have performed a continues open and close the popup as much but we could not able to replicate the issue in our end. Meanwhile, we also configure the simulator as you have mentioned in the image to check the issue. 
Please refer the sample and video, 
Note: Issue has been checked with Xamarin. Forms version and Syncfusion NuGet version 
Please check the sample and let us know if you still facing the same issue? If not, please modify the sample based on your scenario and revert us with the more details, so that it will be helpful for us to check on it and provide you the solution at the earliest.    
Balasubramani Sundaram   

TT Tomas Turek October 31, 2019 05:51 AM

Thank you for your reply and sample.
Your provided code seems to be the same as mine.

Unfortunately, after a few more hours of investigation, I think that I found a place where the error occurs. In my project (on login page I call method to switch color theme mode of syncfusion component). I use your code from your documentation. If I switch theme on start app  -> then after quick open and close popup several times in a row I get error: "Java.Lang.IllegalArgumentException: 'width and height must be > 0" . I got this message from all opening popup (DataGrid row click, after Button click, ListView item click,....). 

I updated your sample (I place call method "ChooseThemeMode" into App).

How to solve it?

Attachment: Popup_Error_eb702099.zip

KK Karthikraja Kalaimani Syncfusion Team November 1, 2019 09:35 AM

Hi Tomas,

Thanks for the update. 
We have checked the attached sample and we can able to reproduce the reported issue “java.Lang.IllegalArgumentException : ‘Width and Height’ must be > 0 Exception occurs while opening the popup”  from our side. Currently, we are validating the issue in both sample and source level. We will update you the details on 4th November 2019.We appreciate your patience until then. 
Karthik Raja

KK Karthikraja Kalaimani Syncfusion Team November 4, 2019 07:52 AM

Hi Tomas,

Thanks for your patience.

We have checked the reported issue “java.Lang.IllegalArgumentException : ‘Width and Height’ must be > 0 Exception occurs while opening the popup” and we have logged the bug report the same. We will fix this issue and include the issue fix in our upcoming weekly nuget which is scheduled on 19th November 2019.  We appreciate your patience until then. 
You can also track the status of the report in below feedback link 

Karthik Raja 

KK Karthikraja Kalaimani Syncfusion Team November 19, 2019 04:05 AM

Hi Tomas, 
Thanks for your patience.      
We have fixed this issue “Java.Lang.IllegalArgumentException occurs while opening the popup when ShowCloseButton is false” and included in our Weekly NuGet, which is available for download now.   
Please let us know if you require further other assistance from us.   
Karthik Raja 

Live Chat Icon For mobile
Up arrow icon