Can't get Visual Studio to target the correct Android version - xamarin.android

I have a problem getting Xamarin.Android to target the newest version of Android.
The problem arised when I tried installing the Xamarin.GooglePlayServices.Maps NuGet package, that required me to run at least Android 8.
From my Android SDK manager, I can see that Android 8 and 8.1 is the only SDK platforms installed:
However, when I start a new project in Visual Studio 2017, and go into the project properties, and extend the Compile using Android version dropdown, it's populated like this:
So here I can choose only 7.1 (that is marked as latest platform), and 8.0 and 8.1 is marked with (Requires installation). Android 7.1 SDK that VS uses is not even installed on my machine.
So the questions is: What do I have to do to select Android 8.1 as the Target Framework inside Visual Studio?

What do I have to do to select Android 8.1 as the Target Framework inside Visual Studio?
In your VS, Tools->Android->Android SDK Manager, you will see Android SDK for VS, it default path is C:\Program Files (x86)\Android\android-sdk.
In your AS, Android SDK's path is C:\Users\user name\AppData\Local\Android\Sdk
Now, you can change the VS's Android SDK's path to C:\Users\user name\AppData\Local\Android\Sdk, but we don't suggest you do that, it may cause VS compilation errors at some point, and by then you cannot find the cause of the problem.
So, you can download the Android 8 from VS again.

Related

Cannot get list of iOS simulators in Debug Target from Visual Studio 2022 on Windows

I have the problem that I'm not able to see the list of iOS simulators in Visual Studio Debug Target on my Windows PC
I've just made a total upgrade of my Xamarin development environment including now latest VS 2022, latest OS on my Mac, latest XCode version 14 and latest version of Xamarin on my PC and Mac. I have successfully paired to my Mac from Visual Studio.
On my Mac I've just tried to refresh the list of Debug devices as described in Microsoft Docs:
Delete your ~/Library/Developer/CoreSimulator/Devices folder.
Run killall -9 com.apple.CoreSimulator.CoreSimulatorService.
Run xcrun simctl list devices.
.. but still no result. All I can select in my Debug Target is Local Device, Remote Device and Simulator.
Before this upgrade I had no problem seeing all the simulators.
I will really appreciate if anybody have some good ideas of what I can do to solve this.
Following is my list of installed components from VS About box:
Xamarin 17.3.0.296 (d17-3#a0ff24b)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.
Xamarin Designer 17.3.0.208 (remotes/origin/d17-3#e4f67afef)
Visual Studio extension to enable Xamarin Designer tools in Visual Studio.
Xamarin Templates 17.2.28 (9b3d244)
Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms.
Xamarin.iOS and Xamarin.Mac SDK 15.12.0.2 (87f98a75e)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support
Please be noted that XCode 14 is not yet supported in Xamarin.iOS or .NET MAUI, you need downgrade your Xcode version to 13.4.1 and could download it from the downloads page in the Apple Developer Portal. For more information, you can refer to https://github.com/xamarin/xamarin-macios/issues/15954
Update:
Xcode 14 is currently supported and if there are any other issues, please continue to post back to the GitHub.Thanks!
I have this same issue even after installing VS 17.3.6. I have no list of iOS simulators and I get a warning that this version of Xcode is not supported.

Xamarin target framework is not update

I recently installed android sdk v10 (API 29) in order to set the target framework in my application to v10. But I still can't find it in my application property.
enter image description here
I tried to reload the project but it did not work.
Help?
What's your visual studio version ? Is your Xamarin installation up to date? I suspect that your version of Xamarin.Android is 7.x which means that you won't be able to target Android 8.0 or above even if they are installed through the SDK manager.
You can check the version from Help > About Microsoft Visual Studio

How can I target Android 4.1 in Visual Studio 2019?

I have VS2017 and VS2019 installed side by side on my Windows 10 machine.
I can not compile Xamarin Android 4.1 projects (in VS2019) unless I upgrade them to 4.4 which seems to be the minimum Android SDK version I can target in VS2019. VS2017 compiles fine.
If I create a new Xamarin Android project in VS2019 I can select from 4.4 and above, but in VS2017 I can target right back to 2.3.
Both Visual Studio Xamarin settings are pointing to the same location for the android-sdk (which is on my D: drive, but I did copy it to the standard install location to verify it was not using this as a default, which made no difference)
VS2019 Minimum Android Version
VS2017 Minimum Android Version
Is it possible to target Android 4.1 using VS2019?
Use the following when making decisions with your Android versions:
minSdkVersion (lowest possible) <=
targetSdkVersion == compileSdkVersion/TargetFrameworkVersion (latest SDK)
It's also worthwhile to consider the Android Dashboard to understand how many devices are running a specific version of Android.
https://developer.android.com/about/dashboards
Selecting a higher "Compile using Android version" still lets the project compile.
Under the Android Manifest tab, you can still select the older Minimum and Target Android version allowing VS2019 to be used with this solution/project that uses an older Target Version.
Per the tooltip, Target Framework is only used at runtime.

VS2019 without Windows 8.1 SDK

I'm trying to run an already functional application that requires the Windows 8.1 SDK.
I installed Visual Studio 2019, but there is no option in the 8.1 SDK.
This is for a Windows 10 using Visual Studio 2019 last update.
On my old computer, there was the option to select in "Individual Components", but now no longer the encounter. Does anyone know if there is no such support on VS2019? Or is it necessary to install something more for the support to appear?
This is expected as it is marked as deprecated in Visual Studio 2019:
The Windows 8.1 SDK is no longer available in the Visual Studio
installer. Please upgrade your C++ projects to the latest Windows 10
SDK. If you have a hard dependency on 8.1, you can download it from
the Windows SDK archive.
So download and install the SDK from here.

Build failed with error Remotebuild requires your projects to use cordova-ios 4.3.0 or greater with Xcode 8.3. Please update your cordova-ios version

I am aiming to deploy a mobile application to the iOS platform using codes developed in Visual Studio for an Android phone. I am unable to open the Visual Studio file on my Macbook (macOS High Sierra ver.10.13.6) as Visual Studio here does not seem to support .jsproj files. As such, I have attempted following the instructions in the link below to run a remotebuild on my mac while debugging codes and seeing an iOS simulator on my Windows computer.
https://learn.microsoft.com/en-us/visualstudio/cross-platform/tools-for-cordova/first-steps/ios-guide?view=toolsforcordova-2017#run-on-simulator
I was able to get the remotebuild running, however, I came across the error where it required my projects to use cordova-ios 4.3.0 or greater with Xcode 8.3. As my windows computer does not have Xcode, I turned to my macbook and tried updating and adding the Cordova iOS platform through the terminal, where it said "Current working directory is not a Cordova-based project." I have searched the error up and it said that it required my Visual Studio project to be open, which I am unable to do so as my file is not supported in the Mac version of Visual Studio.
The iOS version in my Windows Visual Studio is currently 4.2.0 and I am unsure how to get about updating it. I have seen the link below but in only applies to Macbook, where I cannot open the Visual Studio project file.
Install specific version of Cordova CLI in Visual Studio 2017
I have installed node.js as well as Git, also attempting to include/update the Cordova iOS platform through the command prompt (Once again unsure if that was the method, but I tried), however, the command prompt did not recognise the update to cordova. Under the toolset in Visual Studio, I have tried ticking on the checkbox under Cordova platforms to take the latest patch, where ~4.2.0 appears, but still does not update.
I am still new to coding and things seem very foreign to me, if I have missed out anything vital or am doing something fatally wrong, please do enlighten me.

Resources