2
votes

I've never struggled with anything in programming as much as this Xamarin installation, unbelievably flakey. I've got my environment (VS 2015 Enterprise) to a point whereby I can spin up a new Blank App (Android) but the designer requires a newer version of the Android SDK (apparently):

enter image description here

I've only just installed the latest Android Studio, so I can confirm (in Xamarin settings) I'm pointing to the correct path for the SDK (in AppData/Local etc.)

On opening the SDK manager I can see the latest SDK tools is installed.

Please note: I've also tried running the SDK manager independently of VS (and as admin).

Never had this much trouble trying to get something installed and configured. Any help MASSIVELY appreciated.

Whoever helps me crack this gets a massive bounty.

EDIT:

Found this in the logs, fairly certain this is the issue:

Xamarin.VisualStudio.Android.MonoAndroidDesignerPane Error: 0 : [2016-09-22 16:36:54.2716] System.AggregateException: One or more errors occurred. ---> System.NullReferenceException: Object reference not set to an instance of an object. at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add) at Xamarin.VisualStudio.Android.Designer.MonoAndroidDesignerDocumentCache.Push(String filePath, AndroidDesignerDocumentCacheItem value) in C:\data\lanes\3513\c4382f51\source\xamarinvs\src\Core\VisualStudio.Android\Designer\MonoAndroidDesignerDocumentCache.cs:line 25 at Xamarin.VisualStudio.Android.MonoAndroidDesignerPane.OpenViewCode() in C:\data\lanes\3513\c4382f51\source\xamarinvs\src\Core\VisualStudio.Android\Designer\MonoAndroidDesignerPane.cs:line 619 at Xamarin.VisualStudio.Android.MonoAndroidDesignerPane.b__66_0() in C:\data\lanes\3513\c4382f51\source\xamarinvs\src\Core\VisualStudio.Android\Designer\MonoAndroidDesignerPane.cs:line 612

EDIT

Bounty is for Jon when it allows me to award it. This issue has already been resolved.

2
What is your java version? - Milen
Do you have the same problem if you run Visual Studio in administrator mode? - GBoehm
@GBoehm - yes, I always run as admin (I've tried without too though). Thanks for your reply. - user1017882
You'll need java 1.8 for android 7 - Milen
Can you post an archive of your logs? Log files can be gathered from %LOCALAPPDATA%\Xamarin\Log Or you can use the Help->Xamarin->Zip Logs(7 days). My best guess here is that you have an old Android SDK reference in your project. Please also post a diagnostic build output: blogs.msdn.com/b/msbuild/archive/2005/09/29/475157.aspx (VS) - Jon Douglas

2 Answers

2
votes

Try to delete your obj/bin folders as it seems you might have an AndroidSdksCache holding the old version. Specifically look for a file here obj\Debug\sdks.cache.

The second note is that you have build-tools 23.0.0 installed. Please uninstall that version and any other old version and install 24.0.2.

It shows the current directory as being C:\sdk1\ when the referenced SDK version is different in your screenshot. You will need to update C:\sdk1\ to the latest Android SDK Tools.

0
votes

I think that can be many things.

1) some time your user name in your PC if have character specials like accents or spaces. Make problems with the VS.

2) you need check if you install Visual studio Emulator android. After donwload a device and check the api that have that device.

Windows 8 or windows 10 pro. https://www.visualstudio.com/en-us/features/msft-android-emulator-vs.aspx

Don´t use the generic emulator. If you dont know how configure.

3)Make sure that you have install Xamarin correctly in your VS.

Tool -> options -> Xamarin

you need watch all the green check. xamarin

if the android dont have the green check. Search the route when you have install the sdk. For example watch the image. My root for example

Let me know if this solve your problem. Regards.