Bug 59127 - com.google.maps.api.android.lib6.impl.ak cannot be cast to android.view.ViewGroup
Summary: com.google.maps.api.android.lib6.impl.ak cannot be cast to android.view.ViewG...
Status: RESOLVED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Android ()
Version: 2.4.0
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-08-30 20:50 UTC by Sevket Kizanlik
Modified: 2017-09-08 23:43 UTC (History)
2 users (show)

Tags: ac android pushmodal map tabbedpage
Is this bug a regression?: ---
Last known good build:


Attachments
Sample project (57.31 KB, application/zip)
2017-09-06 14:48 UTC, Sevket Kizanlik
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Sevket Kizanlik 2017-08-30 20:50:16 UTC
Here is the basic layout of the app:

MasterDetailPage
    Master
        ContentPage

    TabbedPage <- Detail
        Child1
        Child2
        ...
        Child5

------------------------

Child2:
ContentPage
    Grid
        XamarinFormsMaps


Detail:
TabbedPage
    Child1
    ...
    Child4


Problem:
========
Navigating to the Detail page via Navigation.PushModalAsync() method fires the exception below:

Java.Lang.ClassCastException
com.google.maps.api.android.lib6.impl.ak cannot be cast to android.view.ViewGroup

If I change the Detail from TabbedPage to ContentPage, navigation is successful. If I leave TabbedPage as Detail and comment out XamarinFormsPage, navigation is successful.
Comment 1 Jimmy [MSFT] 2017-09-05 17:21:06 UTC
I'm not sure I understand the navigation flow you are describing. Based on what you provided it sounds like you are using a TabbedPage and then you are pushing another TabbedPage with PushModalAsync(). Can you attach a minimal project that reproduces the issue so we can investigate further?

When providing the requested information, please set the report's status back to NEW otherwise we may close this issue after 30 days of no response. Thanks!
Comment 2 Sevket Kizanlik 2017-09-06 14:48:52 UTC
Created attachment 24602 [details]
Sample project

The drawer menu has two sections: TabbedPage and ContentPage. There is not any issue with ContentPage section. It is there for testing.

Steps to reproduce:

Open the drawer menu.
Click "Navigation.PushModalAsync()" <- the exception occurs

Now I noticed that if you click the buttons in this order, it works.

Click "NavigationPage.PushAsync()"  <- no exception
Click "Navigation.PushModalAsync()" <- no exception
Comment 3 Sevket Kizanlik 2017-09-06 14:50:29 UTC
Sample project attached.
Comment 4 Jimmy [MSFT] 2017-09-08 23:43:45 UTC
Thank you for providing that! I was able to reproduce the crash when using Xamarin.Forms 2.3.4.270. However I also tested with 2.4.0-pre2, which is available on NuGet as a pre-release, and the crash no longer occurs so this appears to be fixed already in the newer version.