Skip to content

App crashing when trying to open scanner in release build #207

@hansAtLIS

Description

@hansAtLIS

Hello,
in the project of my company the app currently crashes when trying to open it.
This only happens when the app is build in the relase configuration but works like a charm in debug.
Do you have any idea how to implement the scanner in a different way to stop this behavior?
This is how its implemented as a popup:

<?xml version="1.0" encoding="utf-8" ?>
<local:BasePage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
                xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
                x:Class="App.Views.Popups.ScannerPopupPage"
                xmlns:zxing="clr-namespace:ZXing.Net.Maui.Controls;assembly=ZXing.Net.MAUI.Controls"
                xmlns:local="clr-namespace:App"
                xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
                xmlns:strings="clr-namespace:App.Resources.Strings"
                Title="{x:Static strings:AppResources.Scanner}">
  <Grid>
    <ContentView x:Name="BarcodeReaderContainer"
                 IsVisible="true">
      <zxing:CameraBarcodeReaderView x:Name="CameraBarcodeReader"
                                     BarcodesDetected="BarcodeDetected"
                                     VerticalOptions="FillAndExpand"
                                     HorizontalOptions="FillAndExpand" />
    </ContentView>


    <BoxView x:Name="UpperGrayedOutSection"
             Style="{StaticResource GrayedOutSection}"
             VerticalOptions="Start" />

    <BoxView x:Name="LowerGrayedOutSection"
             Style="{StaticResource GrayedOutSection}"
             VerticalOptions="End" />

    <BoxView x:Name="redline" IsVisible="true" Style="{StaticResource RedLine}"/>

    <Button x:Name="CloseButton" Style="{StaticResource CloseModalButtonStyle}"
            Clicked="OnCloseButtonClicked" />

    <Button x:Name="FlashlightButton" Style="{StaticResource FlashlightButtonStyle}"
            Clicked="OnFlashlightButtonClicked">

      <Button.ImageSource>
        <FileImageSource File="flashlight.png"></FileImageSource>
      </Button.ImageSource>

    </Button>

    <ImageButton Source="pause_icon"
                 IsVisible="False"
                 x:Name="PlayButton"
                 WidthRequest="100"
                 Clicked="PlayButton_Clicked" />

    <ContentView x:Name="AdditionaleContent"
                 VerticalOptions="End"
                 HorizontalOptions="StartAndExpand"
                 Margin="0,0,0,35" />

    <toolkit:MediaElement x:Name="beepPositive"
                          IsVisible="False"
                          Source="Resources/Sounds/BeepPositive.wav"/>
    <toolkit:MediaElement x:Name="beepNegative" 
                          IsVisible="False"
                          Source="Resources/Sounds/error-sound.wav"/>
  </Grid>

</local:BasePage>

I'll gladly provide additional info if needed.
Best regards,
Hans

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions