Constraint Layout beta 5 is the release candidate, and added a to deprecate older versions.

The easiest way to get rid of the lint is to press Alt-Enter and choose the first option to upgrade.

However, I encountered a bug, which forces me to stay with beta4 until the next version comes out with the fix. I still want to get rid of the lint error so my continuous build does not fail. I didn’t want to change lintOptions abortOnError to false in build.gradle because I still want my build to catch other fatal lint errors.

I tried to get Studio to fix this lint error for me by choosing Disable inspection from Alt-Enter. Alas, that only changed the local settings. Turns out that I need to go to Settings → Editor → Inspections to undo that.

The option I wanted is Suppress: Add tools:ignore="MissingConstraints" attribute, which modifies the xml for me to add the appropriate lint suppression.

<android.support..ConstraintLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:app="http://schemas.android.com/apk/res-auto"
  xmlns:tools="http://schemas.android.com/tools"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  tools:ignore="MissingConstraints">
<!-- Cannot upgrade to  due to http://b.android.com/23383 -->

Finally, I added a comment to remind me why I suppress the lint error.

More info: Suppress Lint Warnings.



Source link
thanks you RSS link
( http://feedproxy..com/~r/sqisland/~3/BdwCcHDRN6A/constraint-layout-beta5-lint-error.html)

LEAVE A REPLY

Please enter your comment!
Please enter your name here