1. 程式人生 > >VS2015 android 設計器不能視覺化問題解決。

VS2015 android 設計器不能視覺化問題解決。

最近安裝了VS2015,體驗了一下android 的開發,按模板建立運行了個,試下效果很不錯。也可以視覺化設計。但昨天再次開啟或建立一個android程式後,設計介面直接不能顯示,顯示錯誤:(可能是升級了什麼SP,不太記得了)

Connection to the layout renderer failed。this my b caused by a misconfiguration of java.

Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

Could not create the Java Virtual Machine? 開啟VS自帶的android虛擬機器管理,選擇一個,可以執行。直接VS除錯也可以在虛擬機器裡看到最終效果。就是不能視覺化。

檢視Visual Studio: %LOCALAPPDATA%\Xamarin\Log\devenv*.log 。只看到報錯,未見什麼可以明確指出錯誤的提示。

只能到官網去看下了:

找到如下連線:http://forums.xamarin.com/discussion/32365/connection-to-the-layout-renderer-failed-in-xs-5-7-and-xamarinvs-3-9#latest

解決方式:

1.升級安裝 JDK1.8 並修改登錄檔,及VS的JDK路徑

2.設定使用者環境變數

_JAVA_OPTIONS=-XX:MaxPermSize=256m,這個會對JAVA有影響

按照第二種方式處理後,再開啟VS,設計器可正常工作。