Xamarin VS2015设计器无法正常工作 [英] Xamarin VS2015 designer not working
问题描述
我正在与xamarin一起使用Visual Studio2015.两天后,版式的设计师停止工作了.很难确定问题的原因,因为这些天我不记得做任何具体的事情.
I am working with xamarin for visual studio 2015. For 2 days now the designer of the layout stopped working. It is very difficult to identify the problem cause i don't remember doing anything specific during these days.
这是错误消息的屏幕截图
Here is a screenshot of the error message
我一直在尝试遵循网络上的所有指示,包括xamarin建议,但没有成功.
I have been trying to follow instructions from all over the web, including the xamarin suggestions, without any success.
以下是该异常的详细文字:
Here is the detailed text of the exception:
java.lang.NoClassDefFoundError: com/android/utils/ILogger
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
at java.lang.Class.getMethod0(Class.java:3018)
at java.lang.Class.getMethod(Class.java:1784)
at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
Caused by: java.lang.ClassNotFoundException: com.android.utils.ILogger
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 7 more
Error: A JNI error has occurred, please check your installation and try again
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=350m; support was removed in 8.0
Exception in thread "main"
我已经做的是: 1.添加了环境变量MaxPermSize,将其设置为不同的大小没有成功. 2.重新安装了x86和x64的Java运行时和Java SDK. 3.我的系统中只有JAVA JRE 8和SDK 1.8.0_102 x64. 4.重新安装了Android SDK工具.
What i already did is: 1. Added the enviromental variable MaxPermSize setting it to different sizes without any success. 2. Reinstalled Java runtime and Java SDK both for x86 and x64. 3. I have only in my system JAVA JRE 8 and SDK 1.8.0_102 x64. 4. Reinstalled the Android SDK tools.
所以最初,我有一个问题,是否有任何工作原因,我真的想使用xamarin,但不是没有设计者吗?
So originally i have the question if there is any workaroung cause i really want to use xamarin but not without the designer?
推荐答案
似乎我终于找到了解决方案,并希望分享答案.
It seems that i finally found a solution and would like to share the answer.
Xamarin在Java JDK版本中有点敏感.在网站上可以找到,我们应该始终使用Java JDK 1.7,但只有32位版本(即使您使用的是64位Windows).这是他们页面的链接
Xamarin is a little bit sensitive when it comes the Java JDK version. As found on the website we should have always Java JDK 1.7 but only 32-bit version(even if you're using 64-bit Windows). Here is the link to their page
因此,在我的情况下,我尝试了许多解决方案,这是可行的:
So in my case i tried many solutions and here is what worked:
- 通过控制面板卸载所有java和java sdk>卸载程序
- 仅安装Java sdk 1.7 32位(Java SE开发工具包7u79)和Java 1.7(从sdk安装程序安装)
- 关闭Visual Studio
- 从Windows打开Android SDK管理器
- 删除Android SDK工具和Android SDK平台工具
- 安装Android SDK工具和Android SDK平台工具
- 关闭Android SDK Manager(应用程序本身将要求重新启动)
- 添加Java_Home和JDK_Home环境变量,如下所示(我认为虽然可以避免Java_Home,但尚未对其进行测试)
- 启动Visual Studio.您的布局应加载无任何问题;
- Uninstall all java and java sdk through the control panel>uninstall programs
- Install only java sdk 1.7 32 bit(Java SE Development Kit 7u79) and java 1.7(installed from the sdk installer)
- Close Visual Studio
- Open Android SDK manager from windows
- Delete Android SDK Tools and Android SDK Platform-tools
- Install Android SDK Tools and Android SDK Platform-tools
- Close Android SDK Manager(the application itself will ask for a restart)
- Add the Java_Home and JDK_Home enviromental variables as shown below(I think that Java_Home can be avoided though but haven't tested it yet)
- Start visual studio. Your layout should load without any problems;
PS:在尝试此解决方案超过3次以进行验证时,我不得不重新启动计算机.
PS: While trying this solution more than 3 times in order to verify it, one time i had to restart my computer.
希望这是有用的:)
这篇关于Xamarin VS2015设计器无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!