2016-09-18 112 views
6

試圖創建並與所有的默認運行第一Xamarin應用,構建失敗,出現以下錯誤:無法運行Xamarin的Android項目

 
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. 

我試着在How to resolve : unexpected error occured Initializing Android Designer" in VS 2015 with Xamarin建議的解決方案。 然而,似乎沒有任何工作。

+0

任何解決方案?我無法構建任何Android項目,但會在styles.xml中引發錯誤。 – Mrunal

+0

也許這可以幫助:http://stackoverflow.com/questions/39548053/how-to-resolve-unexpected-error-occured-initializing-android-designer-in-vs-2 –

+0

由於某種原因,安裝Visual Studio(更新3)。在安裝過程中,我選擇了Xamarin所需的組件。不過,我仍然面臨同樣的問題。 –

回答

3

我遇到了同樣的問題。我有followed the link that you shared併成功解決了我的環境。所以我會給出一些提示,以確保所有必要的步驟都已完成。

我有同樣的錯誤「嘗試初始化Android設計器時出現意外錯誤請驗證工具 - >選項 - > Xamarin-> Android設置菜單上的Android SDK路徑和Java開發工具包路徑。記錄更多細節。「

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.

要檢查Xamarion版本,你可以按照 「版本信息」 一節中的步驟: https://developer.xamarin.com/guides/cross-platform/troubleshooting/questions/version-logs/

enter image description here

如果您使用的是Windows和Visual Studio將是: 幫助>關於Microsoft Visual Studio>複製信息[按鈕]

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.

要ch ECK的Android SDK版本,您可以按照中的步驟「Android SDK工具,平臺工具,構建工具」部分: https://developer.xamarin.com/guides/cross-platform/troubleshooting/questions/version-logs/

如果您使用的是Windows和Visual Studio將是: 選擇SDK管理器工具欄圖標: enter image description here

3)重複步驟2,更新 「Android SDK工具」,直到你去至少版本25.2.5

enter image description here

之後,它是非常重要的都爲我工作。如果您還有其他問題,請告訴我。

+0

我也爲我工作。非常感謝。非常感激。 :)但是,我無法在Xamarin Android Player模擬器上部署應用程序。我希望你也有一個解決方案。 –

+0

下一個錯誤是什麼? – mqueirozcorreia