VS2015 Update2 build Android program problem summary, vs2015android
Since VS2015, Visual Studio has gradually been built into support for cross-platform development, and the Visual Studio team has also released an additional compilation tool set Clang with Microsoft CodeGen to facilitate developers to develop cross-platform code, the Clang version used in the tool set VS 2015 Update 2 is 3.7. at the same time, VS's mobile development capabilities are no longer limited to Windows Phone, but support application development on mainstream platforms including Android and iOS. similar to the introduction of other new features for the first time, although there have been two updates, there are still some 'bugs. This article will summarize some problems encountered during the setup process, update from time to time.
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 contain Android SDK, Android NDK, and Apache Ant, therefore, you need to download the package online. However, due to the limitation of the domestic network environment, you may receive a warning that the download fails after the installation is complete. If so, you need to download the installation package and configure it manually, otherwise, you will encounter problems such as Argument 'sdklocation' is null or empty; aapt.exe cocould not be found '. 'and other errors.
Here we provide some domestic image addresses used by the author:
Http://ubuntu.buct.edu.cn/android/repository/
Http://mirrors.neusoft.edu.cn/android/repository/
Http://mirrors.hust.edu.cn/apache/ant/binaries/
In addition to the manual installation steps of the Android SDK, such as Android SDK Tools, Platform-tools, and Build-tools, the other steps are simply a zip file. finally, you need to configure the address in VS2015-> Tools-> Options-> Cross Platform, as shown in the figure:
2. if the installation is stuck in Java and Android for a long time, you don't have to worry about Cancel. Use the taskbar manager to end the Secondary Installer-related process. Then, the installation will continue without affecting the installation of other components, then install the required components separately.
When installing VS2015, the author stops at Microsoft Visual Studio Emulator for Android. We recommend that you skip this module and finally download the installation package of the simulator separately, if you fail to roll back after installing the simulator, check whether your computer has enabled or supports the Hyper-V feature. For example, win8 home edition does not.
3. After completing the above steps, you can write the Android program. However, if you use C ++ to develop the Native-Activity Application, you may get the following errors during Build:
TRK0005: Failed to locate: Failed clang.exe ". The system cannot find the file specified
TRACKER
These problems are caused by the fact that the installed NDK does not contain a suitable Clang version. Note that VS2015 with Update 2 only has built-in support for Clang 3.6. If you do not want to configure the tool platform, I suggest you directly download android-ndk-r10e-windows-x86.zip this version of ndk, because the android-ndk-r10e version before and after the android-ndk-r11 and other versions of built-in Clang are not 3.6 version. then there is a detail here, if you download android-ndk-r10e-windows-x86_64.zip, then you also need to rename \ android-ndk-r10e \ toolchains \ llvm-3.6 \ prebuilt \ windows-x86_64 \ toolchains \ android-ndk-r10e \ prebuilt \ windows.
4. If you use Microsoft Visual Studio Emulator for Android and select to configure the network for the simulator, you may encounter the following error:
XDE Exit Code: Unknown (-532462766)unhandled exception. Exception Info: System.Management.ManagementException
The above error is reflected in the log file of the simulator startup failure. This is because the Hyper-V vswitch is not configured properly, in this case, enable Hyper-V Manager-> Virtual Switch Manger... you will probably receive the following prompt
An error occurred while trying to retrieve a list of virtual switches
As for what this error is, the solution is to completely remove Microsoft Visual Studio Emulator for Android and Hyper-V, restart, install Hyper-V (Check all options), and restart, then install the simulator (and restart ?), At this time, the simulator can be started normally, because windows features installation basically needs to be restarted to complete, so do not bother to skip the restart!
The next step is to use VS2015 with the simulator for debugging, but the problem is not complete yet. during deployment, you may encounter "cocould not locate the Android Debug Bridge (adb.exe ). ", then the device list of VS suddenly becomes" no available devices"
It seems that the Android SDK Path in VS is not enough. After searching, find the following solution and solve it successfully:
Open the Registry Manager, locate HKEY_LOCAL_MACHINE \ SOFTWARE \ Wow6432Node \ Android SDK Tools, and modify the Path value to your SDK Path. If not, create the key Android SDK Tools, then add the String Value named Path (String Value)
Note that the original cause of no available devicescan also be the startup order of adb.exe and VS, which also exists in eclipse.