使用Android Studio 0.4.0渲染问题

我最近决定在Eclipse上玩一会儿后试用Android Studio。 我的主要活动xml在Eclipse上呈现正常,但Studio似乎有问题。 它在预览窗口中报告:渲染问题java.lang.StackOverflowError将堆栈复制到剪贴板。

剪贴板的部分内容(完整是> 70K字符)是:

java.lang.StackOverflowError at com.android.tools.idea.rendering.ProjectCallback.loadView(ProjectCallback.java:153) at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:207) at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:135) at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:755) at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64) at android.view.LayoutInflater.rInflate(LayoutInflater.java:727) at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:154) at android.view.LayoutInflater.parseInclude(LayoutInflater.java:782) at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:745) at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64) at android.view.LayoutInflater.rInflate(LayoutInflater.java:727) at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:154) at android.view.LayoutInflater.parseInclude(LayoutInflater.java:782) at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:745) at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64) at android.view.LayoutInflater.rInflate(LayoutInflater.java:727) at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:154) at android.view.LayoutInflater.parseInclude(LayoutInflater.java:782) at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:745) at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64) at android.view.LayoutInflater.rInflate(LayoutInflater.java:727) at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:154) at android.view.LayoutInflater.parseInclude(LayoutInflater.java:782) at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:745) at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64) at android.view.LayoutInflater.rInflate(LayoutInflater.java:727) at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:154) at android.view.LayoutInflater.parseInclude(LayoutInflater.java:782) at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:745) at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64) at android.view.LayoutInflater.rInflate(LayoutInflater.java:727) at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:154) at android.view.LayoutInflater.parseInclude(LayoutInflater.java:782) at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:745) at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64) at android.view.LayoutInflater.rInflate(LayoutInflater.java:727) at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:154) at android.view.LayoutInflater.parseInclude(LayoutInflater.java:782) at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:745) at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64) at android.view.LayoutInflater.rInflate(LayoutInflater.java:727) at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:154) at android.view.LayoutInflater.parseInclude(LayoutInflater.java:782) at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:745) at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64) at android.view.LayoutInflater.rInflate(LayoutInflater.java:727) at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:154) at android.view.LayoutInflater.parseInclude(LayoutInflater.java:782) at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:745) at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64) at android.view.LayoutInflater.rInflate(LayoutInflater.java:727) at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:154) at android.view.LayoutInflater.parseInclude(LayoutInflater.java:782) at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:745) at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64) at android.view.LayoutInflater.rInflate(LayoutInflater.java:727) at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:154) 

实际的xml代码是:

       

虽然这不会影响.apk文件的构建和创建,但我仍然希望利用Studio的酷炫图形UI编辑function。

任何帮助将不胜感激

干杯

从片段内的XML中删除以下行:

tools:layout="@layout/activity_main"/>

原因:在Android Studio中,您可以选择在处理包含片段的XML文档时编辑单独的布局。 选择编辑父布局的选项后,上面的这一行将插入到代码中。 干杯