Xamarin.UWP error after upgrading to Xamarin.Forms 3.6 - xamarin.forms

I upgraded to Xamarin.Forms 3.6 and the following error occurs.
System.MissingMethodException: 'Method 'CanvasImageSource.get_SizeInPixels()' from assembly 'Microsoft.Graphics.Canvas' was not included in compilation, but was referenced in ImageRenderer.GetDesiredSize(double, double). There may have been a missing assembly, or a dependency on a more recent Windows SDK release.'
The error occurs on this line:
Absoluate.Layout.SetLayoutBounds(navigationlayout, new Rectangle(0, 0, 1, 46);
In Xaml, navigation layout is
<StackLayout x:Name="navigationlayout" Orientation="Horizontal" AbsoluteLayout.LayoutFlags="WidthProportional">
...
</StackLayout>
I also installed the latest pre-release Xamarin.Forms 4.0.0-pre5 gives the same error.
Reverting back to Xamarin.Forms 3.5.0.169047, the app runs normally.

I found the answer in Github.
(1) In UWP project, install Win2D Nuget package.
(2) In UWP project, set the minimum target to Windows 10, version 1803 (10.0; Build 17134)
Update to Xamarin.Forms 3.6. Viola, the UWP app runs smoothly.

Related

SQLite problems with Android 7.1 & Android 8.0 - Xamarin Forms

SQLite.Net.Standard is not working in Android 8 in Xamarin Forms.
What is the alternative ?
I installed SQLIte.Net.Standard but found i was getting "Unhandled Exception: System.DllNotFoundException: /system/lib/libsqlite.so occurred" at runtime.
Further reading indicated that starting with Android 7, access to this lib was removed or restricted. Supposedly the fix was using a different Nuget package.
SQLite.Net.Platform.XamarinAndroidN
I use the alternative NuGet Package sqlite-net from praeclarum with Android 8 + 9 devices and had no problems so far.
Usage:
var db = new SQLiteConnection(Path.Combine(dbPath, dbFile));
db.CreateTable<YourModel>();
var yourObject = new YourModel();
db.Insert(yourObject);

VS 2017 Community ver and VS 2017 Enterprise debug issue: Found conflicts between different versions

I m having 2 version of VS2017 and a mac with latest macOS.
I transfer my Xamarin forms App file from VS2017 enterprise to a machine(more than 3 years old but running win10 pro) with VS2017 Community version. When I debug ( with selecting Android project and VS-android-23 X86 tablet as emulator ) this App in VS2017 Community version , I have no compilation error but have these message:
Found conflicts between different versions of the same dependent assembly
that could not be resolved.
These reference conflicts are listed in the build log when log verbosity is set to detailed.
I could not understand this message. I have no problem running the same app in VS2017 Enterprize ver but I have this error message in VS2017 Community ver.
Update
Click View > Output --> this will show the error
1>Starting deploy VisualStudio_android-23_x86_tablet ...
1>Starting emulator VisualStudio_android-23_x86_tablet ...
1>C:\Users\xxxxx\AppData\Local\Android\ANDROI~1\tools\emulator.EXE -partition-size 512 -no-boot-anim -avd VisualStudio_android-23_x86_tablet -prop monodroid.avdname=VisualStudio_android-23_x86_tablet
1>emulator: ERROR: x86 emulation currently requires hardware acceleration!
1>Please ensure Intel HAXM is properly installed and usable.
1>CPU acceleration status: Please disable Hyper-V before using the Android Emulator. Start a command prompt as Administrator, run 'bcdedit /set hypervisorlaunchtype off', reboot.
1>Emulator VisualStudio_android-23_x86_tablet cannot be started.
Please help.

Android Awareness Api not compatible with Xamarin Forms

Visual Studio Version:
14.0.25431.01 Update 3
Xamarin.Android Version:
7.0.2.42
Xamarin Forms Version:
Tried 2.3.3.193, 2.3.4.192-pre2 & 2.3.3.180.
Operating System & Version:
Win 10 Pro ver. 1607 build 14393.693
Google Play Services Version:
Xamarin.GooglePlayServices.Awareness ver. 42.1001.0
Describe your Issue:
Xamarin.GooglePlayServices.Awareness doesn't work with Xamarin Forms.
Error:
C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(2072,3): error MSB6006: "java.exe" exited with code 2
Steps to Reproduce:
Create a blank Xamarin Forms project & use Xamarin.GooglePlayServices.Awareness as described in Xamarin's blog post.
This error often caused by dex methods count limits. You should turn on "MultiDex" support in android project settings. Also you should update ProGuard in Android SDK (see Xamarin.Android release notes - https://developer.xamarin.com/releases/android/xamarin.android_7/xamarin.android_7.1/)

VS2013 error: PointCloudLibrary 1.8.0 member pcl::SAC_SAMPLE_SIZE

I am using PointCloudLibrary 1.8.0 RC2 and Visual Studio 2013. When I compiled my project, the following error appeared:
error C4996: 'pcl::SAC_SAMPLE_SIZE': This map is deprecated and is
kept only to prevent breaking existing user code. Starting from PCL
1.8.0 model sample size is a protected member of the SampleConsensusModel class C:\Program
Files\PCL_1_8_0\PCL\include\pcl-1.8\pcl\sample_consensus\model_types.h 100 1
I tried to set "SDL check" to No but this error persists.

Moving to JSON.NET 4.0.3 broke my app

I have a Windows Phone 7.1 (Mango) application that was using JSON.NET 4.0.2.
I upgraded it to 4.0.3 and now I get all kinds of error.
A deserialized class that was working before is now throwing this error :
Could not load type 'System.Dynamic.IDynamicMetaObjectProvider' from assembly 'System.Core, Version=3.7.0.0, Culture=neutral, PublicKeyToken=969DB8053D3322AC'.
I also make use of the Linq feature by using JArray and now I get this message:
{"Could not load type 'Newtonsoft.Json.Linq.JArray' from assembly 'Newtonsoft.Json, Version=4.0.3.0, Culture=neutral, PublicKeyToken=30AD4FE6B2A6AEED'."}
I tried cleaning the solution. I tried copying the DLLs one more time.
Any suggestions?
The problem is that Windows Phone 7.1 defaults to the Silverlight 4 build if no explicit Silverlight 4 WP build is specified. Silverlight 4 has features that aren't available on WP which is why this causes Json.NET to break.
This will be fixed in 4.0.5 by having the current Windows Phone 7.0 dll used for 7.1 but for now to fix the problem just change the dll reference to the Newtonsoft.Json.dll file in the sl3-wp directory.

Resources