Google API target not available in AVD Manager - google-api

I am newbie in android development. I want to configure my AVD target to Google API, but I just realized that I have only Android target in the AVD manager.
What should I do?
Thanks

Related

Why am I having trouble with the Android Emulator in VS Comm 2017?

I was having trouble using the Android emulator in Visual Studio Community 2017 and I decided to create a blank project to see if it will run. I get this error message when attempting to run it in the Live Xamarin Player:
Starting Android Emulator Android_Accelerated_x86_Nougat...
Failed to boot Android device emulator-5554...
Unable to deploy to Android_Accelerated_x86_Nougat, please ensure the Xamarin
Live Player app is open and the device is on the same network as Visual Studio.
Why would I have trouble running the emulator in a fresh blank project when I didn't even write a single line of code? Thanks for your help.
UPDATE: So I installed the latest Android SDK 8.0 along with they system image and tried to create a virtual device that uses it. But the Android Virtual Device Manager shows a, 'No system images installed' message when I selected the 8.0 framework. So I installed an earlier version of the SDK along with a system image (5) and was able to create a virtual device with it. So another question is why wouldn't the system images show up for the 8.0 framework?
The $(TargetFrameworkVersion) for Xamarin.Forms.Platform.Android.dll
(vv8.0) is greater than the $(TargetFrameworkVersion) for your project
(v7.1). You need to increase the $(TargetFrameworkVersion) for your
project
This means the Xamarin.Forms library is targeting Android 8.0 (API level 26) but your project is setup for Android 7.1 (API level 25). You can't change the Xamarin.Forms target version without downgrading, but you can change your project target version easily. You can learn more about these concepts from Xamarin. Be aware some of the details of that Xamarin blog post are already out of date!
There is another nice blog post from Xamarin which can walk you through the process of setting your system up for Android 8.0 API level 26. It's normally not this complicated, but Google changed their SDK tools internally between 25 and 26 in very major ways. They changed from GUI tools to command line tools.
You'll probably also want to get the (in preview) Xamarin Android Device Manager if you don't have a physical device to test with. This Xamarin Android Device Manager tool is the only way to create and configure API 26 and higher emulators without using the Google command line tools.
It seems as though Google has gotten rid of the GUI apps that manage the SDK and Virtual Devices in the latest version, so when you try to create a new virtual device with 8.0 it's not compatible with the GUI tools. Until Xamarin releases a GUI tool to replace them we can use the command-line to manage the SDK and virtual devices.
https://learn.microsoft.com/en-us/xamarin/android/troubleshooting/sdk-cli-tooling-changes
https://developer.android.com/studio/command-line/avdmanager.html

Impossible to create an Android Virtual Device for Android 7.0+ in Visual Studio for Mac?

This is how the Xamarin SDK Manager looked when Visual Studio for Mac was first installed. Only Android 6.0 items were downloaded/installed, and only the items pictured were installed:
By default, an Android Virtual Device called “Android_Accelerated_x86” was preconfigured and available for use when I installed Visual Studio for Mac and updated Xamarin. As far as I can tell, it is an AVD created using the “Google APIs Intel x86 Atom System Image” from the above screenshot, using Android 6.0.
I am able to debug to this Android_Accelerated_86 AVD, with a Xamarin project. It works fine as expected.
I now want to create an AVD using Android 7.1. What I did was in Visual Studio for Mac, I opened the xamarin SDK Manager, and downloaded the following items (checked in the picture):
You can see I downloaded the similarly-named “Google APIs x86 Atom System Image” for Android 7.1, as was preinstalled automatically with Visual Studio for Mac for Android 6.0.
In theory, I would think this should be all I need to be able to create a new virtual device. In visual studioI go to Tools > Google Emulator Manager, and I click "Create..." to try and create a virtual device. For Device, I've tried picking Nexus 10, Nexus 9, Nexus One, 10.1" WXGA Tablet, etc. No matter what Device I pick, if I pick a Target of Android 7.0. 7.1, or 8.0, the CPU/ABI section says "no system images installed for this target". Also, if I pick a target of “Android 6.0 – API Level 23”, it says that “no system images installed for this target”, just like it did for Android 7.0 and higher.
The ONLY way I can create a new virtual device is by picking a Target of “Google APIs (Google Inc.) - API Level 23”, and then it will let me choose “Google APIs Intel Atom (x86)”, and I assume this is because I have the “Google APIs Intel x86 Atom Image” installed from the Android 6.0 section. But I have that corresponding image installed for the Android 7.1 version as well, so why can’t I at the very least pick a target of Android 7.1 and also be given a CPU/ABI choice of “Google APIs Intel x86 Atom image”? I have the same image type as is installed for Android 6.0!
I've tried this on two different machines, with the exact same results. I've also tried downloading appropriate images for Android 7.0 and 8.0, and am still having the same problem - I can't create Android AVDs past Android version 6.0. Has anyone successfully used the SDK Manager and Google Emulator Manager to configure an AVD with Android 7.0 or later? All existing discussions about this type of problem that I can find only show Android 6.0 or earlier. I also tested this with the most recent version of Visual Studio for Mac, and have fully updated all my Xamarin components via the stable auto-update channels.
Visual Studio for Mac (VS4M) uses the Android Emulator Manager within Android SDK Tools version 25. That version from Google does not support later Android Virtual Devices AVD APIs.
If you upgrade your Android tools version to the latest version (currently 27.01), you will receive this message when trying to open the Google Emulator Manager from the VS4M's Tool menu:
As it states, the latest version of the Google Android tools has removed the standalone GUI for creating AVDs.
So you can create them via the cmd-line using avdmanager which is located within your Android SDK (android-sdk-macosx/tools/bin).
❯ ./avdmanager
Usage:
avdmanager [global options] [action] [action options]
Global options:
-s --silent : Silent mode, shows errors only.
-v --verbose : Verbose mode, shows errors, warnings and all messages.
--clear-cache: Clear the SDK Manager repository manifest cache.
-h --help : Help on a specific command.
Valid actions are composed of a verb and an optional direct object:
- list : Lists existing targets or virtual devices.
- list avd : Lists existing Android Virtual Devices.
- list target : Lists existing targets.
- list device : Lists existing devices.
- create avd : Creates a new Android Virtual Device.
- move avd : Moves or renames an Android Virtual Device.
- delete avd : Deletes an Android Virtual Device.
Personally I use the one that replaced it and that is within the Android Studio (Tools / Android / AVD Manager):
To use this one does mean that you need to download the full Android Studio dmg but I already use it for writing/compiling Java libraries for Xamarin.Android binding libraries, access to Android Instant Apps tools, etc... Also its Android SDK Platform and Tools manager is "better" than Xamarin's (IMHO/Its a personal preference thing...).

Xamarin Android Emulator with Maps

I want to run local test of an app using the Android Emulator within Visual Studio 17. It works great using the Visual Studio Emulator for Android and the app is almost complete.
However I need to add a map with a few pins and I have this working and tested on my PC using the UWP app. However trying to run on the Android emulator there is no Maps as there is no play store.
I have googled lots and found lots of things to try but none seem to work and I notice that the latest of all the pages and blogs I have read are dated 2015 so in software terms and indeed Xamarin they are very old.
So if I want to test the maps part of my app what is the best way if I can't get the Emulator to run with maps or am I missing some fancy new tool to test with other than shipping the app and hoping that it works in the wild?
Thanks
Cliff.
You cannot see the map as Visual studio emulators for Android do not have google play services installed by default. In order to test and see your map, you should install google play services in the android emulator.
You can do this by installing gapps on your emulator which provides you with google play services functionallity. The installation is just a drag and drop in the emulator. After installing this packge, you could use maps on the emulator.
I would create a new Android VM in that process you can tell it to add the google store to the android VM

How to install Google Play Service in Xamarin Android Player

How to install Google Play Service in Xamarin Android Player. I have found the link https://university.xamarin.com/resources/how-to-install-google-play-on-android-emulator which does not work in windows. It does not allow me to drop the Google Play Services .zip file from www.teamandroid.com/gapps/ .Any suggestion or link please.
Thanks!
I would recommend to use the android emulator that ships with the current version of Android Studio (by now 2.1). Google did a good job and a major overhaul with that version. It now is as fast as Genymotion or the Xamarin Android Player. Plus it as Google services support build in.

Fail to create Android virtual Device, "No system image installed for this Target"

Unable to create Android Virtual Device
i follwed this link.
I installed all ARM images for each Android more than 4.0.
I installed intel & MIPs as well.
But, still my AVD Manager is saying "NO System images installed for this target".
why, so?
In order to create an Android Wear emulator you need to follow the instructions below:
If your version of Android SDK Tools is lower than 22.6, you must update
Under Android 4.4.2, select Android Wear ARM EABI v7a System Image and install it.
Under Extras, ensure that you have the latest version of the Android Support Library. If an update is available, select Android Support Library. If you're using Android Studio, also select Android Support Repository.
Below is the snapshot of what it should look like:
Then you must check the following in order to create a Wearable AVD:
For the Device, select Android Wear Square or Android Wear Round.
For the Target, select Android 4.4.2 - API Level 19 (or higher, otherwise corresponding system image will not show up.).
For the CPU/ABI, select Android Wear ARM (armeabi-v7a).
For the Skin, select AndroidWearSquare or AndroidWearRound.
Leave all other options set to their defaults and click OK.
Then you are good to go. For more information you can always refer to the developer site.
As a workaround, go to sdk installation directory and perform the following steps:
Navigate to system-images/android-19/default
Move everything in there to system-images/android-19/
The directory structure should look like this:
And it should work!
If you use Android Studio .Open the SDK-Manager, checked "Show Package Details" you will find out "Android Wear ARM EABI v7a System Image" download it , success !
I had android sdk and android studio installed separately in my system. Android studio had installed its own sdk. After I deleted the stand-alone android sdk, the issue of "“No system image installed for this Target” was gone.

Resources