I can only do deployment when my cel is plugged into my note. If I use the default ( VisualStudio_android-23_arm_phone(Android 6.0 - API23)
), it does not work. Build successfully, but deployment fails. I do not know why. I have not tested with other models. I can not load another option in VS and Android project settings (My project is Cross Platform), I used it as a target version to VisualStudio_android-23_arm_phone(Android 6.0 - API23)
.
My Android setting:
MyApp.xaml.cs
namespaceTeste2{publicpartialclassApp:Application{publicApp(){InitializeComponent();//MainPage=newTeste2.MainPage();MainPage=newNavigationPage(newTeste2.MainPage());}protectedoverridevoidOnStart(){//Handlewhenyourappstarts}protectedoverridevoidOnSleep(){//Handlewhenyourappsleeps}protectedoverridevoidOnResume(){//Handlewhenyourappresumes}}
AndmyMainPage.xaml.cs
publicpartialclassMainPage:ContentPage{publicMainPage(){InitializeComponent();}}
MyMainPage.xaml:
<?xmlversion="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:Teste2"
x:Class="Teste2.MainPage">
<StackLayout Orientation="Vertical">
<StackLayout Padding="5,5,0,0">
<Label Text="Adicionar um Produto" TextColor="Green" />
</StackLayout>
<StackLayout Padding="10,0,10,0">
<Entry x:Name="txtNome" Placeholder="Nome do produto" HorizontalOptions="Start"
VerticalOptions="StartAndExpand" HeightRequest="30" WidthRequest="300" FontSize="Small"/>
<Entry x:Name="txtCategoria" Placeholder="Categoria do produto" HorizontalOptions="Start"
VerticalOptions="StartAndExpand" HeightRequest="30" WidthRequest="300" FontSize="Small" />
<Entry x:Name="txtPreco" Placeholder="Preço do produto" HorizontalOptions="Start" VerticalOptions="StartAndExpand"
HeightRequest="30" WidthRequest="300" FontSize="Small" />
<Button HorizontalOptions="FillAndExpand" VerticalOptions="StartAndExpand" HeightRequest="40" Text="Adicionar/Atualizar Produto"
Clicked="btnAdicionar_Clicked" FontSize="Small"/>
</StackLayout>
<!--<StackLayout Orientation="Vertical" Padding="10,5,10,0">
<ListView x:Name="listaProdutos" ItemSelected="listaProdutos_ItemSelected" BackgroundColor="Aqua" SeparatorColor="Blue">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<ViewCell.ContextActions>
<MenuItem Clicked="OnAtualizar" CommandParameter="{Binding .}" Text="Atualizar" />
<MenuItem Clicked="OnDeletar" CommandParameter="{Binding .}" Text="Deletar" IsDestructive="True" />
</ViewCell.ContextActions>
<StackLayout Padding="10,10" Orientation="Horizontal">
<Label Text="{Binding Nome}" HorizontalOptions="StartAndExpand"/>
<Label Text="{Binding Categoria}" TextColor="Blue" HorizontalOptions="Center"/>
<Label Text="{Binding Preco}" HorizontalOptions="End"/>
</StackLayout>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</StackLayout>-->
</StackLayout>
</ContentPage>
EDIT1
Reading the generated warnings, says there is a version conflict of installed packages. I tried to install the packages, which I was suggested in the NuGet update tab and are giving this problem. The interesting thing is that it has asked me for this package: Lollipop(Android 5.1 API 22)
and I installed and when I closed and opened VS, the reference disappears, but the package is in the Package folder (case 1).
Installing the others, did not conflict in the installation, but when I run the application, comes the conflict (case 2).
In this way the deployment with the default AVD does not work, but if I connect my cel it works.
EDIT2
This is the message I give when I squeeze. It builds normally, but in the deployment it gives dick and the message is just a warning:
EDIT3
Iupdatedthetargetversion(Ialreadydid)andnowgavethiswarningandnodeployment: