[问题] 打包时报错not a sibling

楼主: May555R (may)   2021-03-24 22:30:47
使用模拟器
都没问题
但是要打包成apk出现错误
Execution failed for task ':app:lintVitalRelease'.
> Lint found fatal errors while assembling a release target.
Error: @+id/txtLocation is not a sibling in the same RelativeLayout
[NotSibling]
android:layout_below="@+id/txtLocation"
Explanation for issues of type "NotSibling":
Layout constraints in a given ConstraintLayout or RelativeLayout should
reference other views within the same relative layout (but not itself!)
这个是说这行XML code是错误的
删掉就行了吗?
我觉得奇怪的是
使用模拟器测试时,都没报错
打包成apk就是一直不过
作者: evo1994 (Evo)   2021-03-27 09:04:00
lint的问题 简单解就是在gradle 设定 LintOption abort掉error
作者: aids61517 (奇欧巴肯)   2021-03-27 13:08:00
与其关掉lint,不如去修正这个问题,这个满好修的
作者: siriusu (かがみは俺の嫁。)   2021-03-31 02:45:00
txtLocation 不在同一层的意思
作者: kobe8112 (小B)   2021-03-31 08:57:00
不太明白这个错误描述都这么清楚了,硬是不尝试照错误说明调整,反而想说整个删掉,这思维方式很妙...
作者: zcbxvsdf (东北一头羊)   2021-04-04 21:27:00
一楼的解,是解雇的解:D

Links booklink

Contact Us: admin [ a t ] ucptt.com