-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Release build of sample app fails when startup page replaced with simple NavigationPage (Android) #7214
Comments
Can confirm, happens in my app too. I added some error handling. Here is the stack trace of my app:
|
Great, thanks for checking. |
verified repro on android 11 using the above project with vs 17.3.0 Preview 2.0 [32515.5.main]. |
@kristinx0211 is there a workaround while waiting on an update? |
GA makes past the splash screen, but when I try to call |
I just installed the latest release of Visual Studio [17.3.0 Preview 1.1] this morning, and it appears the issue demonstrated in my repro project [https://github.com/hbraasch/PublishTester.git] has been resolved! |
Alright after an unholy amount of time spent trying to find the root cause I have found it along with a workaround... so here it goes. Lets have a <?xml version="1.0" encoding="utf-8" ?>
<base:ContentPageBase xmlns:base="clr-namespace:ERecept.MAUI.Views.Base"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:vm="clr-namespace:ERecept.Core.ViewModel;assembly=ERecept.Core"
xmlns:uc="clr-namespace:ERecept.MAUI.Views.UserControls"
x:Class="ERecept.MAUI.Views.Pages.UserInfoPage"
x:DataType="vm:UserInfoPageVM">
<Grid RowDefinitions="auto, *, auto">
<uc:BackNav/>
<uc:UserDetails Margin="8" BindingContext="{Binding UserDetails}" Grid.Row="1"/>
<Button Grid.Row="2" Text="Log Out" Command="{Binding LogOutCommand}"
BackgroundColor="{StaticResource DestructiveActionColor}"
Margin="16,0,16,32"/>
</Grid>
</base:ContentPageBase> The
<ContentView xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:vm="clr-namespace:ERecept.Core.ViewModel.Base;assembly=ERecept.Core"
x:Class="ERecept.MAUI.Views.UserControls.BackNav"
x:DataType="vm:MedicamentDetailVM">
<Grid ColumnDefinitions="auto, *" RowDefinitions="auto" BackgroundColor="{StaticResource PrimaryColor}" Padding="8">
<ImageButton Source="previous.png" Command="{Binding BackCommand}" HeightRequest="40" WidthRequest="40" Aspect="AspectFit"/>
<Label Grid.Column="1" TextColor="White" VerticalTextAlignment="Center" FontSize="20"
Text="{Binding NavText}"
Padding="16,0,0,0"/>
</Grid>
</ContentView> Again here note the The two classes are different but inherit from a common class public class ParametrizedBaseViewModel<T> : INotifyPropertyChanged {
public ICommand BackCommand { get; set; }
} Why is the
|
Just tested with the latest version of MAUI and this no longer happens. I think this happened around the time Google changed the ABI of some of the controls and broke things:
|
Description
When generating a new MAUI app from scratch, the Android [Release] build version fails to run. This happens if the startup page is changed from:
MainPage = new AppShell();
to:
MainPage = new NavigationPage(new StartupPage()) { BarBackgroundColor = Colors.Grey, BarTextColor = Colors.White};
The [StartupPage.cs] is extremely basic and should not be the problem.
When building as [Debug] both the unmodied and modified apps works fine.
When building as [Release], the unmodified app works fine, the modified one fails.
A reproduction project is supplied:
https://github.com/hbraasch/PublishTester.git
All works fine under iOS.
Steps to Reproduce
Load the reproduction app into VS.
Ensure inside [App.xaml.cs], the modification is commented out:
Create a release build and run the app. Observe it runs fine.
Ensure the modification is uncommented:
Version with bug
Release Candidate 3 (current)
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
Android 12 - API 31, Android 11 = API 30
Did you find any workaround?
None
Relevant log output
No response
The text was updated successfully, but these errors were encountered: