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

前端 未结 8 1073
南方客
南方客 2020-12-23 20:41

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.

相关标签:
8条回答
  • 2020-12-23 20:49

    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.

    0 讨论(0)
  • 2020-12-23 20:53

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

    0 讨论(0)
  • 2020-12-23 20:56

    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.

    0 讨论(0)
  • 2020-12-23 20:56

    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.

    0 讨论(0)
  • 2020-12-23 21:00

    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!

    0 讨论(0)
  • 2020-12-23 21:02

    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.

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

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

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

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

    0 讨论(0)
提交回复
热议问题