How to build for Android?


#1

I wanted to create project for Android, but it says that platform doesn’t fit this build target. And I can’t find out where to setup external tools (Android SDK, Java).


#2

You need to install Xamarin to build for Android.


#3

Done, but still the same.


#4

How did you install Xamarin? Did you install it from Visual Studio. I had the same problem until I installed Xamarin from the standalone installer (i.e not from VS installer).


#5

Hi,

I’m having the same problem. I created the Android build target anyway, but when I try to build the android package I get this error:
[C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(539,2)]: Error: The “GetJavaPlatformJar” task was not given a value for the required parameter “AndroidSdkDirectory”.

I’m using vs community 2017, and I did install Xamarin using the VS installer. I can’t seem to find a stand-alone installer for Xamarin either, all the download links lead to a download of the VS installer.

Would appreciate any suggestions.

Regards


#6

Which options under “Mobile development with .NET” did you select in the VS installer?


#7

I used the standard install options, no modification:

  • Xamarin
  • Xamarin Workbooks
  • Google Android Emulator (API Level 23)
  • Intel HAXM
  • Android NDK (R13B)
  • Android SDK setup (API level 23)
  • Java SE Development Kit (8.0.1120.15)

Should I activate any additional options you think?


#8

I ran all updates in the SDK manager, no change.
Also switched to the 32bit version of NDK R13B, no dice.

Any suggersions appreciated.


#9

Update: With of VS 2017 Enterprise installed with default options it works fine. There is seemingly a problem with the VS community installer, but I’m not man enough to figure out what…

Next problem is that the template Xenko game crashes when android-emulated, before even the first frame is shown.


#10

Emulators don’t work well with Xenko. They have a lot of issues. It is best to debug on an actual device anyway.


#11

Yea, I’m not surprised. But is that really a Xenko-problem though, or is it universal for Xamarin?
I’ve never used Xamarin before, but it appears a bit of a dangerous magic black-box to me. Code once, debug everywhere …


#12

Why my empty android apk that build by xenko is so big ?
Does Anyone have come into this problem ?