Xamarin VS2015 设计器不工作 [英] Xamarin VS2015 designer not working

查看:30
本文介绍了Xamarin VS2015 设计器不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为 Visual Studio 2015 使用 xamarin.现在有 2 天了,布局设计师停止工作.很难确定问题所在,因为我不记得这几天做了什么具体的事情.

这是错误信息的截图

我一直在尝试遵循网络上的说明,包括 xamarin 的建议,但没有成功.

这里是异常的详细文本:

java.lang.NoClassDefFoundError: com/android/utils/ILogger在 java.lang.Class.getDeclaredMethods0(Native Method)在 java.lang.Class.privateGetDeclaredMethods(Class.java:2701)在 java.lang.Class.privateGetMethodRecursive(Class.java:3048)在 java.lang.Class.getMethod0(Class.java:3018)在 java.lang.Class.getMethod(Class.java:1784)在 sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)在 sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)引起:java.lang.ClassNotFoundException:com.android.utils.ILogger在 java.net.URLClassLoader.findClass(URLClassLoader.java:381)在 java.lang.ClassLoader.loadClass(ClassLoader.java:424)在 sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)在 java.lang.ClassLoader.loadClass(ClassLoader.java:357)……还有 7 个错误:发生 JNI 错误,请检查您的安装并重试Java HotSpot(TM) 64 位服务器 VM 警告:忽略选项 MaxPermSize=350m;在 8.0 中移除了支持线程main"中的异常

我已经做的是:1.添加环境变量MaxPermSize设置为不同的大小没有成功.2. 为 x86 和 x64 重新安装 Java 运行时和 Java SDK.3. 我的系统中只有 JAVA JRE 8 和 SDK 1.8.0_102 x64.4.重新安装Android SDK工具.

所以最初我有一个问题,是否有任何解决方法,因为我真的想使用 xamarin 但不是没有设计师?

解决方案

看来我终于找到了解决方案,想分享一下答案.

Xamarin 对 Java JDK 版本有点敏感.正如在网站上发现的那样,我们应该始终使用 Java JDK 1.7 但只有 32 位版本(即使您使用的是 64 位 Windows).这是他们页面的链接

  • 启动视觉工作室.您的布局应该可以正常加载;
  • PS:尝试此解决方案超过 3 次以验证它时,有一次我不得不重新启动计算机.

    希望这有用:)

    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

    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" 
    

    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.

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

    https://developer.xamarin.com/guides/android/getting_started/installation/windows/manual_installation/

    So in my case i tried many solutions and here is what worked:

    1. Uninstall all java and java sdk through the control panel>uninstall programs
    2. Install only java sdk 1.7 32 bit(Java SE Development Kit 7u79) and java 1.7(installed from the sdk installer)
    3. Close Visual Studio
    4. Open Android SDK manager from windows
    5. Delete Android SDK Tools and Android SDK Platform-tools
    6. Install Android SDK Tools and Android SDK Platform-tools
    7. Close Android SDK Manager(the application itself will ask for a restart)
    8. 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)
    9. Start visual studio. Your layout should load without any problems;

    PS: While trying this solution more than 3 times in order to verify it, one time i had to restart my computer.

    Hope this is usefull:)

    这篇关于Xamarin VS2015 设计器不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆