Nuget, PCL, sl40 sl4 win8 win profile differences - visual-studio

I have PCL with ".NET 4 and higher, Silverlight 4 and higher, Windows Phone 7 and higher, Windows Store apps (Windows 8)" (from project->properties window).
I have Microsoft.Bcl version 1.1.3 installed.
When I want to update the reference to 1.1.6 I see following.
Install-Package : Could not install package 'Microsoft.Bcl 1.1.6'. You are trying to install this package into a project that targets
'portable-net40+sl40+wp+win', but the package does not contain any assembly references or content files that are compatible with that
framework. For more information, contact the package author.
Looking at packages folder I see following:
./Microsoft.Bcl.1.1.3/lib/portable-net40+sl4+win8+wp71
./Microsoft.Bcl.1.1.6/lib/portable-net40+sl4+win8+wp71
Now the questions:
What is the difference between sl40 and sl4 profile, win8 and win
profile and wp and wp71 profile?
How can I update Microsoft.Bcl 1.1.6 in my project?

Microsoft.Bcl is targeting a later version of Windows Phone than your PCL project which is why it is failing to install.
Framework differences
sl40 and sl4 - same framework
win8 and win - same framework. win means win version 0.0 but NuGet maps this to win8
wp and wp71 - different frameworks. wp means wp version 0.0 but it is equivalent to wp7 by the way NuGet maps the frameworks.
Updating to Microsoft.Bcl 1.1.6
To install Microsoft.Bcl you will need to update your PCL project so it targets wp71 or above. So you can choose to target Windows Phone 7.5 or later or Windows Phone 8 or later.
If you choose Windows Phone 7.5 or later that seems to map to wp71 in Nuget.

Related

Xamarin.Forms UWP project wont install on windows 10 mobile

I am not able to install the appbundle file in windows phone 10
I have tried copying the file on device and also via the winappdeploycmd.exe tool
But nothing works!
If you use .Net Standard 2.0 and Xamarin.Forms 3.0 you can't install the app on Windows 10 Mobile, because .Net Standard 2.0 support was added with the Windows 10 v1709 Build 16299, but Microsoft never released that version for phones. They hang at lower feature2 branch with Build 15254.
So you have 2 options:
use PCL as shared code with Xamarin.Forms 2.5.1 and Min/TargetBuild 14393/15063 to serve both, Desktop/Tablets and phones
create separate brach/app with PCL for mobile (Min/TargetBuild 14393/15063) and 1 app for desktop which uses .net standard 2.0 (Min/TargetBuild 16299/16299) and latest Xamarin.Forms version.

Android Studio for Project Tango

I have downloaded latest Android Studio 2.2.3 and I want to start with C examples for project Tango phone (Lenovo Phab 2 Pro) using C API. The phone itself says it's run Android 6.0.1, kernel 3.10.84 on device.
Google developer documentation for Tango Project suggest to install Android Studio with Android SDK 24.4.1, Platform tools 23.1 and NDK 11.0.0.
By installing latest Android Studio there is no offering to install those versions of tools. Is it possible to use whatever SDK for development (latest)?
Where do I find aforementioned versions?
What Android SDK & NDK version is required for phone which run Android 6.0.1?
I started using the Dev Kit which runs Android 4.4 KitKat and I just recently got the Phab 2 Pro this week and I didn't need to make any updates to my Android Studio SDK manager.
Since I am working only with the Tango and not with the underlying Android features, I have found no need to require 6.0 for I am not using any of the extra features.
Also go here and clone the repo and run the hello-world and see if you can get it to work on your phone, if so you are good to go!
the SDK Manager which is part of Android Studio offers you choices on levels of android builds like 4.4.2/5.1/6.0/6.1, etc. Platform tools package is a module within the SDK Manager which also has levels which are based on the android build. The NDK is a completely different package and depending on what you want to accomplish you might be able to not worry about it to start of with. install Android Studio and then setup the SDK Manager to cover what devices you want to build for. get the latest Platform tools package setup and you will be ready to code. once you start setting up your environment things will fall in place. for the most part the installer does the work. pay attention to the things needed prior to installing Android Studio. i think you need to install a jdk and set paths and variables.

Debug/Emulator getting started with Android using Xamarin

Using VS2015/Windows 10, I created a Blank App (Portable) and set the startup project to Droid. I had only one emulator by default, so I created a Galaxy Nexus/API 23/Intel Atom x86 using the AVD with HAXM.
I can't get this blank project to run on either emulator. When I hit debug, it goes through the motions and starts the emulator but nothing happens. If I run any project beyond the first time after I created a project I get the following error:
System.MissingMethodException: Method
'Android.Support.V4.Widget.DrawerLayout.AddDrawerListener' not found.
http://imgur.com/a/hZNUQ
Frame not in module http://imgur.com/a/KtsRD
This is what I have installed: http://imgur.com/a/iL7Wt
I have installed all the latest updates, the SDK's etc. I would simply like to get started and emulate a HelloWorld app.
UPDATE: still have the issues, here is some more information to track issue.
Microsoft Visual Studio Professional 2015
Version 14.0.25431.01 Update 3
Microsoft .NET Framework
Version 4.6.01586
Microsoft .NET Core Tools (Preview 2) 14.1.21111.0
Microsoft .NET Core Tools (Preview 2)
Xamarin 4.2.1.64 (872717c)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.
Xamarin Inspector Support 1.0.0.0 (1f3067d)
Adds support for inspecting Xamarin and WPF apps.
Xamarin.Android 7.0.2.37 (ce955cc)
Visual Studio extension to enable development for Xamarin.Android.
Xamarin.iOS 10.2.1.5 (44931ae)
Visual Studio extension to enable development for Xamarin.iOS.
Installed Android SDKS:
Android SDK Tools 25.2.3
Android SDK Platform-tools 25.0.1
Android SDK Build-tools 23.0.2, 23.0.1, 22.0.1, 21.1.2
, 19.1
Android 7.1.1 (API 25) - SDK Platform, Google API's Intel x86 ATOM
Android 7.0 (API 24) - SDK Platform, Google API's Intel x86 ATOM
Android 6.0 (API 23) - SDK Platform, Google API's Intel x86 ATOM
Android 5.1.1 (API 22) - SDK Platform, Google API's Intel x86 ATOM
Android 5.0.1 (API 21) - SDK Platform, Google API's Intel x86 ATOM
Android 4.4.1 (API 19) - SDK Platform, Google API's Intel x86 ATOM
http://imgur.com/a/vZZmf
Reproduction steps
1) Create a new Blank PCL project, targetted .NET Framework 4.5
2) Right off the bat I have the following 4 Warning messages
Warning IDE0006 Error encountered while loading the project. Some project features, such as full solution analysis for the failed project and projects that depend on it, have been disabled. App5.Droid 1 Active
Warning The "ResolveLibraryProjectImports" task failed unexpectedly.
System.IO.FileNotFoundException: Could not load assembly 'App5, Version=, Culture=neutral, PublicKeyToken='. Perhaps it doesn't exist in the Mono for Android profile?
File name: 'App5.dll'
at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve(AssemblyNameReference reference, ReaderParameters parameters)
at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve(String fullName, ReaderParameters parameters)
at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve(String fullName)
at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.GetAssembly(String fileName)
at Xamarin.Android.Tasks.ResolveLibraryProjectImports.Extract(ICollection1 jars, ICollection1 resolvedResourceDirectories, ICollection1 resolvedAssetDirectories, ICollection1 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() App5.Droid
Warning Type universe cannot resolve assembly: System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a. App5.UWP
Warning Cannot resolve Assembly or Windows Metadata file 'System.Runtime.dll' App5.UWP D:\Visual Studio 2015\Projects\App5\App5\App5.UWP\App5.UWP.csproj
http://imgur.com/a/EwIQY
3) Right click on the Droid project - properties
Compile using: Use Latest Platform (Android 7.0 Nougat)
Min Android: Android 4.0.3 (API level 15 - Ice Cream Sandwich)
Target Android version: Use compile SDK version
http://imgur.com/a/yZyAv
4) Set startup project as Droid, RUN using AVD_GalaxyNexus_ToolsForApacheCordova (Android 4.4 - API 19)
5) Pop-up message: Running an x86 based Android Virtual Device is 10x faster. We strongly recommend creating a new AVD. Clicked OK
6) Android Emulator Starts. VS15 message bar: 'Deploying AVD' for a long time....then 'Ready' orange bar. Few more minutes and new pop-up opens: 'Find Source: NavigationPageRenderer.cs' ...not sure where this file is/what this file is supposed to be.
http://imgur.com/a/DVYjJ
7) When I click cancel, I get the error message:
System.MissingMethodException: Method 'Android.Support.V4.Widget.DrawerLayout.AddDrawerListener' not found.
http://imgur.com/a/KGvEG
Reproduced same issue on multiple machines
Update: So I just reproduced your issue and I am sorry that you and other ran into this. It looks like there was an issue in the templates and I am working with the team to quickly resolve this.
To fix:
Simply right click on the android project and select "Manage Nuget Packages"
Go to Updates
Find Xamarin.Android.Support.v7.AppCompat
Select version 23.3.0 from the version picker and hit Install
You additionally will need to install the RecyclerView 23.3.0 NuGet Package. Go to Browse and search for: Xamarin.Android.Support.v7.RecyclerView and make sure to pick 23.3.0 to install for the correct version
Now do a full clean/rebuild and it should work
This should install the correct versions of everything you need for Android
So, it looks like you are attempting to create a Blank Xamarin.Forms application, not a traditional Xamarin application.
My first recommendation is to try to just create a blank Android application with Xamarin. This will have very little dependencies and you can see if it starts to deploy out of the box.
Looking at your Installed Android SDKs, I would recommend Uninstalling anything Under Android 7.1.1 (API 25) as it is not supported yet and may be causing issues downloading NuGet packages.
Here is what mine looks like as of today:
Looking at your Warnings I think it will go away once you uninstall API 25, not sure why that is getting installed unless you maybe already installed Android Studio?
Also, if you are targting API 24+ you'll have to install the Java JDK 1.8. I would suggest removing 1.7 unless you need to use previous versions. The release notes for Xamarin.Android 7.0 have more information as well: https://developer.xamarin.com/releases/android/xamarin.android_7/xamarin.android_7.0/
Note: Xamarin.Android 7.0 requires JDK 1.8 to use the Android Nougat (API 24) APIs. You can continue to use earlier versions of the JDK if targeting earlier Android API levels:
JDK 1.8 - up to API 24+ JDK 1.7 - up to API 23 JDK 1.6 - up to API 20 Additionally, a 64-bit version of the JDK is required to use custom controls in the Android designer.
I wrote a big blog on setup here: http://motzcod.es/post/150380059392/preparing-machines-for-xamarin-cycle if things aren't configure properly.
Try to do a New project at this point and it will re-download all the NuGets and such properly.
As for System.ObjectModel warning, you can remove it from the References and it shouldn't be needed.

ADAL 3 Windown 8.1 App Nuget Update failing

My Windows 8.1 app is using ADAL 2.11.10918.1222 without a problem. I wanted to update to ADAL 3.x using NuGet package manager but it is failing with this error:
Failed to add reference to 'Microsoft.IdentityModel.Clients.ActiveDirectory'
I compared the Microsoft.IdentityModel.Clients.ActiveDirectory.3.10.305231913 package folder with the older version and realized in ADAL 3 package all libraries have Dll extension whicle in ADAL 2 libraries that I use are winmd files.
Has anyone tried to upgrade ADAL for Windows 8.1 solution? Is ADAL 3 supported for Windows 8.1 Apps? I am using Visual Studio 2015 with all updates installed
ADAL v3 does not support Winmd anymore. It only provides class library now.

Automapper has lost pcl compatibility

I'm using Automapper in a PCL for 3 years and everything was working well.
But since version 4.2.1 when I try to install it in a PCL I get the following error:
Could not install package 'AutoMapper 4.2.1'.
You are trying to install this package into a project that targets
'portable-net45+win+wp80+MonoTouch10+MonoAndroid10+xamarinmac20+xamarinios10',
but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.
Is there something new that I'm missing?
Thanks guys
AutoMapper 4.2.1 does not support Windows Phone 8 (wp80). Here wp80 is the Silverlight based Windows Phone target framework. So your portable class library project's profile is incompatible. Looking at AutoMapper 4.2.1 the NuGet package has a PCL directory of:
portable-net45+win+wpa81+MonoAndroid10+Xamarin.iOS10+MonoTouch10
The Xamarin and Mono frameworks are optional so the PCL profile is basically:
net45+win+wpa81
So that is a profile that supports .NET 4.5, Windows 8 and Windows Phone Applications 8.1. Here wpa81 is the WinRT based Windows Phone target framework. This PCL profile seems to be Profile111.
So in order to use AutoMapper 4.2.1 you will need to change your PCL project's profile. Your current profile seems to be Profile78. If you switch to Profile111 or another compatible profile then you should be able to install AutoMapper 4.2.1.
Alternatively you can use an older version of AutoMapper. AutoMapper 4.1.0 targets:
net45+win+wpa81+wp8+MonoAndroid10+Xamarin.iOS10+MonoTouch10
Which supports Profile78. So it looks like the latest AutoMapper has dropped support for Windows Phone 8 (Silverlight).

Resources