Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all 77050 articles
Browse latest View live

Android/Facebook missing default translation 'warning' errors

$
0
0

From nowhere, my Xamarin Forms solution has generated 22 errors all in an Android project, all complaining that lots of 'com_facebook_XXXX has no default translation'. I'm using a fully up to date version of VS2017 (15.4.2).
I have no idea what has caused this and googling the individual errors doesnt seems to turn anything relevant up.

enter image description here

I can see in Resource.Designer.cs that these constants are defined:

public const int com_facebook_smart_login_confirmation_title_m2gender = 2131230763;

// aapt resource value: 0x7f080016
public const int com_facebook_tooltip_default = 2131230742;

// aapt resource value: 0x7f08002c
public const int com_facebook_tooltip_default_f1gender = 2131230764;

// aapt resource value: 0x7f08002d
public const int com_facebook_tooltip_default_m2gender = 2131230765;

But what do I do with them?

Has anyone seen this before or know what has caused it?

Thanks


Problems to start SLsvcUtil.exe

$
0
0

Hi guys

We are trying to perform the step 3 on Creating a Xamarin.Android Application using this walkthrough:
https://developer.xamarin.com/guides/cross-platform/application_fundamentals/web_services/walkthrough_working_with_WCF/

But we found this error when we are trying to run the command line:

C:\Program Files (x86)\Microsoft SDKs\Silverlight\v5.0\Tools>SLsvcUtil.exe /noConfig http://localhost:8733/Design_Time_Addresses/wcfForcaVendasService/Service1/
Microsoft (R) Silverlight Service Model Proxy Generation Tool
[Microsoft (R) Silverlight SDK, Version 5.0.61118.0]
Copyright (c) Microsoft Corporation. All rights reserved.

Attempting to download metadata from 'http://localhost:8733/Design_Time_Addresses/wcfForcaVendasService/Service1/' using WS-Metadata Exchange or DISCO.
Error: An error occurred in the tool.

Error: Valor não pode ser nulo. (Value cannot be null)

Nome do parâmetro: config (Parameter's name: config)

Somebody can help us?
Many thanks
Daniel

xamarin-forms workbooks LoadXaml for android

$
0
0

How can I do this for android inside a workbook
Xamarin.Forms.Forms.Init();
var a = new App();
KeyWindow.RootViewController = a.MainPage.CreateViewController();

My list isn't rendering correctly my items!

$
0
0
    private async void LoadMoreTickets()
    {
        listView.IsRefreshing = true;

        var view = (ViewTicket)pickerViews.SelectedItem;
        pageNumber++;

        var ticketsList = await Api.GetTicketByView(view.Id, pageNumber);

        //Tickets its a ObservableCollection and i dnt need to set the source again..
        foreach (var item in ticketsList)
        {
             Tickets.Add(item);
        }

        listView.IsRefreshing = false;
    }

I'm already making the method async, but my list doesn't render correctly, some fields dsnt appears...
someone have any idea why ? D:

Pull to Refresh works in Android, but it doesn't do anything in iOS

$
0
0

In Xamarin PCL, I have no problem with the Pull to Refresh in my Androidproject, but when I launch iOS using Visual Studio 2017 for windows and a Mac mini, it's as if it weren't even there. The regular listview pull to refresh does work in my iOS, though. Are there differences? Here is the xaml:

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="HunterTracker.Pages.LunarPhases"
             xmlns:controls="clr-namespace:Refractored.XamForms.PullToRefresh;assembly=Refractored.XamForms.PullToRefresh"
            Title="Lunar"
             xmlns:control2="clr-namespace:HunterTracker.Controls;assembly=HunterTracker"
             BackgroundImage="camouflagetexture.jpg">

    <ContentPage.Resources>
        <ResourceDictionary>
            <Style x:Key="labelStyle" TargetType="Label">
                <Setter Property="TextColor" Value="White" />
                <Setter Property="FontSize" Value="Large" />
            </Style>
            <Style x:Key="fieldStyle" TargetType="Label">
                <Setter Property="TextColor" Value="White" />
                <Setter Property="FontSize" Value="Medium" />
            </Style>
            <Style x:Key="fieldView" TargetType="ContentView">
                <Setter Property="Padding" Value="0" />
            </Style>
        </ResourceDictionary>
    </ContentPage.Resources>

    <ContentPage.Content>

        <StackLayout Padding="0" Margin="0">

            <controls:PullToRefreshLayout
            IsPullToRefreshEnabled="true"
            RefreshCommand="{Binding GetLunarCommand}"
            IsRefreshing="{Binding IsBusy}"
            RefreshColor="White"
            RefreshBackgroundColor="DarkOliveGreen" >

                <ScrollView>
                    <StackLayout Margin="0" Padding="0">
                            <Label Text="Pull Down To Refresh"  HorizontalOptions="Center" Margin="5" TextColor="White"/>

                        <!-- Weather Display Bindings -->
                        <StackLayout Orientation="Horizontal" Margin="20,20, 5, 0">
                            <StackLayout HorizontalOptions="Start">
                                <Label Text="Sunrise:" Style="{StaticResource fieldStyle}" />
                                <ContentView Style="{StaticResource fieldView}">
                                    <Label Text="{Binding Sunrise}" Style="{StaticResource fieldStyle}" />
                                </ContentView>
                                <Label Text="Sunset:" Style="{StaticResource fieldStyle}" />
                                <ContentView Style="{StaticResource fieldView}">
                                    <Label x:Name="sunsetLabel" Text="{Binding Sunset}" Style="{StaticResource fieldStyle}" />
                                </ContentView>

                                <Label Text="Moonrise:" Style="{StaticResource fieldStyle}" />
                                <ContentView Style="{StaticResource fieldView}">
                                    <Label x:Name="moonriseLabel" Text="{Binding Moonrise}" Style="{StaticResource fieldStyle}" />
                                </ContentView>
                            </StackLayout>

                            <StackLayout>
                                <Image x:Name="MoonImage" VerticalOptions="Start" Source="{Binding MoonImage}"/>

                            </StackLayout>
                        </StackLayout>


                        <StackLayout Orientation="Horizontal" Margin="20, 0">
                            <StackLayout HorizontalOptions="StartAndExpand">
                            <Label Text="Overhead:" Style="{StaticResource fieldStyle}" />
                        <ContentView Style="{StaticResource fieldView}">
                            <Label x:Name="moonOverheadLabel" Text="{Binding MoonOverhead}" Style="{StaticResource fieldStyle}" />
                        </ContentView>

                        <Label Text="Moonset:" Style="{StaticResource fieldStyle}" />
                        <ContentView Style="{StaticResource fieldView}">
                            <Label x:Name="moonsetLabel" Text="{Binding Moonset}" Style="{StaticResource fieldStyle}" />
                        </ContentView>


                            </StackLayout>
                            <StackLayout HorizontalOptions="EndAndExpand">
                                <ContentView Style="{StaticResource fieldView}">
                                    <Label x:Name="moonphaselabel" Text="{Binding Moonphase}"
                                           Style="{StaticResource fieldStyle}" />
                                </ContentView>

                                <ContentView Style="{StaticResource fieldView}">
                                    <Label x:Name="illuminationLabel" Text="{Binding Illumination}"
                                           Style="{StaticResource fieldStyle}" />
                                </ContentView>
                            </StackLayout>
                        </StackLayout>
                        <ContentView Style="{StaticResource fieldView}">
                            <Label x:Name="dayLengthLabel" Text="{Binding DayLength}"
                                   Style="{StaticResource fieldStyle}" HorizontalOptions="Center"/>
                        </ContentView>
                    </StackLayout>
                </ScrollView>


            </controls:PullToRefreshLayout>
            <StackLayout Padding="0" Margin="0" VerticalOptions="EndAndExpand">
                <control2:AdControlView Margin="0"/>
            </StackLayout>
        </StackLayout>
    </ContentPage.Content>

</ContentPage>

PostSharp Support for Xamarin!

$
0
0

Woooooooohooo!

I have been spending the past month getting ramped up for Xamarin.Forms and have been spending a LOT of time trying to solve the tricky problem of aspect-oriented-programming for Xamarin libraries. It is a problem because it involves dynamic code, which is a no-no on Apple's platform. I ended up (begrudgingly) on T4 templates, which, if you have ever used them, feel like they have been developed by an army of interns.

Anyways, I just found out that PostSharp has just introduced support for Xamarin libraries!!!
http://www.postsharp.net/blog/post/Announcing-PostSharp-41-Preview-4-Xamarin-Support-and-More

This means AOP for Xamarin!!! Such very good news. I am a happy codin' monkey right now. :) :) :) Just had to share!

Could not copy the file "obj/iPhone/Release/AppName.exe.manifest" because it was not found.

$
0
0

I have seen so many threads about "Could not find the file ..." but no one about copy this *.exe manifest, at this point i tried:

1) Close solution, close VS, delete obj & bin folders, clean/build.
2) Double check, triple check, N checks to have same XF versions on all projects.

Seems like to everybody these solutions worked, nope for me.

If it is helpfull i'm using this:

=== Visual Studio Community 2017 for Mac ===

Version 7.2 (build 636)
Installation UUID: 46ce1fa5-42ac-499f-9503-2ab78fba9354
Runtime:
Mono 5.4.0.201 (2017-06/71277e78f6e) (64-bit)
GTK+ 2.24.23 (Raleigh theme)

Package version: 504000201

=== NuGet ===

Version: 4.3.1.4445

=== .NET Core ===

Runtime: /usr/local/share/dotnet/dotnet
Runtime Version: 2.0.0
SDK: /usr/local/share/dotnet/sdk/2.0.0/Sdks
SDK Version: 2.0.0
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.4.0/lib/mono/msbuild/15.0/bin/Sdks

=== Xamarin.Profiler ===

Version: 1.5.6
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Apple Developer Tools ===

Xcode 9.0 (13247)
Build 9A235

=== Xamarin.iOS ===

Version: 11.2.0.11 (Visual Studio Community)
Hash: 2f8bbec0
Branch: d15-4-xi
Build date: 2017-10-05 20:56:05-0400

=== Xamarin.Android ===

Version: 8.0.0.33 (Visual Studio Community)
Android SDK: /Users/consulting/Library/Developer/Xamarin/android-sdk-macosx
Supported Android versions:
6.0 (API level 23)
7.0 (API level 24)
7.1 (API level 25)

SDK Tools Version: 25.2.5
SDK Platform Tools Version: 25.0.5
SDK Build Tools Version: 25.0.3

Java SDK: /usr
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)

Android Designer EPL code available here:
(Forum do not let me post links yet)

=== Xamarin.Mac ===

Version: 3.8.0.49 (Visual Studio Community)

=== Xamarin Inspector ===

Version: 1.3.2
Hash: 461f09a
Branch: 1.3-release
Build date: Tue, 03 Oct 2017 18:26:57 GMT
Client compatibility: 1

=== Build Information ===

Release ID: 702000636
Git revision: b349c8fc0c2e1aab0179917d56eed75eb3a03337
Build date: 2017-10-06 15:20:04-04
Xamarin addins: a8da992c78f7eb65b3cdb3f951c34a30337cab35
Build lane: monodevelop-lion-d15-4

=== Operating System ===

Mac OS X 10.12.6
Darwin 16.7.0 Darwin Kernel Version 16.7.0
Thu Jun 15 17:36:27 PDT 2017
root:xnu-3789.70.16~2/RELEASE_X86_64 x86_64

And the error shown:

/Library/Frameworks/Mono.framework/Versions/5.4.0/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(4514,5): error MSB3030: Could not copy the file "obj/iPhone/Release/AppName.exe.manifest" because it was not found.

(I replace the real name of my application for the 'AppName' prefix)
If anyone has a real solution to this, i'll appreciate.

Thanks.
MG.

Customizing Entry borders

$
0
0

Hello guys ! I am making an app using Xamarin.Forms and I am trying to make an entry with invisible borders. I set the background color of the entry to be the same as the background color of the parentView but the borders are still visible. Is it possible to make them invisible ? Thanks in advance ! :)


FreshMvvm, FreshMasterDetailNavigationContainer question

$
0
0

I'm using FreshMvvm with FreshMasterDetailNavigationContainer to do a hamburger menu. The first item on the menu displays some information, while the second is for a date input which when its OK'd updates the info on the first item, and then redisplays it. I do this by calling
masterDetailNav.SwitchSelectedRootPageModel<FirstPageModel>();

This works, however, it leaves the menu highlighting the second item, not the first. Is there any way of resetting the selected menu item back to the first item as well or is there a better/proper way of programmatically navigating between menu items?

How to skip or do a custom camera review screen?

$
0
0

I've seen some apps that after the user takes a picture it doesn't take you to a review screen to validate the picture you took... or it takes you to a screen with custom buttons and allows you to crop. How in Xamarin can you do something like this?

Scanning using ZXing.Net.Mobile.Forms ZXingScannerView

$
0
0

How do I use the ZXingScannerView in a content page to Scan a QR Code? I also want to have a red rectangle (Target Area) inside of the view with a cancel button to end the scanning. How do I accomplish this using ZXingScannerView?
Ask?
1. Scan
2. Target Area
3. Cancel Button

Any insights would be helpful.

Binding a switch

$
0
0

Hey guys,

I am trying to SetBinding to a switch in Code - behind (not XAML) but I have not been successful.

homePhoneSwitch.Toggled += (object sender, ToggledEventArgs e) => {
            ViewModel.Settings.HomePhone = e.Value;
        };

Doing the step above works fine but I have so many switches in my views and this is not an ideal solution.

I have attempted to use SetBinding like this:

        homePhoneSwitch.SetBinding (Switch.IsToggledProperty, new Binding ("Settings.HomePhone"));
&&                     homePhoneSwitch.SetBinding (Switch.IsToggledProperty, new Binding ("ViewModel.Settings.HomePhone"));
&&          homePhoneSwitch.SetBinding (Switch.IsToggledProperty,  "Settings.HomePhone");

None of the above has worked for me. Is there something I am missing?
This is frustrating as on XAML its fairly straightforward but in the code-behind doesn't seem to work.

Any help is highly appreciated.

ZXing barcode reader

$
0
0

I am having some issues with ZXing tool with Xamarin.Forms and on the IOS (ipad) platform. When I hold the IPad in the landscape position everything works find with scanning a barcode. When I hold the Ipad in the portrait (vertical) position and try to scan a barcode it doesn't work. It won't read the barcode until I rotate the barcode to a verticle (top/bottom) position. This seems to work fine on an Android no matter how I hold my phone. Just wondering if there is something I am missing?

Essentially my current code is as follows:

var scanPage = new ZXingScannerPage ();
// Navigate to our scanner page
await Navigation.PushAsync (scanPage);

scanPage.OnScanResult += (result) =>
{
    // Stop scanning
    scanPage.IsScanning = false;

    // Pop the page and show the result
    Device.BeginInvokeOnMainThread (async () =>
    {
        await Navigation.PopAsync ();
        await DisplayAlert("Scanned Barcode", result.Text, "OK");
    });
};

There is a similar issues posted below but with no solution:
https://stackoverflow.com/questions/44017593/barcode-scanner-does-not-work-in-portrait-mode-xamarin-form

ZXing.Net.Mobile = 2.2.9
ZXing.Net.Mobile.Forms = 2.2.9
Xamarin.Forms = 2.3.4.231

I'm trying to make a custom map pin rotate when a slider is dragged.

$
0
0

I have a slider that you can drag to choose an hour in the day. When the slider moves, the map pin in the custom map renderer must rotate to match the wind direction at the given time. How can I make a slider in my UI map control the rotation of a custom map pin in a custom map renderer? Both iOS and Android custom map renderers.

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocatio

$
0
0

Hi I got this error when i navigate to a page from a list view in xamarin forms . I can't find the actual problem can any one help he to find where the problem is happening from this report . am using MVVMLight
[0:] Error NavigateTo BenWorkTasksPage. Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidCastException: Specified cast is not valid. at Xamarin.Forms.Label.FontStructPropertyChanged (Xamarin.Forms.BindableObject bindable, System.Object oldValue, System.Object newValue) [0x00000] in <filename unknown>:0 at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindablePropertyContext context, System.Object value, Boolean currentlyApplying, SetValueFlags attributes, Boolean silent) [0x0010e] in <filename unknown>:0 at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, SetValueFlags attributes, SetValuePrivateFlags privateAttributes) [0x0014b] in <filename unknown>:0 at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value, Boolean fromStyle, Boolean checkAccess) [0x0005f] in <filename unknown>:0 at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value, Boolean fromStyle) [0x00000] in <filename unknown>:0 at Xamarin.Forms.Setter.Apply (Xamarin.Forms.BindableObject target, Boolean fromStyle) [0x000a4] in <filename unknown>:0 at Xamarin.Forms.Style.ApplyCore (Xamarin.Forms.BindableObject bindable, Xamarin.Forms.Style basedOn) [0x0001e] in <filename unknown>:0 at Xamarin.Forms.Style.Xamarin.Forms.IStyle.Apply (Xamarin.Forms.BindableObject bindable) [0x0003e] in <filename unknown>:0 at Xamarin.Forms.VisualElement+MergedStyle.SetStyle (IStyle implicitStyle, IStyle classStyle, IStyle style) [0x00111] in <filename unknown>:0 at Xamarin.Forms.VisualElement+MergedStyle.set_Style (IStyle value) [0x0000d] in <filename unknown>:0 at Xamarin.Forms.VisualElement+<>c.<.cctor>b__211_6 (Xamarin.Forms.BindableObject bindable, System.Object oldvalue, System.Object newvalue) [0x00000] in <filename unknown>:0 at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindablePropertyContext context, System.Object value, Boolean currentlyApplying, SetValueFlags attributes, Boolean silent) [0x0010e] in <filename unknown>:0 at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, SetValueFlags attributes, SetValuePrivateFlags privateAttributes) [0x0014b] in <filename unknown>:0 at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value, Boolean fromStyle, Boolean checkAccess) [0x0005f] in <filename unknown>:0 at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value) [0x00000] in <filename unknown>:0 at IWSM.XamarinApp.Views.BenWorkTasksPage.InitializeComponent () [0x0af0c] in <filename unknown>:0 at IWSM.XamarinApp.Views.BenWorkTasksPage..ctor (IWSM.Shared.DataModels.WorkTaskDataModel wtdm) [0x00008] in D:\Shamnad_TFS_Workspace\IWSM.XamarinApp\IWSM.XamarinApp\IWSM.XamarinApp\Views\BenWorking\BenWorkTasksPage.xaml.cs:31 at (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke (System.Reflection.MonoCMethod,object,object[],System.Exception&) at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00002] in /Users/builder/data/lanes/3339/39ebb778/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:644 --- End of inner exception stack trace --- at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00016] in /Users/builder/data/lanes/3339/39ebb778/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:650 at System.Reflection.MonoCMethod.DoInvoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00089] in /Users/builder/data/lanes/3339/39ebb778/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:635 at System.Reflection.MonoCMethod.Invoke (BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in /Users/builder/data/lanes/3339/39ebb778/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:663 at System.Reflection.ConstructorInfo.Invoke (System.Object[] parameters) [0x00000] in /Users/builder/data/lanes/3339/39ebb778/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/corlib/System.Reflection/ConstructorInfo.cs:62 at IWSM.XamarinApp.Common.NavigationService+<NavigateTo>d__15.MoveNext () [0x00173] in D:\Shamnad_TFS_Workspace\IWSM.XamarinApp\IWSM.XamarinApp\IWSM.XamarinApp\Common\NavigationService.cs:115 [0:] OnItemTapped: IWSM.Shared.DataModels.WorkTaskDataModel [0:] Error NavigateTo BenWorkTasksPage. Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidCastException: Specified cast is not valid. at Xamarin.Forms.Label.FontStructPropertyChanged (Xamarin.Forms.BindableObject bindable, System.Object oldValue, System.Object newValue) [0x00000] in <filename unknown>:0 at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindablePropertyContext context, System.Object value, Boolean currentlyApplying, SetValueFlags attributes, Boolean silent) [0x0010e] in <filename unknown>:0 at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, SetValueFlags attributes, SetValuePrivateFlags privateAttributes) [0x0014b] in <filename unknown>:0 at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value, Boolean fromStyle, Boolean checkAccess) [0x0005f] in <filename unknown>:0 at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value, Boolean fromStyle) [0x00000] in <filename unknown>:0 at Xamarin.Forms.Setter.Apply (Xamarin.Forms.BindableObject target, Boolean fromStyle) [0x000a4] in <filename unknown>:0 at Xamarin.Forms.Style.ApplyCore (Xamarin.Forms.BindableObject bindable, Xamarin.Forms.Style basedOn) [0x0001e] in <filename unknown>:0 at Xamarin.Forms.Style.Xamarin.Forms.IStyle.Apply (Xamarin.Forms.BindableObject bindable) [0x0003e] in <filename unknown>:0 at Xamarin.Forms.VisualElement+MergedStyle.SetStyle (IStyle implicitStyle, IStyle classStyle, IStyle style) [0x00111] in <filename unknown>:0 at Xamarin.Forms.VisualElement+MergedStyle.set_Style (IStyle value) [0x0000d] in <filename unknown>:0 at Xamarin.Forms.VisualElement+<>c.<.cctor>b__211_6 (Xamarin.Forms.BindableObject bindable, System.Object oldvalue, System.Object newvalue) [0x00000] in <filename unknown>:0 at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindablePropertyContext context, System.Object value, Boolean currentlyApplying, SetValueFlags attributes, Boolean silent) [0x0010e] in <filename unknown>:0 at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, SetValueFlags attributes, SetValuePrivateFlags privateAttributes) [0x0014b] in <filename unknown>:0 at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value, Boolean fromStyle, Boolean checkAccess) [0x0005f] in <filename unknown>:0 at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value) [0x00000] in <filename unknown>:0 at IWSM.XamarinApp.Views.BenWorkTasksPage.InitializeComponent () [0x0af0c] in <filename unknown>:0 at IWSM.XamarinApp.Views.BenWorkTasksPage..ctor (IWSM.Shared.DataModels.WorkTaskDataModel wtdm) [0x00008] in D:\Shamnad_TFS_Workspace\IWSM.XamarinApp\IWSM.XamarinApp\IWSM.XamarinApp\Views\BenWorking\BenWorkTasksPage.xaml.cs:31 at (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke (System.Reflection.MonoCMethod,object,object[],System.Exception&) at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00002] in /Users/builder/data/lanes/3339/39ebb778/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:644 --- End of inner exception stack trace --- at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00016] in /Users/builder/data/lanes/3339/39ebb778/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:650 at System.Reflection.MonoCMethod.DoInvoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00089] in /Users/builder/data/lanes/3339/39ebb778/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:635 at System.Reflection.MonoCMethod.Invoke (BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in /Users/builder/data/lanes/3339/39ebb778/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:663 at System.Reflection.ConstructorInfo.Invoke (System.Object[] parameters) [0x00000] in /Users/builder/data/lanes/3339/39ebb778/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/corlib/System.Reflection/ConstructorInfo.cs:62 at IWSM.XamarinApp.Common.NavigationService+<NavigateTo>d__15.MoveNext () [0x00173] in D:\Shamnad_TFS_Workspace\IWSM.XamarinApp\IWSM.XamarinApp\IWSM.XamarinApp\Common\NavigationService.cs:115


Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat;

$
0
0

HI Xamarin Lovers PLease help me get out of this error i am wasting too much time
Severity Code Description Project File Line Suppression State
Error java.lang.IllegalArgumentException: already added : Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat;

Xamarin.Forms IOS Crash on start with System.NullReferenceException

$
0
0

Hey all,

My app is crashing on Startup and I've gone through a lot of tinkering to get it to where it is.
My app crashes when attempting to instantiate my PCL Forms App class in IO

I've tried running it without debugging

I've tried set breakpoints but Xamarin Studio isn't picking them up.

I've gone back and forth on the stack trace and toggled the build output to Diagnostic to see if there is a hint in the build log.

I've verified my Developer Profile and Bundle Signing Identity are set to the defaults.

This project is essentially a solution rebuild of a previous version pulling in some existing code and resources. It was working until I updated my App file and added a bunch of nuget refs. I can't pinpoint the exact cause of the beginning of the runtime fail. I am referencing .netcore and I have recompiled stripe.net to be referenceable by PCL.

EventProMobile App code (partial)

https://pastebin.com/79fbx9Uf

csharp
public partial class App : Application
{
    public App()
    {
        LogHelper.LogDebug("At the start of the constructor");
        InitializeComponent();
        //note* the namespace is EventProMobile
        MainPage = new NavigationPage(new Xamarin.Forms.Page());
    }

    protected override void OnStart()
    {
        // Handle when your app starts
        MobileCenter.Start(typeof(Analytics), typeof(Crashes));
        BlobCache.ApplicationName = "EventPro";
        MainPage = RunCredentialCheck();
    }
}

EventProMobile.iOS AppDelegate code

https://pastebin.com/hyk9V0Dh

csharp
using System.Diagnostics;
using EventProApp.iOS;
using FFImageLoading.Forms.Touch;
using Foundation;
using UIKit;

namespace EventProMobile.iOS
{
    [Register("AppDelegate")]
    public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate
    {
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            try
            {
                Xamarin.Forms.Forms.Init();
                EventProMobile.App.Logger.Write("Test", Splat.LogLevel.Debug);
                var formsApp = new EventProMobile.App();
                Debug.Assert(formsApp != null,"App should not be null after instantiation.");
                LoadApplication(formsApp);
                return base.FinishedLaunching(app, options);
            }
            catch (System.Exception ex)
            {
                Debug.Write($"Error on FinishedLaunching: {ex.Message}");
                throw ex;
            }
        }
    }
}

My packages for My PCL project

  package id="akavache.core" version="5.0.0" targetFramework="portable45-net45+win8+wpa81"
  package id="akavache.sqlite3" version="5.0.0" targetFramework="portable45-net45+win8+wpa81"
  package id="AsyncErrorHandler.Fody" version="1.1.0" targetFramework="portable45-net45+win8+wpa81" developmentDependency="true"
  package id="CClarke.Plugin.Calendars" version="0.6.33-beta" targetFramework="portable45-net45+win8+wpa81"
  package id="CommonServiceLocator" version="1.3" targetFramework="portable45-net45+win8+wpa81"
  package id="Fody" version="2.0.6" targetFramework="portable45-net45+win8+wpa81" developmentDependency="true"
  package id="fusillade" version="0.7.0" targetFramework="portable45-net45+win8+wpa81"
  package id="Microsoft.Azure.Mobile" version="0.9.2" targetFramework="portable45-net45+win8+wpa81"
  package id="Microsoft.Azure.Mobile.Analytics" version="0.9.2" targetFramework="portable45-net45+win8+wpa81"
  package id="Microsoft.Azure.Mobile.Crashes" version="0.9.2" targetFramework="portable45-net45+win8+wpa81"
  package id="Microsoft.Net.Compilers" version="2.1.0" targetFramework="portable45-net45+win8+wpa81" developmentDependency="true"
  package id="Microsoft.NETCore.Platforms" version="1.1.0" targetFramework="portable45-net45+win8+wpa81"
  package id="Microsoft.NETCore.Targets" version="1.1.0" targetFramework="portable45-net45+win8+wpa81"
  package id="modernhttpclient" version="2.4.2" targetFramework="portable45-net45+win8+wpa81"
  package id="MvvmLightLibs" version="5.3.0.0" targetFramework="portable45-net45+win8+wpa81"
  package id="NETStandard.Library" version="1.6.1" targetFramework="portable45-net45+win8+wpa81"
  package id="Newtonsoft.Json" version="7.0.1" targetFramework="portable45-net45+win8+wpa81"
  package id="Plugin.Permissions" version="1.2.1" targetFramework="portable45-net45+win8+wpa81"
  package id="Plugin.Share" version="6.1.0.19-beta" targetFramework="portable45-net45+win8+wpa81"
  package id="Polly" version="5.0.6" targetFramework="portable45-net45+win8+wpa81"
  package id="PropertyChanged.Fody" version="1.53.0" targetFramework="portable45-net45+win8+wpa81" developmentDependency="true"
  package id="Punchclock" version="1.1.1" targetFramework="portable45-net45+win8+wpa81"
  package id="reactiveui" version="7.0.0" targetFramework="portable45-net45+win8+wpa81"
  package id="ReactiveUI.Fody" version="2.2.3" targetFramework="portable45-net45+win8+wpa81"
  package id="reactiveui-core" version="7.2.0" targetFramework="portable45-net45+win8+wpa81"
  package id="reactiveui-xamforms" version="7.2.0" targetFramework="portable45-net45+win8+wpa81"
  package id="refit-linker" version="2.3.0" targetFramework="portable45-net45+win8+wpa81"
  package id="runtime.native.System" version="4.3.0" targetFramework="portable45-net45+win8+wpa81"
  package id="Rx-Core" version="2.2.5" targetFramework="portable45-net45+win8+wpa81"
  package id="Rx-Interfaces" version="2.2.5" targetFramework="portable45-net45+win8+wpa81"
  package id="Rx-Linq" version="2.2.5" targetFramework="portable45-net45+win8+wpa81"
  package id="Rx-Main" version="2.2.5" targetFramework="portable45-net45+win8+wpa81"
  package id="Rx-PlatformServices" version="2.2.5" targetFramework="portable45-net45+win8+wpa81"
  package id="Splat" version="1.6.2" targetFramework="portable45-net45+win8+wpa81"
  package id="SQLitePCLRaw.bundle_e_sqlite3" version="1.1.0" targetFramework="portable45-net45+win8+wpa81"
  package id="SQLitePCLRaw.core" version="1.1.0" targetFramework="portable45-net45+win8+wpa81"
  package id="System.Collections" version="4.3.0" targetFramework="portable45-net45+win8+wpa81"
  package id="System.Collections.Concurrent" version="4.3.0" targetFramework="portable45-net45+win8+wpa81"
  package id="System.Diagnostics.Debug" version="4.3.0" targetFramework="portable45-net45+win8+wpa81"
  package id="System.Diagnostics.Tools" version="4.3.0" targetFramework="portable45-net45+win8+wpa81"
  package id="System.Diagnostics.Tracing" version="4.3.0" targetFramework="portable45-net45+win8+wpa81"
  package id="System.Globalization" version="4.3.0" targetFramework="portable45-net45+win8+wpa81"
  package id="System.IO" version="4.3.0" targetFramework="portable45-net45+win8+wpa81"
  package id="System.IO.Compression" version="4.3.0" targetFramework="portable45-net45+win8+wpa81"
  package id="System.Linq" version="4.3.0" targetFramework="portable45-net45+win8+wpa81"
  package id="System.Linq.Expressions" version="4.3.0" targetFramework="portable45-net45+win8+wpa81"
  package id="System.Net.Http" version="4.3.0" targetFramework="portable45-net45+win8+wpa81"
  package id="System.Net.Primitives" version="4.3.0" targetFramework="portable45-net45+win8+wpa81"
  package id="System.ObjectModel" version="4.3.0" targetFramework="portable45-net45+win8+wpa81"
  package id="System.Reflection" version="4.3.0" targetFramework="portable45-net45+win8+wpa81"
  package id="System.Reflection.Extensions" version="4.3.0" targetFramework="portable45-net45+win8+wpa81"
  package id="System.Reflection.Primitives" version="4.3.0" targetFramework="portable45-net45+win8+wpa81"
  package id="System.Resources.ResourceManager" version="4.3.0" targetFramework="portable45-net45+win8+wpa81"
  package id="System.Runtime" version="4.3.0" targetFramework="portable45-net45+win8+wpa81"
  package id="System.Runtime.Extensions" version="4.3.0" targetFramework="portable45-net45+win8+wpa81"
  package id="System.Runtime.InteropServices" version="4.3.0" targetFramework="portable45-net45+win8+wpa81"
  package id="System.Runtime.InteropServices.RuntimeInformation" version="4.3.0" targetFramework="portable45-net45+win8+wpa81"
  package id="System.Runtime.Numerics" version="4.3.0" targetFramework="portable45-net45+win8+wpa81"
  package id="System.Text.Encoding" version="4.3.0" targetFramework="portable45-net45+win8+wpa81"
  package id="System.Text.Encoding.Extensions" version="4.3.0" targetFramework="portable45-net45+win8+wpa81"
  package id="System.Text.RegularExpressions" version="4.3.0" targetFramework="portable45-net45+win8+wpa81"
  package id="System.Threading" version="4.3.0" targetFramework="portable45-net45+win8+wpa81"
  package id="System.Threading.Tasks" version="4.3.0" targetFramework="portable45-net45+win8+wpa81"
  package id="System.Xml.ReaderWriter" version="4.3.0" targetFramework="portable45-net45+win8+wpa81"
  package id="System.Xml.XDocument" version="4.3.0" targetFramework="portable45-net45+win8+wpa81"
  package id="Xam.Plugin.Connectivity" version="2.3.0" targetFramework="portable45-net45+win8+wpa81"
  package id="Xamarin.FFImageLoading" version="2.2.9" targetFramework="portable45-net45+win8+wpa81"
  package id="Xamarin.FFImageLoading.Forms" version="2.2.9" targetFramework="portable45-net45+win8+wpa81"
  package id="Xamarin.Forms" version="2.3.4.231" targetFramework="portable45-net45+win8+wpa81"

My packages.config for my IOS Project

  package id="akavache.core" version="5.0.0" targetFramework="xamarinios10"
  package id="akavache.sqlite3" version="5.0.0" targetFramework="xamarinios10"
  package id="CClarke.Plugin.Calendars" version="0.6.33-beta" targetFramework="xamarinios10"
  package id="Microsoft.Azure.Mobile" version="0.9.2" targetFramework="xamarinios10"
  package id="Microsoft.Azure.Mobile.Analytics" version="0.9.2" targetFramework="xamarinios10"
  package id="Microsoft.Azure.Mobile.Crashes" version="0.9.2" targetFramework="xamarinios10"
  package id="Newtonsoft.Json" version="6.0.3" targetFramework="xamarinios10"
  package id="Plugin.Permissions" version="1.2.1" targetFramework="xamarinios10"
  package id="Plugin.Share" version="6.1.0.19-beta" targetFramework="xamarinios10"
  package id="reactiveui" version="7.2.0" targetFramework="xamarinios10"
  package id="reactiveui-core" version="7.2.0" targetFramework="xamarinios10"
  package id="Rx-Core" version="2.2.5" targetFramework="xamarinios10"
  package id="Rx-Interfaces" version="2.2.5" targetFramework="xamarinios10"
  package id="Rx-Linq" version="2.2.5" targetFramework="xamarinios10"
  package id="Rx-Main" version="2.2.5" targetFramework="xamarinios10"
  package id="Rx-PlatformServices" version="2.2.5" targetFramework="xamarinios10"
  package id="Splat" version="1.6.0" targetFramework="xamarinios10"
  package id="SQLitePCLRaw.bundle_e_sqlite3" version="1.1.0" targetFramework="xamarinios10"
  package id="SQLitePCLRaw.core" version="1.1.0" targetFramework="xamarinios10"
  package id="SQLitePCLRaw.lib.e_sqlite3.ios_unified.static" version="1.1.0" targetFramework="xamarinios10"
  package id="SQLitePCLRaw.provider.internal.ios_unified" version="1.1.0" targetFramework="xamarinios10"
  package id="WebP.Touch" version="1.0.3" targetFramework="xamarinios10"
  package id="Xam.Plugin.Connectivity" version="2.3.0" targetFramework="xamarinios10"
  package id="Xamarin.FFImageLoading" version="2.2.9" targetFramework="xamarinios10"
  package id="Xamarin.FFImageLoading.Forms" version="2.2.9" targetFramework="xamarinios10"
  package id="Xamarin.Forms" version="2.3.4.231" targetFramework="xamarinios10"
  package id="Xamarin.TestCloud.Agent" version="0.20.3" targetFramework="xamarinios10"

Approx 30 second gif of the crash

The IOS Debug Config

The IOS Build Config

The Xamarin Forms PCL General Config

Pic of the Stack Trace

The Exception being thrown

Login persistance with Akavache

$
0
0

Hi All,

I'm trying to implement login persistance feature in my app with Akavache but so far without success.
I want to have it because I don't want user to login in every single time he starts an application.

So in my SignInViewModel I am doing smth like this:

`User u = await _userRepository.SignIn(uDTO);

            if(u != null)
            {
                await BlobCache.UserAccount.InsertObject("User", u);

                MessagingCenter.Send<User>(u, "Authorized");
            }`

This is working OK the object is saved but in my Application based class I am doing smth like this:

`protected override void OnStart ()
    {
        base.OnStart ();

        BlobCache.UserAccount.GetObject<User>("User")
                .Subscribe(x => _u = x, ex => Console.WriteLine("No Key!"));

        if (_u != null)
        {
            MessagingCenter.Send<User>(_u, "Authorized");
        }
    }`

I don't know how to test it on emulator, so I decided to test it on Android device, but after sign in, close and start the application I am not signed in.
What am I doing wrong? How to debug this (when I close the app the debugger close too)
thx

Error: Build failed. See the build log for details. (iOS)

$
0
0

Hi,
I am new in Xamarin.
I have install the Visual studio for Mac.
I just add a new Blank Xamarin Forms Project.
When i try to run the app it's throwing Build error.
"Error: Build failed. See the build log for details. (iOS)"

Please Help to resolve this error.

Thanks

PostSharp Support for Xamarin!

$
0
0

Woooooooohooo!

I have been spending the past month getting ramped up for Xamarin.Forms and have been spending a LOT of time trying to solve the tricky problem of aspect-oriented-programming for Xamarin libraries. It is a problem because it involves dynamic code, which is a no-no on Apple's platform. I ended up (begrudgingly) on T4 templates, which, if you have ever used them, feel like they have been developed by an army of interns.

Anyways, I just found out that PostSharp has just introduced support for Xamarin libraries!!!
http://www.postsharp.net/blog/post/Announcing-PostSharp-41-Preview-4-Xamarin-Support-and-More

This means AOP for Xamarin!!! Such very good news. I am a happy codin' monkey right now. :) :) :) Just had to share!

Viewing all 77050 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>