Since vs2015, visual studio has gradually built-in support for cross-platform development, And the visual studio team also released an additional compilation tool set clang with microsoft codegen, which is convenient for developers to develop cross-platform code. The toolkit's clang version number used in vs 2015 update 2 is 3.7. At the same time, the mobile development capabilities of vs are no longer limited to windows phones, but support the application development of mainstream platforms including android, ios. As other new features were first introduced, Although it has undergone two updates, it is still inevitable that some "bugs" still exist. This article summarizes some problems encountered during the construction process. Not updated regularly.

1.Although visual c++ android development can be checked during installation, the offline installation package iso of visual studio 2015 with update 2 does not completely include android SDK, android ndk, apache ant and other packages, so you need to download online, However, it is limited by the domestic network environment. After the installation is complete, you will most likely receive a warning that the download failed. If this is the case, you will need to download the installation package and configure it manually. Otherwise you will encounter errors such as argument "sdklocation" is null or empty;aapt.exe could not be found at ".".

Here are some domestic mirror addresses used by the author:

Except for the manual installation steps of android sdk (the android sdk tools, platform-tools, build-tools, etc. are required), the rest is basically a zip and unzip it. Finally, the address needs to be configured under vs2015->tools->options->cross platform, Specifically see the picture:

2.If stuck on java, android, etc. for a long time during installation, Don't worry about canceling, use the taskbar manager to end the secondary installer related processes, Then the installation can continue without affecting the installation of other components, Later, install the required related components separately.

Here the author is stuck in Microsoft Visual Studio Emulator for Android when installing vs2015, it is recommended to skip this module and finally download the installation package of the simulator separately.If the emulator is installed and fails to roll back at the end,Check if your computer is turned on or supports hyper-v features, such as win8 home edition.

3.After the above steps are completed, you can basically write the android program. But if you develop a native-activity application using C++, you may get the following similar errors during build:

trk0005:failed to locate:"clang.exe". the system cannot find the file specified


These problems are caused by the appropriate clang version that is not included in the ndk you installed. Note that vs2015 with update 2 only has built-in support for clang 3.6. If you don't want to configure the tool platform, Then it is recommended that you directly download the ndk of this version of android-ndk-r10e-windows-x86.zip, because the previous versions of android-ndk-r10e and later versions of android-ndk-r11 are not built in clang 3.6. One more detail, If you downloaded android-ndk-r10e-windows-x86_64.zip, then you also need to rename \ android-ndk-r10e \ toolchains \ llvm-3.6 \ prebuilt \ windows-x86_64 to \ android-ndk-r10e \ toolchains \ llvm-3.6 \ prebuilt \ windows.

4. If you use Microsoft Visual Studio Emulator for Android, and choose to configure the network for the emulator, Then you may encounter the following error:

xde exit code:unknown (-532462766)
unhandled exception. exception info:system.management.managementexception

The above error was reflected in the log file where the simulator failed to start,This is because the virtual switch of hyper-v is not configured properly. And at this time open the hyper-v manager->virtual switch manger ... you will most likely receive the following prompt

an error occurred while trying to retrieve a list of virtual switches

As for what is wrong with this error,The solution is to completely uninstall the Microsoft Visual Studio Emulator for Android and Hyper-V, restart, install Hyper-V (note that all must be checked), restart, and then install the emulator (and restart?), then this time Can start the simulator normally, Since the installation of windows features basically requires a restart to complete, So don't bother to skip the restart!

The next step is to use vs2015 to debug with the simulator.But the problem is not over.You may encounter "could not locate the android debug bridge (adb.exe)." When you deploy, then the device list of vs suddenly becomes "no available devices"

It seems that adb.exe cannot be found. It seems that it is not enough to configure the android sdk path in vs. Find the following solutions and solve them successfully:

Open Registry Manager,Locate hkey_local_machine \ software \ wow6432node \ android sdk tools, modify the path value to your sdk path, if not, Create a new key android sdk tools, and add a string value named path

Note that the cause of no available devices may also be the startup sequence of adb.exe and vs. This also exists in eclipse.

  • Previous PHP implementation of 301 redirect jump example code
  • Next Yii2 framework dropDownList drop-down menu usage example analysis