Forum Xamarin.Android

Announcement:

The Xamarin Forums have officially moved to the new Microsoft Q&A experience. Microsoft Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

To create new threads and ask questions head over to Microsoft Q&A for .NET and get involved today.

Different behavior in release and debug mode in xamarin forms app

I create an cross platform application. when run project in debug mode and click on login button it work correctly ,but when i set in release mode and click on login button get my error message this is my Login xaml

i had the same problem in last project I and it made me create it again but i have the same error

<ContentPage.Content>











</ContentPage.Content>

this is my login.xaml.cs

[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class LoginPage : ContentPage
{
public LoginPage()
{
var vm = new LoginViewModel( Navigation);
this.BindingContext = vm;
vm.DisplayInvalidLoginPrompt += () => DisplayAlert("Error", "Invalid Login, try again", "OK");

    InitializeComponent();

    Email.Completed += (object sender, EventArgs e) =>
    {
        Password.Focus();
    };

    Password.Completed += (object sender, EventArgs e) =>
    {
        vm.SubmitCommand.Execute(null);
    };
}

}

I create an cross platform application. when run project in debug mode and click on login button it work correctly ,but when i set in release mode and click on login button get my error message this is my Login xaml

<ContentPage.Content>











</ContentPage.Content>
this is my login.xaml.cs

[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class LoginPage : ContentPage
{
public LoginPage()
{
var vm = new LoginViewModel( Navigation);
this.BindingContext = vm;
vm.DisplayInvalidLoginPrompt += () => DisplayAlert("Error", "Invalid Login, try again", "OK");

    InitializeComponent();

    Email.Completed += (object sender, EventArgs e) =>
    {
        Password.Focus();
    };

    Password.Completed += (object sender, EventArgs e) =>
    {
        vm.SubmitCommand.Execute(null);
    };
}

}
] Use mvvm pattern and this is my mvvm

public class LoginViewModel : INotifyPropertyChanged
{
public Action DisplayInvalidLoginPrompt;
public event PropertyChangedEventHandler PropertyChanged = delegate { };

public INavigation Navigation { get; set; }
private string email;
public string Email
{
    get { return email; }
    set
    {
        email = value;
        PropertyChanged(this, new PropertyChangedEventArgs("Email"));
    }
}
private string password;
public string Password
{
    get { return password; }
    set
    {
        password = value;
        PropertyChanged(this, new PropertyChangedEventArgs("Password"));
    }
}
public ICommand SubmitCommand { protected set; get; }
//public LoginViewModel(INavigation navigation)
//{
//    SubmitCommand = new Command(OnSubmit);
//}
public LoginViewModel(INavigation navigation)
{
    this.Navigation = navigation;
    SubmitCommand = new Command(async ()=>await OnSubmitAsync());
}
public async Task OnSubmitAsync()
{
    if (email != "s" || password != "s")
    {
        DisplayInvalidLoginPrompt();
    }
    else
    {
       await Navigation.PushAsync(new HomePage());
    }
}

In release mode or after install in real phone, When I type "s" and "s" (without quotation marks) it will show my error message("Invalid Login, try agai") but in debug mode it work fine.

this is "debug log logcat" in release

Time Device Name Type PID Tag Message
07-19 13:35:20.891 pixel_2_pie_9_0_-api_28 Info 25264 GoogleInputMethod onFinishInput() : Dummy InputConnection bound
07-19 13:35:20.914 pixel_2_pie_9_0
-api_28 Warning 25264 Conv2QueryExtension Conv2Query not enabled due to current app [ir.sunn.emsbase] not in whitelist
07-19 13:35:20.913 pixel_2_pie_9_0
-api_28 Info 25264 Conv2QueryExtension Current locale: en_US, config allows these locales: de,en,fr,it,es,pt
07-19 13:35:20.912 pixel_2_pie_9_0
-api_28 Info 25264 Conv2QueryExtension isEnabled() : true
07-19 13:35:20.912 pixel_2_pie_9_0
-api_28 Info 25264 EmojiSuperpacksFeature Emoji superpacks enabled
07-19 13:35:20.912 pixel_2_pie_9_0
-api_28 Info 25264 EmojiDataExtension onActivate() : Locale = en_US
07-19 13:35:20.912 pixel_2_pie_9_0
-api_28 Info 25264 DevFeatureConfig Gif candidate disabled by Phenotype
07-19 13:35:20.912 pixel_2_pie_9_0
-api_28 Info 25264 GifEntryExtension onActivate()
07-19 13:35:20.905 pixel_2_pie_9_0
-api_28 Debug 17925 EGL_emulation eglMakeCurrent: 0xebc853c0: ver 2 0 (tinfo 0xebc836f0)
07-19 13:35:20.900 pixel_2_pie_9_0
-api_28 Warning 25264 VoiceImeTranscriptor UIME feature enabled: false
07-19 13:35:20.893 pixel_2_pie_9_0
-api_28 Info 25264 GoogleInputMethod onStartInputView() : Dummy InputConnection bound
07-19 13:35:20.891 pixel_2_pie_9_0
-api_28 Info 25264 GoogleInputMethod onStartInput() : Dummy InputConnection bound
07-19 13:35:20.889 pixel_2_pie_9_0
-api_28 Info 25264 PhenotypeExpConfig refreshConfiguration() : Force = false : UpdateAvailable = false : Age = 62 minutes : MaxAge = 720 minutes
07-19 13:35:20.889 pixel_2_pie_9_0
-api_28 Info 25264 GoogleInputMethod onFinishInputView() : Dummy InputConnection bound
07-19 13:35:20.888 pixel_2_pie_9_0
-api_28 Warning 17925 monodroid-assembly typemap: module matching MVID [CAD0FB41-A72A-4345-B6B8-DAF8486E8A76] not found.
07-19 13:35:20.869 pixel_2_pie_9_0
-api_28 Info 25132 GnssLocationProvider WakeLock released by handleMessage(REPORT_SV_STATUS, 0, [email protected]31831)
07-19 13:35:20.868 pixel_2_pie_9_0
-api_28 Info 25132 GnssLocationProvider WakeLock acquired by sendMessage(REPORT_SV_STATUS, 0, [email protected]31831)
07-19 13:35:20.865 pixel_2_pie_9_0
-api_28 Debug 17925 OpenGLRenderer endAllActiveAnimators on 0xcd2ec200 (RippleDrawable) with handle 0xebc83770
07-19 13:35:20.860 pixel_2_pie_9_0
-api_28 Debug 17925 EGL_emulation eglMakeCurrent: 0xebc853c0: ver 2 0 (tinfo 0xebc836f0)
07-19 13:35:20.823 pixel_2_pie_9_0
-api_28 Debug 17925 EGL_emulation eglMakeCurrent: 0xebc853c0: ver 2 0 (tinfo 0xebc836f0)
07-19 13:35:19.919 pixel_2_pie_9_0
-api_28 Warning 17925 monodroid-assembly typemap: module matching MVID [CAD0FB41-A72A-4345-B6B8-DAF8486E8A76] not found.
07-19 13:35:19.892 pixel_2_pie_9_0
-api_28 Debug 17925 EGL_emulation eglMakeCurrent: 0xebc853c0: ver 2 0 (tinfo 0xebc836f0)
07-19 13:35:19.874 pixel_2_pie_9_0
-api_28 Info 25132 GnssLocationProvider WakeLock released by handleMessage(REPORT_SV_STATUS, 0, [email protected]71dec)
07-19 13:35:19.870 pixel_2_pie_9_0
-api_28 Warning 17925 monodroid-assembly typemap: module matching MVID [CAD0FB41-A72A-4345-B6B8-DAF8486E8A76] not found.
07-19 13:35:19.868 pixel_2_pie_9_0
-api_28 Debug 17925 EGL_emulation eglMakeCurrent: 0xebc853c0: ver 2 0 (tinfo 0xebc836f0)
07-19 13:35:19.867 pixel_2_pie_9_0
-api_28 Info 25132 GnssLocationProvider WakeLock acquired by sendMessage(REPORT_SV_STATUS, 0, [email protected]71dec)
07-19 13:35:19.841 pixel_2_pie_9_0
-api_28 Warning 17925 monodroid-assembly typemap: module matching MVID [CAD0FB41-A72A-4345-B6B8-DAF8486E8A76] not found.
07-19 13:35:19.838 pixel_2_pie_9_0
-api_28 Warning 17925 monodroid-assembly typemap: module matching MVID [CAD0FB41-A72A-4345-B6B8-DAF8486E8A76] not found.
07-19 13:35:19.818 pixel_2_pie_9_0
-api_28 Debug 17925 EGL_emulation eglMakeCurrent: 0xebc853c0: ver 2 0 (tinfo 0xebc836f0)
07-19 13:35:19.793 pixel_2_pie_9_0
-api_28 Debug 17925 EGL_emulation eglMakeCurrent: 0xebc853c0: ver 2 0 (tinfo 0xebc836f0)
07-19 13:35:19.663 pixel_2_pie_9_0
-api_28 Debug 1652 gralloc_ranchu gralloc_alloc: Creating ashmem region of size 3174400
07-19 13:35:19.655 pixel_2_pie_9_0
-api_28 Debug 1652 gralloc_ranchu gralloc_alloc: Creating ashmem region of size 3174400
07-19 13:35:19.643 pixel_2_pie_9_0
-api_28 Debug 1652 gralloc_ranchu gralloc_alloc: Creating ashmem region of size 3174400
07-19 13:35:19.583 pixel_2_pie_9_0
-api_28 Warning 17925 monodroid-assembly typemap: module matching MVID [CAD0FB41-A72A-4345-B6B8-DAF8486E8A76] not found.
07-19 13:35:19.580 pixel_2_pie_9_0
-api_28 Info 17925 chatty uid=10097(ir.sunn.emsbase) identical 7 lines
07-19 13:35:19.455 pixel_2_pie_9_0
-api_28 Warning 17925 monodroid-assembly typemap: module matching MVID [CAD0FB41-A72A-4345-B6B8-DAF8486E8A76] not found.
07-19 13:35:18.870 pixel_2_pie_9_0
-api_28 Info 25132 GnssLocationProvider WakeLock released by handleMessage(REPORT_SV_STATUS, 0, [email protected]923fd)
07-19 13:35:18.868 pixel_2_pie_9_0
-api_28 Info 25132 GnssLocationProvider WakeLock acquired by sendMessage(REPORT_SV_STATUS, 0, [email protected]923fd)
07-19 13:35:18.255 pixel_2_pie_9_0
-api_28 Warning 17925 monodroid-assembly typemap: module matching MVID [CAD0FB41-A72A-4345-B6B8-DAF8486E8A76] not found.
07-19 13:35:18.190 pixel_2_pie_9_0
-api_28 Warning 17925 monodroid-assembly typemap: module matching MVID [CAD0FB41-A72A-4345-B6B8-DAF8486E8A76] not found.
07-19 13:35:18.187 pixel_2_pie_9_0
-api_28 Info 25264 FeaturePermissions onSharedPreferenceChanged() : Key = latest_activation_time : Feature = null
07-19 13:35:18.171 pixel_2_pie_9_0
-api_28 Info 25264 PrimesMetrics Ignore memory metric of com.google.android.apps.inputmethod.libs.pill.PillExtension.
07-19 13:35:18.171 pixel_2_pie_9_0
-api_28 Info 25264 PrimesMetrics Ignore memory metric of com.google.android.apps.inputmethod.libs.search.nativecard.FeatureCardNoticeExtension.
07-19 13:35:18.171 pixel_2_pie_9_0
-api_28 Info 25264 VoiceImeExtension Voice Extension onStartInputView() Mic status = [MicIconAvailable]
07-19 13:35:18.171 pixel_2_pie_9_0
-api_28 Warning 25264 VoiceImeTranscriptor UIME feature enabled: false
07-19 13:35:18.171 pixel_2_pie_9_0
-api_28 Info 25264 FeatureCardNotice Feature card notice not shown: no cards to display
07-19 13:35:18.171 pixel_2_pie_9_0
-api_28 Info 25264 FeatureCardGenerator Autospace card not added
07-19 13:35:18.168 pixel_2_pie_9_0
-api_28 Info 25264 PrimesMetrics Ignore memory metric of com.google.android.apps.inputmethod.libs.search.gif.GifEntryPointCandidateExtension.
07-19 13:35:18.168 pixel_2_pie_9_0
-api_28 Info 25264 FeatureCardGenerator Make a GIF card not added
07-19 13:35:18.168 pixel_2_pie_9_0
-api_28 Warning 25264 Conv2QueryExtension onActivate() : Disabled by unsupported host app
07-19 13:35:18.167 pixel_2_pie_9_0
-api_28 Warning 25264 Conv2QueryExtension Conv2Query not enabled due to current app [ir.sunn.emsbase] not in whitelist
07-19 13:35:18.167 pixel_2_pie_9_0
-api_28 Info 25264 Conv2QueryExtension Current locale: en_US, config allows these locales: de,en,fr,it,es,pt
07-19 13:35:18.167 pixel_2_pie_9_0
-api_28 Info 25264 Conv2QueryExtension isEnabled() : true
07-19 13:35:18.167 pixel_2_pie_9_0
-api_28 Info 25264 EmojiSuperpacksFeature Emoji superpacks enabled
07-19 13:35:18.167 pixel_2_pie_9_0
-api_28 Info 25264 EmojiDataExtension onActivate() : Locale = en_US
07-19 13:35:18.167 pixel_2_pie_9_0
-api_28 Warning 17925 monodroid-assembly typemap: module matching MVID [CAD0FB41-A72A-4345-B6B8-DAF8486E8A76] not found.
07-19 13:35:18.167 pixel_2_pie_9_0
-api_28 Info 25264 DevFeatureConfig Gif candidate disabled by Phenotype
07-19 13:35:18.167 pixel_2_pie_9_0
-api_28 Info 25264 GifEntryExtension onActivate()
07-19 13:35:18.158 pixel_2_pie_9_0
-api_28 Warning 25264 VoiceImeTranscriptor UIME feature enabled: false
07-19 13:35:18.155 pixel_2_pie_9_0
-api_28 Info 25264 GoogleInputMethod onStartInputView() : Dummy InputConnection bound
07-19 13:35:18.154 pixel_2_pie_9_0
-api_28 Info 25264 GoogleInputMethod onStartInput() : Dummy InputConnection bound
07-19 13:35:18.154 pixel_2_pie_9_0
-api_28 Warning 17925 monodroid-assembly typemap: module matching MVID [CAD0FB41-A72A-4345-B6B8-DAF8486E8A76] not found.
07-19 13:35:18.153 pixel_2_pie_9_0
-api_28 Info 25264 PhenotypeExpConfig refreshConfiguration() : Force = false : UpdateAvailable = false : Age = 62 minutes : MaxAge = 720 minutes
07-19 13:35:18.134 pixel_2_pie_9_0
-api_28 Warning 17925 monodroid-assembly typemap: module matching MVID [CAD0FB41-A72A-4345-B6B8-DAF8486E8A76] not found.
07-19 13:35:18.048 pixel_2_pie_9_0
-api_28 Warning 17925 monodroid-assembly typemap: module matching MVID [CAD0FB41-A72A-4345-B6B8-DAF8486E8A76] not found.
07-19 13:35:18.030 pixel_2_pie_9_0
-api_28 Info 17925 mono-stdout Binding: 'Password' property not found on 'EmsBase.ViewModels.LoginViewModel', target property: 'Xamarin.Forms.Entry.Text'
07-19 13:35:17.871 pixel_2_pie_9_0
-api_28 Info 25132 GnssLocationProvider WakeLock released by handleMessage(REPORT_SV_STATUS, 0, [email protected]f5ba7)
07-19 13:35:17.869 pixel_2_pie_9_0
-api_28 Info 25132 GnssLocationProvider WakeLock acquired by sendMessage(REPORT_SV_STATUS, 0, [email protected]f5ba7)
07-19 13:35:17.626 pixel_2_pie_9_0
-api_28 Info 25264 FeaturePermissions onSharedPreferenceChanged() : Key = latest_activation_time : Feature = null
07-19 13:35:17.612 pixel_2_pie_9_0
-api_28 Info 25264 VoiceImeExtension Voice Extension onStartInputView() Mic status = [MicIconHidden-PasswordOrNumberOrDateInputType, ]
07-19 13:35:17.540 pixel_2_pie_9_0
-api_28 Warning 25264 VoiceImeTranscriptor UIME feature enabled: false
07-19 13:35:17.540 pixel_2_pie_9_0
-api_28 Info 25264 PrimesMetrics Ignore memory metric of com.google.android.apps.inputmethod.libs.pill.PillExtension.
07-19 13:35:17.539 pixel_2_pie_9_0
-api_28 Info 25264 PrimesMetrics Ignore memory metric of com.google.android.apps.inputmethod.libs.search.nativecard.FeatureCardNoticeExtension.
07-19 13:35:17.539 pixel_2_pie_9_0
-api_28 Info 25264 FeatureCardNotice Feature card notice not shown: no cards to display
07-19 13:35:17.539 pixel_2_pie_9_0
-api_28 Info 25264 FeatureCardGenerator Autospace card not added
07-19 13:35:17.539 pixel_2_pie_9_0
-api_28 Info 25264 FeatureCardGenerator Make a GIF card not added
07-19 13:35:17.538 pixel_2_pie_9_0
-api_28 Warning 25264 Conv2QueryExtension onActivate() : Disabled by unsupported host app
07-19 13:35:17.538 pixel_2_pie_9_0
-api_28 Warning 25264 Conv2QueryExtension Conv2Query not enabled due to current app [ir.sunn.emsbase] not in whitelist
07-19 13:35:17.537 pixel_2_pie_9_0
-api_28 Info 25264 Conv2QueryExtension Current locale: en_US, config allows these locales: de,en,fr,it,es,pt
07-19 13:35:17.537 pixel_2_pie_9_0
-api_28 Info 25264 Conv2QueryExtension isEnabled() : true
07-19 13:35:17.535 pixel_2_pie_9_0
-api_28 Info 25264 EmojiSuperpacksFeature Emoji superpacks enabled
07-19 13:35:17.535 pixel_2_pie_9_0
-api_28 Info 25264 EmojiDataExtension onActivate() : Locale = en_US
07-19 13:35:17.532 pixel_2_pie_9_0
-api_28 Info 25264 PrimesMetrics Ignore memory metric of com.google.android.apps.inputmethod.libs.search.gif.GifEntryPointCandidateExtension.
07-19 13:35:17.531 pixel_2_pie_9_0
-api_28 Info 25264 DevFeatureConfig Gif candidate disabled by Phenotype
07-19 13:35:17.531 pixel_2_pie_9_0
-api_28 Info 25264 GifEntryExtension onActivate()
07-19 13:35:17.527 pixel_2_pie_9_0
-api_28 Warning 17925 monodroid-assembly typemap: module matching MVID [CAD0FB41-A72A-4345-B6B8-DAF8486E8A76] not found.
07-19 13:35:17.519 pixel_2_pie_9_0
-api_28 Info 25264 DlamWrapper close(): Successfully wrote DLAM properties file.
07-19 13:35:17.514 pixel_2_pie_9_0
-api_28 Info 25264 LatinIme onDeactivate()
07-19 13:35:17.514 pixel_2_pie_9_0
-api_28 Info 25264 Delight5Decoder abortComposing() : input state id = 401
07-19 13:35:17.513 pixel_2_pie_9_0
-api_28 Info 25264 LatinIme abortComposing()
07-19 13:35:17.512 pixel_2_pie_9_0
-api_28 Info 25264 PhenotypeExpConfig refreshConfiguration() : Force = false : UpdateAvailable = false : Age = 62 minutes : MaxAge = 720 minutes
07-19 13:35:17.509 pixel_2_pie_9_0
-api_28 Warning 25085 audio_hw_generic Not supplying enough data to HAL, expected position 33246355 , only wrote 33246000
07-19 13:35:17.366 pixel_2_pie_9_0
-api_28 Warning 17925 monodroid-assembly typemap: module matching MVID [CAD0FB41-A72A-4345-B6B8-DAF8486E8A76] not found.
07-19 13:35:17.331 pixel_2_pie_9_0
-api_28 Info 17925 mono-stdout Binding: 'Email' property not found on 'EmsBase.ViewModels.LoginViewModel', target property: 'Xamarin.Forms.Entry.Text'
07-19 13:35:16.868 pixel_2_pie_9_0
-api_28 Info 25132 GnssLocationProvider WakeLock released by handleMessage(REPORT_SV_STATUS, 0, [email protected]5adcb)
07-19 13:35:16.867 pixel_2_pie_9_0
-api_28 Info 25132 GnssLocationProvider WakeLock acquired by sendMessage(REPORT_SV_STATUS, 0, [email protected]5adcb)
07-19 13:35:15.870 pixel_2_pie_9_0
-api_28 Info 25132 GnssLocationProvider WakeLock released by handleMessage(REPORT_SV_STATUS, 0, com.android.server.location.GnssLocationProvider$[email protected])
07-19 13:35:15.868 pixel_2_pie_9_0
-api_28 Info 25132 GnssLocationProvider WakeLock acquired by sendMessage(REPORT_SV_STATUS, 0, [email protected]1909a)
07-19 13:35:14.869 pixel_2_pie_9_0
-api_28 Info 25132 GnssLocationProvider WakeLock released by handleMessage(REPORT_SV_STATUS, 0, [email protected]145)
07-19 13:35:14.868 pixel_2_pie_9_0
-api_28 Info 25132 GnssLocationProvider WakeLock acquired by sendMessage(REPORT_SV_STATUS, 0, [email protected]145)
07-19 13:35:13.867 pixel_2_pie_9_0
-api_28 Info 25132 GnssLocationProvider WakeLock released by handleMessage(REPORT_SV_STATUS, 0, [email protected]6cdbc)
07-19 13:35:13.866 pixel_2_pie_9_0
-api_28 Info 25132 GnssLocationProvider WakeLock acquired by sendMessage(REPORT_SV_STATUS, 0, [email protected]6cdbc)
07-19 13:35:12.867 pixel_2_pie_9_0
-api_28 Info 25132 GnssLocationProvider WakeLock released by handleMessage(REPORT_SV_STATUS, 0, [email protected]e65af)
07-19 13:35:12.865 pixel_2_pie_9_0
-_api_28 Info 25132 GnssLocationProvider WakeLock acquired by sendMessage(REPORT_SV_STATUS, 0, [email protected]e65af)

how can I resolve that?

Best Answers

  • HosseinAftabiHosseinAftabi USMember ✭✭
    edited July 2020 Accepted Answer

    for that I have like this in viewModel

         private string email;
                public string Email
                {
                    get { return email; }
                    set
                    {
                        email = value;
                        PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("Email"));
                    }
                }
    

    but I change my all name from mixed "uper case and lower case to lower case and it work in release mode
    https://forums.xamarin.com/discussion/55666/app-runs-in-debug-mode-crashes-in-release-mode

Answers

  • AnubhavRanjanAnubhavRanjan INXamarin Team Xamurai
    edited July 2020

    @HosseinAftabi I would recommend looking into this error:
    Binding: 'Email' property not found on 'EmsBase.ViewModels.LoginViewModel', target property: 'Xamarin.Forms.Entry.Text'

    Also, what is your Link Setting in Release Mode?

  • HosseinAftabiHosseinAftabi USMember ✭✭
    edited July 2020 Accepted Answer

    for that I have like this in viewModel

         private string email;
                public string Email
                {
                    get { return email; }
                    set
                    {
                        email = value;
                        PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("Email"));
                    }
                }
    

    but I change my all name from mixed "uper case and lower case to lower case and it work in release mode
    https://forums.xamarin.com/discussion/55666/app-runs-in-debug-mode-crashes-in-release-mode

  • HosseinAftabiHosseinAftabi USMember ✭✭

    thanks for your help and i appreciate, but i create 3 project for this problem with different name and strategy(mvvm or without mvvm) but not work i don't know why. it work when i create new project when Created it with lowercase,
    thanks again.

Sign In or Register to comment.