Basic Xamarin Android SDK Issue - android

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):
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.

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.

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.
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.

Related

How to resolve : unexpected error occured Initializing Android Designer" in VS 2015 with Xamarin

Bringing up a new PC with Xamarin and VS 2015 Pro I received the following error:
An unexpected error occurred trying to initialize Android Designer.
Please verify the Android SDK path and the Java Development Kit path
on Tools->Options->Xamarin->Android Settings menu. Please see the logs
for more details.
I verified the SDK's are installed correctly. VS didn't generate any kind of Activity Log so I believe the log must lie elsewhere. Anyone know where I can find this log to find out more about what is wrong ?
I had exactly the same problem described (on a new PC, with a new Visual Studio install) and am 99.9% sure the answer is in how updates are applied. Or, more importantly, how they aren't being applied when you think they are.
Go to Tools | Options | Xamarin | Other, and under Xamarin for Visual Studio Updates, Check now for STABLE updates. Make sure you're running at least 4.2.0.680. You will have to close Visual Studio in the background as the updater is running--it'll warn you. Uninstalling and installing the cross-platform development tools from Visual Studio was not applying this update for me. I had to force the issue.
Now, as mentioned earlier, go to Tools, Android SDK Manager. I noticed my "Android SDK Tools" and "Cross Platform Tools" were out of date and updates were available. I accepted and applied the updates to version 24.4.1. BEAR WITH ME, THIS IS WHERE IT GETS TRICKY--it still didn't work.
Go back to Tools, Android SDK Manager. I immediately noticed that even though I'd just applied the latest update for "Android SDK Tools", (24.4.1), a new version (25.2.2) was now available, along with 17 other updates. I accepted them all.
Bingo. Where I once had the annoying error message and an empty design surface and an empty toolbox with the sad "no usable controls" message, I now have the attached screen snapshot--a design surface where I can see a visual representation of my .axml, and a toolbox from which I can drag and drop controls and they actually show up on my Samsung tablet.
Sorry so verbose. I lost hours on this problem and thought others might appreciate another working solution.
I had a similar problem as explained below.
Here a solution that worked for me:
1) delete the one package appearing in the screen shot below.
Nota bene: At this stage VS 2015 greyed out the Android SDK manager buttons, even after a restart.
2) download installer_r24.4.1-windows.exe for windows https://developer.android.com/studio/index.html
3) launch the Android SDK Manager outside of VS and install the proposed 19 packages. This time I could go through the installation.
4) Launch VS 2015 and create Xamarin Android project. Launching Main.axml would launch the designer properly on an android project.
The bug I had
I had the same problem here on a fresh install of Win10 + Full visual studio community 2015 update 3 + .Net Core + Azure SDK and Xamarin. Creating a new project Xamarin Native (iOs + Androird) shows up the same message as mentioned by MikeJ. In addition, running in debug F5 makes the designer have a new popup
Problem seems to appear also here
https://bugzilla.xamarin.com/show_bug.cgi?id=44374
and here
https://forums.xamarin.com/discussion/77669/how-do-i-fix-this-error-the-installed-android-sdk-is-too-old-version-25-1-3-or-newer-is-required
.
Opening the Android Manager does not show up version 25 as an option, instead it shows this
However, we cannot install (greyed out button even by accepting license)
Updating Xamarin did not work neither How to update Xamarin for Android within Visual Studio Community 2015
Some guidance would be great to understand what happened.
I had the same problem (when bringing up a new PC with Xamarin) and after a few days I solved the problem.
I moved sdk directory from "C:\Program Files (x86)\Android\android-sdk" to "C:\android-sdk". Then I opened the sdk manager and made updates. It's all.
I think the problem is with the path, which has space :)
I was able to to fix the issue by opening the Android SDK Manager and updating all the tools to the latest version.
If you are already using Android Studio in your computer then this might solve your problem.
Check whether SDK is already available at some other location. That worked for me. To check SDK path- Open Android Studio-> Click on SDK Manager Icon. Check Android SDK Location. Copy that path.
In Visual Studio-- Open Tools->Options->Xamarin->Android Settings menu and replace the new SDK path. It will automatically ask to download the updates. Install all packages and you are done!
before you go through all that trouble (and I went through many convoluted steps myself for several hours) please try run your VisualStudio as administrator and see what happens!
It solved the above issue (and then some) for me. I used fresh WIN 10 and VS2015 Community install and I must have set some of my permissions to tight.
Also I learned that updating my NuGet package: Xamarin.Forms (v.2.3.3.168)
solved errors related to:
System.MissingMethodException: Method Android.Support.V4.Widget.DrawerLayout.AddDrawerListener not found.
But that is another issue all together.
Adding these two references to Droid.csproj and packages.config fixed the problem for me:
<package id="Xamarin.Android.Support.Animated.Vector.Drawable" version="23.3.0" targetFramework="monoandroid60" />
<package id="Xamarin.Android.Support.Vector.Drawable" version="23.3.0" targetFramework="monoandroid60" />
Another issue to be aware of is that you need to have Java Development Kit 8 referenced in Xamarin, instead of JDK 7. You can set this is Tools > Options > Xamarin > Android.

Xamarin installation and update keep crashing

I am trying desperately to make my Xamarin studio work again. I was on Xamarin studio 5.10.3 and I try to update it to 6.0.2 and it keep crashing , I uninstall everything, delete all the xamarin folder information, delete the key product with regedit, download everything again and again but nothing is working, it is stuck to version 5.10.3 newer version even stable keep giving me the same error message (screenshot in image attachement). thanks in advance guys for your help
Screenshot here
Although you could work around this by ensuring the correct items are installed. We highly recommend that you move over to use Visual Studio on Windows instead.
https://www.xamarin.com/faq#xpq6
Here are some things you may need to ensure are installed to see if it resolves your problem even though the FAQ above is saying differently:
1) Ensure you download the correct developer pack: http://getdotnet.azurewebsites.net/target-dotnet-platforms.html
(4.5.2 should suffice)
2) Ensure you have MSBuild Tools 2013/2015 Installed
https://www.microsoft.com/en-us/download/details.aspx?id=40760
https://www.microsoft.com/en-us/download/details.aspx?id=48159
However I would recommend just using VS from this point on as noted in the FAQ.
As I see in your screenshot, when Xamarin Studio opens, you see MonoDevelop stuff instead of Xamarin. I had the exact same problem some months ago. I solved it by going to main menu > account and then log out. Then restart and log-in again.
Still not sure if that will work in Windows because it was on a mac in my particular case.

Unable to link LiveCode to Android SDK

This is my first question on this forum, i'm really sorry if i missed something that i was unable to find by my multiple search efforts.
I am am using a 16GB Ram Mac upgraded to Maverick 10.9, i have just purchased the Livecode Commercial package (6.5.1-RC-1)
I have successfully linked the IOS SDK to the Mobile Support Preference list.
I've attempted to load the Android SDK without success. :(
When navigating and selecting the Android SDK Folder /Users/macuser/Documents/My LiveCode/adt-bundle-mac-x86_64-20131030/SDK i get the error message:
"The chosen folder is not an Android SDK, please ensure you have installed it correctly and enabled support for Android 2.2 (Froyo)"
I've noticed others have also encountered this, but i've not seen how they solved it :(
In attempt to ensure i have loaded everything, i have followed the steps on this link with success all the way up to and including Starting the Virtual Device Simulator.
http://lessons.runrev.com/s/lessons/m/2571/l/27389-how-do-i-become-an-android-developer-on-a-mac
Thank you in advance for any guidance on next steps.
Joe
I think I've discovered the answer.
The error message was more helpful that i expected.. and i'm feeling pretty foolish! So.. In the Android SDK Manager Dialog Box there's a list of Android versions that you can download. At this time the current version is Android 4.4 (Kit Kat?) but if you don't go all the way back and select the SDK's associated with version 2.2 then the Livecode seems unsatisfied :). Makes total sense.. since it tells you in the error message that it is in fact looking for the Froyo release.
So if this happens to you.. open the Android SDK Manager Dialog box. You can find it in the Android ADT Application under the 'Window' menu item and selecting the 'Android SDK Manager' list item. This will launch the Android SDK Manager dialog box. Then select the Android 2.2 (API 8) folder, check it, accept the license and download it. Then go back to Livecode and link to the SDK Folder /Users/macuser/Documents/My LiveCode/adt-bundle-mac-x86_64-20131030/SDK and no error will be raised. Hope this helps someone that happened to ignore the obvious like me :) -Joe

Motodev / Eclipse freezes up for several seconds when autofill tooltip proprosal pops up

I recently installed a fresh copy of Motodev. When I type the name of object and a period after it a popup comes up with a list of all of the methods available to that object. Ever since I started using this new copy of Motodev if I have an object with a very large amount of available methods this process freezes the whole program for several seconds.
RelativeLayout and EditText are the two that I have personally noticed that this is a problem with, but I suspect any object that has a large number of methods will cause this. It was never a problem before. Has anyone else seen this issue and if so how did you fix it? I do like having the list pop up so that I can see all of the methods available to me so I'd like to leave that feature turned on if at all possible.
Looks like you figured this out already, but I'll say it for future readers. There is an update to MOTODEV Studio specifically to work with ADT 8.0.1. There were some API changes in ADT that required us to update Studio also. ADT 8.0.1 requires Studio 2.0.1, which is based on Eclipse Helios. There are installers on the MOTODEV site as well as an updater for Eclipse.
Because of the complexity of dependencies with all the Eclipse plugins, I suggest to download the .zip archive at MOTODEV rather than using the "Install Updates" method. I find that I get timeouts quite often at home on broadband that don't happen at work with a bigger pipe.
Also, Studio 2.1 will be available some time within the next week (~Jan 25) and will work with the 2.3 SDK and ADT 8.0.1.
UPDATE: 2/14/11 - It would appear that the correct answer is found at comment #8 in this link: http://code.google.com/p/android/issues/detail?id=7850
Tim will need to formally accept this answer at some point...
Which is as follows:
For those of you with this problem, here's what you can do until the fix is publicly available:
1. Download https://android.googlesource.com/platform/frameworks/base/+archive/<branch>.tar.gz where is one of those listed here (froyo-release for 2.2, the file is about 113MB): https://android.googlesource.com/platform/frameworks/base/+refs
2. Extract the contents of base/ in the tar into "/platforms/android-/sources" where is 8 for froyo, 7 for eclair, etc.
3. Enjoy fast content assist in 3.6!
If you are using eclipse v3.6 (Helios) this is a known issue with ADT - the android dev site recommends using v3.5 or v3.4 of eclipse until the problem is resolved.
EDIT: It might be dependent on the version of ADT you are using - I can't find the recommendation to use v3.4 or v3.5 anymore. Perhaps things were fixed with ADT 8.0.x Check which versions you are using anyway.

Trying to set up Android SDK - Please help! Beginner

So I am super new to this, and am not really sure what I am doing.
I downloaded the Android SDK for Windows, but I am a little confused in setting it up/installing. So I read that I needed to set the System Variables Path to the tools/
but I it seems that I would be replacing the Windows\System32?!?!
I should not be replacing this should I?
Windows Vista; already have the Eclipse IDE download and set up (minus pointing at the SDK)
Can anyone help a begginer out with setting this thing up please?
apreciated; thanks!
also: i should metion exactly what I have done...
I downloaded that Android SDK and unzipped it.....that's about it!
The PATH environment variable is a semi-colon (;) list of paths. Just append a ";" + the Android SDK tools path to the end.
I installed the Linux version of the SDK but I can probably still help you. I followed these instructions exactly and everything worked out for me.
The next thing to do after unzipping and adding tools/ to the PATH, is to run 'android' this is a GUI program in the tools/ directory and it will allow you to create at least one Virtual Android platform for the emulator to run. just use all the defaults and the latest android version when setting that up. again all these instructions are available in more detail at the link above.
after you got that part done, you need to install eclipse if you haven't already. almost all Android development is done in eclipse with a plugin called ADT. although it is possible not to use eclipse and ADT, the tutorials and everything expect you to be using it.
after you install that try the hello world program.
add to path, put a ; then add to the end....
I have a blog post about what steps to take on a Windows machine to get started with Android development using Eclipse as your development environment (Windows 7, 64-bit in my case, but I don't think there is anything 7/64 specific in the list). I guess the points could have even more detail (no screenshots), but I basically typed them down so that I would remember them myself.
Getting ready for Android development
This site is an must read for starting android development, lot of good information on how to configure eclipse, installing adt etc.
And next up, get yourself an subscription here:
And the official android developer guide is one of the best I've seen for development platforms.

Categories

Resources