`
serryzhao
  • 浏览: 115603 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

解决异常Circular dependencies cannot exist in RelativeLayout,

阅读更多
今天碰到这个error:E/AndroidRuntime( 4657): Uncaught handler: thread main exiting due to uncaught e
xception
E/AndroidRuntime( 4657): java.lang.IllegalStateException: Circular dependencies
cannot exist in RelativeLayout
有点郁闷,我用的是skd1.5,在1.5的机器上(HTC G3)已经测试过了,没有问题的,但放在华为c8500(2.1update)上就报上面的错了,怎么回事呢?
根据提示判断应该是布局的原因,于是找到RelativeLayout的布局,找出最可疑的那个,注释后,不报错了。好就是他的原因,挨个看里面的元素,看属性,没错啊,后来发现,
<RelativeLayout android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_alignParentRight="true">
<TextView android:id="@+id/titleName" android:text="首页"
android:textColor="@color/white" android:layout_toLeftOf="@+id/homeBtn"
android:layout_marginRight="2px"
android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
<ImageButton android:id="@+id/homeBtn"
android:layout_toRightOf="@+id/titleName" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:src="@drawable/main"
android:background="@null" android:layout_marginRight="10px">
</ImageButton>
</RelativeLayout>

后来改成:

<RelativeLayout android:layout_width="wrap_content" android:layout_marginRight="10px"
android:layout_height="wrap_content" android:layout_alignParentRight="true">
<TextView android:id="@+id/titleName" android:text="首页"
android:textColor="@color/white"
android:layout_width="wrap_content"
android:layout_height="wrap_content"></TextView>
<ImageButton android:id="@+id/homeBtn"
android:layout_marginLeft="2px" android:layout_marginTop="2px"
android:layout_toRightOf="@+id/titleName" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:src="@drawable/main"
android:background="@null" >
</ImageButton>
</RelativeLayout>


能看到区别吗?对就是在titleName中去掉了相对homeBtn的位置信息。再看看报错提示,人家说我在RelativeLayout中存在循环的相关,就是说的这个了。
不过1.5版本的不报错,这就是后续版本的改进吗?

分享到:
评论
1 楼 zjc198805 2012-09-06  
这个异常应该是id定义重名产生的!就是在一个布局文件中定义了两个相同的id名称,从而导致异常的发生!

相关推荐

    circular-dependencies-nodejs:未定义的循环依赖项导入的解决方案

    NodeJ中的循环依赖注入在使用NodeJ开发应用程序时,您可能会遇到循环依赖的问题,例如// a.jsconst ... // undefined functionA} 因此,在此回购中,我将演示如何使用DI(依赖项注入)设计模式来解决循环依赖项的问题。

    Automatically managing service dependencies in OSGi(2005)

    in nature, so managing dependencies is something the developer needs to take into account. In an OSGi framework, services are deployed using bundles and these bundles feature two types of dependencies...

    Dependencies_x64_1.11.zip

    无论是解决程序异常、优化性能,还是学习系统工作原理,这款工具都能提供极大的帮助。 总之,Dependencies是Windows 10环境下诊断和理解程序依赖关系的得力助手,通过其详尽的分析功能,我们可以更有效地排查和解决...

    Dependencies

    它允许用户查看任何可执行文件(.exe或.dll)所依赖的库和DLL,从而帮助开发者理解和解决程序运行时的依赖性问题。 1. **依赖性分析**:Dependencies工具的核心功能是分析可执行文件的依赖关系。这包括检查所需的...

    查看dll依赖,depends和Dependencies

    总之,Depends和Dependencies是Windows 10系统中诊断和解决DLL依赖问题的得力助手。它们提供了一种有效的方式来探索DLL文件之间的相互关系,从而确保程序的正常运行。无论是开发人员还是系统管理员,掌握这两个工具...

    Spring dependencies开发架包spring3.0.2.dependencies.jar

    Spring dependencies开发架包,Spring dependencies包, spring3.0.2.dependencies.jar全部包,Spring dependencies包, spring3.0.2.dependencies.jar全部包

    win10下比depends好用的dll依赖检测 Dependencies

    5. **解决依赖问题**:根据Dependencies提供的信息,可以确定是缺少特定的DLL,还是版本不匹配等问题,从而采取相应的解决措施。 四、与其他工具的对比 相比于经典的depends工具,Dependencies在性能和用户体验上...

    estableRuntimeException cannot be resolved 解决

    在Java编程环境中,我们经常会遇到...如果遇到"cannot be resolved"错误,检查并更新相关库是最常见的解决方案之一。同时,保持良好的代码管理和版本控制习惯,如使用构建工具管理依赖,可以帮助避免这类问题的发生。

    dll文件依赖库检测工具Dependencies

    Dependencies和depends walker用法相同,可以检测出当前dll文件的依赖关系,Dependencies并且更为明显的显示出对应依赖库的绝对路径,查询问题更为方便快捷。 问题案例: 无法加载 DLL“XXXTest.dll”: 找不到指定的...

    The import com.loopj cannot be resolved 的解决方案

    以上步骤应该能帮助你解决"The import com.loopj cannot be resolved"的问题。在实际操作中,根据你的具体项目环境和使用的开发工具,可能需要结合使用多种方法。如果问题依然存在,可能需要进一步排查项目中的其他...

    针对缺少dll的分析工具 Dependencies.zip

    标题中的“针对缺少dll的分析工具 Dependencies.zip”指的是一个压缩包,其中包含了一款用于解决应用程序因缺失动态链接库(DLL)文件而无法正常运行的问题的工具。在Windows操作系统中,DLL文件是共享代码库,许多...

    dependencies2017.zip

    《VS2017编译OBS依赖库:dependencies2017.zip详解》 在IT行业中,开发高质量的软件往往需要依赖于一系列外部库,这些库为开发者提供了丰富的功能和便捷的接口,大大简化了开发过程。"dependencies2017.zip"正是...

    vue总是报Error Cannot find module 解决办法.网上的都试了不管用,用这招成功

    综上所述,解决“Error: Cannot find module”错误需要细心排查各个可能的原因,从模块导入路径、npm包安装、缓存清理到检查项目配置等。如果以上步骤均无效,建议详细查看错误日志,或者寻求社区的帮助,分享你的...

    Dependencies-for-win10比较好用的dll依赖关系工具

    总的来说,"Dependencies-for-win10"是一款针对Windows 10开发环境的专业DLL依赖分析工具,它以高效和易用性为特点,可以帮助开发者更好地理解和解决与DLL相关的各种问题。通过深入理解并运用这款工具,可以显著提升...

    Stanford typed dependencies manual

    斯坦福类型依赖手册涵盖了自然语言处理中句子结构分析的一种方法,称为斯坦福类型依赖(Stanford typed dependencies),这是一种用于描述句子中语法关系的简单、统一的方法,特别适合于非语言学专家进行文本信息...

    dependencies2013.zip

    标题“dependencies2013.zip”所指的文件是一个压缩包,其中包含了Visual Studio 2013(VS2013)用于编译Open Broadcaster Software (OBS)项目所需的依赖库。OBS是一款开源的、免费的屏幕录制和流媒体软件,广泛应用...

    Android-CircularProgressIndicator-可定制的循环进度指示器

    dependencies { implementation 'com.github.antokoly:CircularProgressIndicator:7fe0111' } ``` 3. 在布局XML文件中添加CircularProgressIndicator控件,并设置相关属性,如颜色、大小、进度值等。 ```xml ...

    Dependencies-DLL解析软件

    Dependencies是一款优秀免费的解析软件。 开发人员经常接触到库文件DLL,想要知道DLL中有哪些函数功能,往往需要依赖h头文件,或者通过VS自带的dumpbin工具。 而有了这款软件,将可以更加直观地了解DLL的信息,包括...

    dependencies.rar

    为了解决这类问题,我们有了"dependencies.rar",这是一个专门用于查看DLL依赖项的工具。 "dependencies.rar"是一个压缩包,其中包含了一个名为"dependencies"的工具。这个工具的主要功能是帮助开发者和用户分析和...

    Fast_integration_dependencies_in_spring_boot.是一个快速_fastdep.zip

    Fast_integration_dependencies_in_spring_boot.是一个快速_fastdep

Global site tag (gtag.js) - Google Analytics