Visual Studio not showing installed Android api levels - android

I am developing an Android app in Visual Studio. In the Android SDK manager, all API's from API level 23 (Android 6.0) to API level 25 (Android 7.1) are installed.
But when I open the project properties in Visual Studio, the "Compile using Android version" option is showing apis only till 23(Android 6.0). I want to target 7.1 as most of the smartphones will now have it.
There are another problem if I go with Android 6.0. Some packages like Xamarin.Firebase.Messaging fails to install with the following error.
Install-Package: Could not install package 'Xamarin.Firebase.Messaging 42.1001.0'.
You are trying to install this package into a
project that targets 'MonoAndroid,Version=v6.0', 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.
I can see that all options available under API level 25 are installed in SDK manager. Kindly help me so that i can target Android 7.1 from the Visual Studio Android app. Thanks

Is your Xamarin installation up to date? I suspect that your version of Xamarin.Android is 6.x which means that you won't be able to target Android 7.0 or 7.1 even if they are installed through the SDK manager. You can check the version from Help > About Microsoft Visual Studio.
For example, my version is 7.1.0.19 and I'm able to target Androd 7.1 just fine.
To check for updates, you should open Tools > Options > Xamarin > Other and click Check now.
Update for Visual Studio 2017:
If you're using Visual Studio 2017 or newer, Xamarin updates are delivered as part of Visual Studio updates. To manually check for updates, go to Tools > Extensions and Updates... In the left hand menu, open Updates and select Product Updates. If there are updates available, they will be shown on this list.

In Visual Studio 2017 preview there is an improved Google Android emulation support with a new Android emulator that's built into Visual Studio (this supercedes the Visual Studio Emulator for Android):
I checked it this morning and it had Android emulators up to API 27 including Oreo.
However, I did try to trigger API 28 P-Type even switching the SDK Manager from the Microsoft repository to the Google repository but it still didn't show up, but, at least you got everything you need up to API 27.
References:
https://www.visualstudio.com/vs/preview/
https://blog.xamarin.com/3-reasons-to-try-visual-studio-2017-version-15-4-previews/

Related

Xamarin; Android 11.0 SDK is not available in Visual Studio; Target Framework

In a computer, I have installed Android 11.0 SDK for a Visual Studio 2019 Community installation and my Xamarin Android app is compiled correctly using this SDK. The SDK was installed automatically:
Then I installed Visual Studio 2019 Community in another computer to compile my app there. But it seems the Android 11.0 SDK is no longer available:
It is not installed automatically and I cannot find anywhere to install it manually. What's wrong and how can I install Android 11.0 SDK on Visual Studio?
After long searching and none of the solutions were working for me, i've found that the SDK can also be installed with the VS Installer.
The API level 30 (Android 11) was nowhere to be found to install, nor VS SDK Manager nor Android Studio SDK Manager (the AS SDK Manager didn't even work, could not load any SDK's)
(See screenshots)
Go to VS Installer -> Modify VS version
-> Go to tab 'Individual Components' -> Search for SDK API level 30 -> Select and install
After the first login you'll probably need to accept SDK licenses again as I had to.
Hope this helps anyone who, like me, did not find any other solution working
PS: I did update VS to its latest version before doing this, not sure if this is mandatory or not since I was on 16.10 before but if this doesn't work, try updating VS itself first.
As of now Android 11 is not officially supported in Visual Studio.
So you have two options:
Select to use unofficial repositories in that dialog
Wait for the version 16.9 where it is supposed to be supported.

Visual Studio 2017 - SDK and AVD wont open

So i have installed Visual Studio 2017 Community version for my windows 7 laptop. The installation completed with an error log that said that it had failed to download the Android Emulator for it.
Now, when i try to click on The AVD Manager or the SDK - both do nothing at all (no feedback too).
When i try to do a repair or modify - VS will tell "Setup Operation Failed".
I have search online for the Android Emulator only package - but all found were compatible with windows 8 or more.
I have looked online, and some people still have this problem - but no solution.
I would appreciate any help.
Thanks!
Error log bit:
The product failed to install the listed workloads and components due to one or more package failures.
Incomplete workloads
Mobile development with .NET (Microsoft.VisualStudio.Workload.NetCrossPlat,version=15.0.26403.0)
Incomplete components
Android NDK (R13B) (Component.Android.NDK.R13B,version=13.1.6)
Android SDK setup (API level 23) (Component.Android.SDK23,version=15.0.26208.0)
Google Android Emulator (API Level 23) (Component.Google.Android.Emulator.API23.V2,version=15.0.26208.0)
Intel Hardware Accelerated Execution Manager (HAXM) (Component.HAXM,version=15.0.26208.0)
Google recently released Android SDK Tools 26.0.1(March 2017) that comes with the Android Studio 2.3.1(April 2017) update. This version of Android SDK Tools deprecates the android program in the tools folder.
Because of this deprecation, the SDK Manager and AVD Manager stand-alone programs will no longer work when invoking them from the respective IDE menus. Rather Google has recommended that users now use the CLI tooling.
LINK

which android studio version have Android 5.1 (API level 22)?

I have downloaded some projects of android apk to learn from it ..
i try to open it using the latest version of android studio (2.2.3) , but it's take too long time and then stop ,I looked for a solution to this problem and found that these applications were built on previous versions of the sdk So to solve this problem, I should use an earlier version of Android Studio, so I want to know what is the Android studio version which have Android 5.1 (API level 22).
You can have a single installation of Android Studio and all the SDKs you want to use (partially or fully installed)
You have to download the sdk via sdk manager download the latest sdk

Object reference not set to an instance of an object When I create new Android App (Visual Studio)

In a Visual Studio 2015, Xamarin, Android SDK, jdk 1.7, and emulator are installed and Xamarin has all green checked items in tools>options>Xamarin. But When I try to create Blank App (Android) VS shows an error:
Object reference not set to an instance of an object
Then new project fail to create and solution explorer will be empty.
How could I solve it?
I solved it with updated Android SDK setup (API Level 19 and 21) [3rd party] to Android SDK setup (API Level 22) [3rd party] in Visual Studio setup.
I had the same problem and when I installed Android 4.4.2(API 19) from
Android SDK Manager the issue got resolved. You can open Android SDK Manager in
VS2015 with Update 2 by navigating to Tools-> Android->Android SDK Manager
I figured out this...
Depending on the emulators you want to use with the new project, subject to what is installed using Android AVD, you will need to download the necessary API Level.
Example.
I looked up my emulators.
Then I simply opened Android SDK Manager and downloaded the corresponding API Level 19
And everything worked out well
I also encounter this problem on Visual Studio 2015 Update 2 with Xamarin.VisualStudio_4.0.3.214, but I solved it by installing level 19, 21, 22, 23 through Android SDK Manager.
I struggle with this same problem for a whole day but I got it resolved after several iterations.
Make sure Android Studio is not installed on your computer. If it is, uninstall it and run the VS2015 installer again until all Android SDK errors go away.
Make sure VS2015 is closed and install the most recent stable version of Xamarin for Visual Studio 2015. I found it here: https://store.xamarin.com/account/my/subscription/downloads. (Trying to install it through VS2015 didn't work for me under Tools -> Android -> Settings -> Xamarin for Visual Studio Updates.)
Make sure you have Java SDK version 7 installed on your machine (do not use 8 even though its the latest). You also must use the 32-bit version even if you have a 64-bit machine. This was key!
Install the Android SDK. Standalone version, not Android Studio + Android SDK.
Install the Android NDK.
Restart your computer and open VS2015. Go to Tools -> Android -> Settings and set the correct paths to Android SDK, NDK and Java SDK.
You should be good to go with creating a new project. You are all welcome!!!

Android plugin for Eclipse gets stuck at application name

When using the Eclipse plugin, I get stuck at this step...
What's going on..? I did enter a name.
Since the Build SDK field is blank, this indicates you have installed part of the SDK, but none of the SDK Platforms. You need to have one or more SDK Platforms installed as well. Each of these has an API Level and Android version (e.g., Android 4.1 (API 16).
In Eclipse, go to Window -> Android SDK Manager. Select one or more SDK Platforms to install. As an example, the SDK Manager on my system shows shows several SDK Platforms are installed. Here's a partial view:
Note the various versions of the SDK Platform have a status of "Installed"

Categories

Resources