Severity Code Description Project File Line Suppression State
Error The "ResolveLibraryProjectImports" task failed unexpectedly.
System.IO.FileNotFoundException: Could not load assembly 'Windows.Foundation.UniversalApiContract.winmd, Version=0.0.0.0, Culture=neutral, PublicKeyToken='. Perhaps it doesn't exist in the Mono for Android profile?
File name: 'Windows.Foundation.UniversalApiContract.winmd.dll'
at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve(AssemblyNameReference reference, ReaderParameters parameters)
at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve(String fullName)
at Xamarin.Android.Tasks.ResolveLibraryProjectImports.Extract(DirectoryAssemblyResolver res, ICollection1 jars, ICollection
1 resolvedResourceDirectories, ICollection1 resolvedAssetDirectories, ICollection
1 resolvedEnvironments)
at Xamarin.Android.Tasks.ResolveLibraryProjectImports.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext() WMS.Android
Error The "ResolveLibraryProjectImports" task failed unexpectedly.
Finding the toolbar of a modal NavigationPage in Xamarin.forms >> Android
I've asked this a couple of weeks ago on stack overflow, but with no success, so I try here.
My intention is to get a handle to the toolbar in Android native (on a xamarin forms Project). This, in order to be able to do some custom painting (a badge) on an Icon.
So... I have an Android native method doing this
var toolbar = CrossCurrentActivity.Current.Activity.FindViewById(Resource.Id.toolbar) as Android.Support.V7.Widget.Toolbar;
It works fine, as long as it's the toolbar of my main page I'm after. It also works fine if I, from my main page do something like
Navigation.PushAsync(new MySecondPage());
Then it will find the correct toolbar for the second page.
My problem comes when I push a Modal page, with a toolbar, like this
Navigation.PushModalAsync(new NavigationPage(new MySecondPage()));
Now, if the native Android code is called, the toolbar returned is STILL the one from my main page. (Not the one currently showing on screen).
So, my question: Is there a way to find the toolbar of a modal pushed navigationpage?
Dependency warnings.
I was working on my project today and noticed that I am starting to get a bunch of dependency errors. Never had this before, not sure what is happening. I haven't installed any new nugets. Been using same packages for the past week or so.
I can still build my app and run it on Android and iOS, however all these warnings are really bugging me. Any idea how this can be fixed?
GIF Animation Support in XF 3.4 pre?
I see that GIF Animation Support is on the roadmap but I am not seeing this working for iOS but I do see this for android. Should I be expecting this to work in the current prerelease (v4.0.0.8055-pre1)? If not, when is this expected to be released?
https://github.com/xamarin/Xamarin.Forms/wiki/Feature-Roadmap
How to integrate Paytm Payment Gateway SDK in xamarin.forms android project?
Hi,
I did lot of research for getting the SDK for Paytm payment gateway for xamarin.forms's android project. But unfortunately failed to find the exact SDK. Now I am having some files (link mentioned below) for paytm payment gateway SDK which is originally developed for the Android native application. Can we integrate these files into xamarin.forms android project if yes then how? Or what we have to get these SDK in xamarin.forms android project? If this wont work then can anyone suggest anything? One alternate is I am thinking about using webview but i think that will not solve my problem as how will I get the response to my xamarin app by using webview?
https://github.com/Paytm-Payments/Paytm_Android_App_Kit
Any Advice will be appreciable.
Thanks in advance!
Rishi
Is there a way to change a ListView visually based on a bound property?
I have a ListView that shows a list of devices. Tapping one of these initiates connection, which can take some time. I have an IsBusy property in the view-model, which becomes true while a connection is in progress. I have bound the ListView.IsEnabled property to this and it successfully blocks more taps on the ListView while a connection is in progress.
I would like to give some visual indication to show that the ListView cannot be tapped but there doesn't seem to be any way to do this. I have tried triggers on the ListView and on the visual elements in the ListView (e.g. a Label.TextColor property). Nothing seems to work.
Does anyone know how to do this?
How to create and send .vcf/vCard using user contact details programatically in Xamarin.Forms
Hi,
I am working on Xamarin.Forms application for Android and iOS, I have a requirement to send/share the vCard like sharing a contact in Whatsapp.
So if any one aware or implemented, please suggest me how to achieve this.
I came across that in native Android and iOS the vcards are sending by creating .vcf files, So can you please share or suggest me how to create .vcf files using Xamarin.
Thank you in advance.
Add older IOS simulator on Visual Studio 2017
Hello guys, I have tested a Xamarin Forms app into a IPhone 4S and it didn't work as expected (I can't see a listview and other things).
Since i tried the app in many simulators (like 6S, 8) and it works, I would like really to understand if the problem is the Iphone 4S, so I tried to install the simulator in Xcode (this worked, now I can launch the 4S simulator).
Final step from my windows pc, after pairing to the Mac, I CANT SEE my Iphone 4 simulator on the visual studio simulator list.
What I need to do in order to test the app in 4S simulator? I tried to change in the .plist the deployment target to 9.0 (should be enough since the Iphone have 9.3.5) but still same situation, the 4S simulator not showing in the list and i can't test on it..
Please someone can help me to understand this?
Thanks a lot
Better way to share parent ViewModel between all child TABS
I have a scenario where One page contains 4 tabs. I want to share the parent ViewModel in all four tabs. what is the best way to do that?
Right now I have created by extending the parent ViewModel and On click of Icon on parent page it should check all the page values and store it.
You can see the above image will show what I want to achieve
I have Detail Page, Page A, Page B, Page C, and Page D. Details page ViewModel is extending in all four pages also I have added an event in the parent ViewModel which will trigger when you click on the home icon on the toolbar. I am not getting the event trigger in my child page and also getting the parent ViewModel variables null in the child tab page.
What is the best solution to handle such kind of scenarios? Thanks in advance !!!
@NMackay I hope you have faced such kind of scenarios.
@BrianLagunas I am using the Prism library. What is the better way to handle in the prism?
@JamesMontemagno
How to make a popular design (the same as viewpager in android) in both platform android and iOS.
Hi folks, I want to achieve a specific UI design which is very popular in the iPhone app store app and android too, please take a look at the screen shots I attached (focus on the horizontal view, the top of the screenshots) to understand the achievement I want to have. I am actually using a carousel view with indicator to show 3 cards (on appearing, the middle one is shown). Actually I want to show a bit of the left card and the right card in the screen when the middle one is shown, show a bit of the right card when the first one is shown, and show a bit of the second one in left when the third card is shown. Please note, I need it to get it done on both platforms android and iOS.
l
How to change background color of selected item in a listview on xamarin form?
Hello,
I have ListView like this
<StackLayout Spacing="0"> <ListView x:Name="lvMenu" SeparatorColor="Green"> <ListView.ItemTemplate> <DataTemplate> <ViewCell> <StackLayout Padding="10"> <Label HorizontalOptions="FillAndExpand" VerticalOptions="Center" Text="{Binding Title}" TextColor="#03a9f4" /> </StackLayout> </ViewCell> </DataTemplate> </ListView.ItemTemplate> </ListView> </StackLayout>
Also have ItemSelected event handler like this
lvMenu.ItemSelected += GotoPage; private void GotoPage(object sender, SelectedItemChangedEventArgs e) { var item = e.SelectedItem as MasterPageItem; if (item != null) { //Change bg if (item.Title == "Logout") { LogoutUser(); } else { NavigationPage nPage = new NavigationPage((Page)Activator.CreateInstance(item.TargetType)) { Title = item.Title }; this.Detail = nPage; this.IsPresented = false; } } } public class MasterPageItem { public string Title { get; set; } public Type TargetType { get; set; } }
Can anyone suggest how to change the selected item's default background color?
Present UIImagePickerController from pagesheet modal jumps layout iOS 12
When present the iOS UIImagePickerController from an Pagesheet Modal in iOS 12, the modal jumps to the left top of the screen. When cancelling or taking a photo, the modal layout jumps back to it's original position. This problem started since iOS 12.
Does anyone have a fix for this problem? Or knows what this problem causes?
Before taking a photo:
When taking a photo (when UIImagePickerController showed):
Accessing ResourceDictionary from in C# programmatically - Getting Cast exception - OnIdiom
Hi all,
I have an issue trying to get values from my ResourceDictionary which are like this:
`
<OnIdiom
x:Key="SubHeader"
x:TypeArguments="x:Double"
Phone="18"
Tablet="18" />`
But I want to get a hold of that in c# code, I can get it fine in XAML but struggling in code.
My code atm is is this:
FontSize = double.Parse( Application.Current.Resources["SubHeader"].ToString())
But its not working and just getting a cast exception. The Type definitely looks Double, so in theory should be able to .ToString, then parse as a double.
Any ideas would be appreciated! Need to get this in C# code not XAML, that already works fine
How to get a rsource from an MergedDictionary in c# Code
HI
I used a merged MergedDictionaries to include a external resource file
Color.xaml
<?xml version="1.0" encoding="utf-8" ?>
<?xaml-comp compile="true" ?>
<ResourceDictionary
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml">
<Color x:Key="AccentColor">#FF4B14</Color>
<Color x:Key="BlackOpacityColor">#99253748</Color>
<Color x:Key="BlackTextColor">#253748</Color>
<Color x:Key="BackgroundColor">#F8F8F8</Color>
<Color x:Key="PinkColor">#ED0241</Color>
<Color x:Key="GrayColor">#ACB1B4</Color>
<Color x:Key="DarkColor">#203446</Color>
<Color x:Key="WhiteColor">#FFFFFF</Color>
<Color x:Key="GreenColor">#368F95</Color>
</ResourceDictionary>
App.xaml
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Color.xaml" />
</ResourceDictionary.MergedDictionaries>
<Color x:Key="notgreen">#FF00FF</Color>
</ResourceDictionary>
</Application.Resources>
now I can use the colors defined in Color.xaml file proper in Mainpage.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"
xmlns:local="clr-namespace:TestStyleResources"
x:Class="TestStyleResources.MainPage">
<StackLayout>
<StackLayout>
<Label Text="From App.xaml used in Xaml" TextColor="{StaticResource notgreen}" />
<Label Text="From Color.xaml used in Xaml" TextColor="{StaticResource BlackOpacityColor}" /> <!-- works well :) -->
<Label Text="From App.xaml used in Code" x:Name="lablefronApp" />
<Label Text="From Color.xaml used in Code" x:Name="lablefronColor" />
</StackLayout>
<!-- Place new controls here -->
</StackLayout>
</ContentPage>
Bit If I try to use the resource from Color.xaml in code I get an exception:
System.Collections.Generic.KeyNotFoundException: 'The resource 'BlackOpacityColor' is not present in the dictionary.'
public MainPage()
{
InitializeComponent();
this.lablefronApp.TextColor = (Color)App.Current.Resources["notgreen"]; // => works
this.lablefronApp.TextColor = (Color)App.Current.Resources["BlackOpacityColor"]; => throws exception :*
}
System.TypeLoadException - Clean, remove bin and obj folders and build not working
I already asked a question about this issue on here. But the solution I got there is not working now. The solution was clean, remove bin and obj folders and rebuild.
Exception details:
Exception thrown: 'System.TypeLoadException' in System.Private.CoreLib.ni.dll An exception of type 'System.TypeLoadException' occurred in System.Private.CoreLib.ni.dll but was not handled in user code Could not load type 'Xamarin.Forms.Xaml.XamlResourceIdAttribute' from assembly 'Xamarin.Forms.Core, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null'.
Screenshot:
I have this problem after updating xamarin forms to 3.4.0.1008975 from 2.5.0.121934. Problem is only on the UWP part. Android and IOS apps are working fine, what is the solution for this?
How to resolve the package issues in Visual Studio 2017 professional in Windows Machine ?
I am getting below error when i try to deploy the application into Emulator below package is asking after i added to mu Droid project. again it is asking to install .how to resolve this issue in visualstudio 4.6.1.0 version
Severity Code Description Project File Line Suppression State
Error Can not resolve reference: System.Runtime.InteropServices.WindowsRuntime
, referenced by System.Reactive
. Please add a NuGet package or assembly reference for System.Runtime.InteropServices.WindowsRuntime
, or remove the reference to System.Reactive
. Aria.Droid
How to share an already created vcf file in through my App with other Apps on the phone like email..
Hi,
I have a application that creates a .vcf file after you input data. it stores storage provided by the phone, i want to click on a list view item and get the vcf file and share it via email, sms, whats app, Skype etc how do I implement this in IOS, Android and UWP.
Thank you
App-breaking UI issues in Xamarin.Forms Android application after update
Hi,
I currently have an app which was released on iOS and Android a number of months ago. These versions are working fine. However, I now need to extend the features available in this app, and I am encountering major issues on the Android platform after updating Xamarin.Forms. The iOS platform continues to work as expected.
The issues are as follows:
1. ScrollView does not allow scrolling to view all content. It scrolls a short way vertically, then stops - effectively locking 50% of the screen's contents below the 'fold' of the screen. I have seen this behaviour, but much less severe previously when it was just an annoyance - now, it makes the app unusable on Android.
2. On screens with multiple Picker controls, there is very strange behaviour. The first Picker on the page works fine. However, if you open one of the other Pickers and press 'Ok', the Picker disappears for a second, revealing the previously used picker beneath it (which should be hidden), before re-displaying the Picker you just tried to close. This happens indefinitely until you press the 'Cancel' button a number of times instead.
In addition, after upgrading Xamarin.Forms, I am unable to update some 13 Android nuget packages (e.g. Xamarin.Firebase.Common), as updating them also updates Xamarin.Build.Download to v0.4.9. In my project, any version of Xamarin.Build.Download >= v0.4.6 results in the following build error:
Xamarin.Build.Download.XamarinBuildAndroidAarProguardConfigs task could not be loaded from the assembly Xamarin.Build.Download.0.4.9 Confirm that the declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.
I suspect that if I could update my Android nugets, the UI issues might go away - but updating them makes the project unbuildable. Only by downgrading Xamarin.Build.Download to v0.4.5 can I get my Android project to build, but with the UI issues explained above.
I have spent a significant amount of time trying to resolve all 3 of these issues, with no luck and would be very grateful if someone can point me in the right direction...
`VERSION INFO.
Microsoft Visual Studio Professional 2017
Version 15.9.3
VisualStudio.15.Release/15.9.3+28307.145
Microsoft .NET Framework
Version 4.7.03056
Installed Version: Professional
AnkhSVN - Subversion Support for Visual Studio 2.7.12815.35086
AnkhSVN - Subversion Support for Visual Studio 2.7.12815.35086
* Ankh.Package 2.7.12815.35086
* Subversion 1.9.5 via SharpSvn 1.9005.3940.224
* Git/LibGit2 0.24.0 via SharpGit 0.2401.1116.230
SharpSvn is linked to: Apr 1.5.2, Apr-util 1.5.4, Cyrus Sasl 2.1.26, eXpat 2.2.0, LibSSH2 1.8.0, OpenSSL 1.0.2k 26 Jan 2017, Serf 1.3.9, SQLite 3.17.0, Subversion 1.9.5-SharpSvn, Utf8proc 1.1.5, ZLib 1.2.8
SharpSvn is optionally linked to: Berkeley DB 4.4.20, SharpPlink 0.67.0(SharpSvn)
SharpGit is linked to: Apr 1.5.1, Apr-Util 1.5.4, eXpat 2.1.0, Libgit2 0.24.0, LibSSH2 1.7.0, OpenSSL 1.0.2h 3 May 2016, Subversion 1.9.3, Utf8proc 1.1.5, ZLib 1.2.8
Application Insights Tools for Visual Studio Package 8.14.11009.1
Application Insights Tools for Visual Studio
ASP.NET and Web Tools 2017 15.9.04012.0
ASP.NET and Web Tools 2017
ASP.NET Core Razor Language Services 15.8.31590
Provides languages services for ASP.NET Core Razor.
ASP.NET Web Frameworks and Tools 2017 5.2.60913.0
For additional information, visit
Azure App Service Tools v3.0.0 15.9.03024.0
Azure App Service Tools v3.0.0
C# Tools 2.10.0-beta2-63501-03+b9fb1610c87cccc8ceb74a770dba261a58e39c4a
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.
Color Theme Designer 1.0
Designer for creating new color themes
Common Azure Tools 1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.
Extensibility Message Bus 1.1.49 (remotes/origin/d15-8@ee674f3)
Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration.
JavaScript Language Service 2.0
JavaScript Language Service
Microsoft Azure Tools 2.9
Microsoft Azure Tools for Microsoft Visual Studio 2017 - v2.9.10730.2
Microsoft Continuous Delivery Tools for Visual Studio 0.4
Simplifying the configuration of Azure DevOps pipelines from within the Visual Studio IDE.
Microsoft JVM Debugger 1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines
Microsoft Library Manager 1.0
Install client-side libraries easily to any web project
Microsoft MI-Based Debugger 1.0
Provides support for connecting Visual Studio to MI compatible debuggers
Microsoft Visual Studio Tools for Containers 1.1
Develop, run, validate your ASP.NET Core applications in the target environment. F5 your application directly into a container with debugging, or CTRL + F5 to edit & refresh your app without having to rebuild the container.
Mono Debugging for Visual Studio 4.13.11-pre (400cfb1)
Support for debugging Mono processes with Visual Studio.
NuGet Package Manager 4.6.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit
ProjectServicesPackage Extension 1.0
ProjectServicesPackage Visual Studio Extension Detailed Info
ResourcePackage Extension 1.0
ResourcePackage Visual Studio Extension Detailed Info
ResourcePackage Extension 1.0
ResourcePackage Visual Studio Extension Detailed Info
SQL Server Data Tools 15.1.61810.11040
Microsoft SQL Server Data Tools
Telerik ASP.NET AJAX VSExtensions 2018.1.215.2
Progress® Telerik® UI for ASP.NET AJAX Visual Studio extensions
Telerik ASP.NET Core VSExtensions 2018.1.215.2
Progress® Telerik® UI for ASP.NET Core Visual Studio extensions
TypeScript Tools 15.9.20918.2001
TypeScript Tools for Microsoft Visual Studio
Visual Basic Tools 2.10.0-beta2-63501-03+b9fb1610c87cccc8ceb74a770dba261a58e39c4a
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.
Visual F# Tools 10.2 for F# 4.5 15.8.0.0. Commit Hash: 6e26c5bacc8c4201e962f5bdde0a177f82f88691.
Microsoft Visual F# Tools 10.2 for F# 4.5
Visual Studio Code Debug Adapter Host Package 1.0
Interop layer for hosting Visual Studio Code debug adapters in Visual Studio
Visual Studio Tools for Containers 1.0
Visual Studio Tools for Containers
VisualStudio.Mac 1.0
Mac Extension for Visual Studio
Xamarin 4.12.3.73 (d15-9@20b35b881)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.
Xamarin Designer 4.16.5 (6b9f32067)
Visual Studio extension to enable Xamarin Designer tools in Visual Studio.
Xamarin Templates 1.1.127 (e975299)
Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms.
Xamarin.Android SDK 9.1.0.38 (HEAD/61d16aa23)
Xamarin.Android Reference Assemblies and MSBuild support.
Xamarin.iOS and Xamarin.Mac SDK 12.2.1.11 (5ef73d3)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.`
Xamarin Forms 3.x Compatibilty with .NetStandard 2.0
I am trying to create a xamarin forms app using VS2017 15.7 which by default adds .NETStandard 2.0 and Xamarin.Forms 3.0 to the shared library.
The default solution doesnt event compile. It only works when i downgrade Xamarin.Forms to 2.5.
Is Xamarin.Forms 3.x even compatible to .NetStandard 2.0?
Xamarin.Forms navigation won't work when called from event
I also asked this on StackOverflow, but I think it's very specific, so I'll give it a try here:
0
down vote
favorite
I'm using Prism Unity for an App for stock management with a bluetooth scanner. At first I used the scanner in HID mode, but the HID initialisation was painfully slow after the scanner was in sleep mode. So I decided to use Bluetooth SPP, which works a lot better. But I'm running in this error and I can't figure out why it's not working.
The Bluetooth service runs in the background and fires an event my ViewModel is subscibed to. Then a function gets called which verifies the barcode and if successful, navigates to another page.
When you enter the barcode manually, the same function gets called to verify and navigate. The interesting code parts below:
The ViewModel Constructor with subscription to the barcode event:
public ArtikelScannenPageViewModel(INavigationService navigationService, IPageDialogService pageDialog, IEventAggregator eventAggregator)
: base(navigationService)
{
Title = "Artikel scannen";
_navigationService = navigationService;
_pageDialog = pageDialog;
_eventAggregator = eventAggregator;
SubmitCommand = new DelegateCommand(OnSubmit);
System.Diagnostics.Debug.WriteLine("BTDevice:" + (string)App.Current.Properties["BTDevice"]);
_eventAggregator.GetEvent<ScannerEvent>().Subscribe(OnBarcode);
}
This gets called when a barcode gets scanned:
private IEventAggregator _eventAggregator;
void OnBarcode(string param)
{
checkArtikel(param);
}
This gets called when a barcode is entered manually:
public DelegateCommand SubmitCommand { protected set; get; }
public async void OnSubmit()
{
if (!string.IsNullOrEmpty(Artikelnr))
{
checkArtikel(Artikelnr);
}
else
{
await _pageDialog.DisplayAlertAsync("Eingabe", "Bitte Artikelnummer eingeben!", "OK");
}
}
Both, OnSubmit and OnBarcode, use this function:
public async void checkArtikel(string _barcode)
{
DataOperations dop = new DataOperations();
APIOperations.ValidationResponse vr = await dop.GetArtikel(_barcode);
if (vr.Successful)
{
Artikel artikel = (Artikel)vr.Response;
NavigationParameters p = new NavigationParameters();
p.Add("artikel", artikel);
await _navigationService.NavigateAsync(_nextPage, p);
System.Diagnostics.Debug.WriteLine("Navigation fired!");
}
else
{
await _pageDialog.DisplayAlertAsync("Fehler", "Falsche Artikel-Nr. oder Artikel tot!", "OK");
}
}
When it's entered manually, everything works fine. But when OnBarcode is called, the Navigation does not work! It just stays on the page. The checkArtikel function gets called. The DataOperation returns the right "Artikel" and even the "Navigation fired!" appears in the log. How could that be possible? I'm litteraly using the same function? What am I missing here?