0
votes

I am trying to generate signed APK. but not able to generate it due to the lint error at the time of generating. I checked my lint report and it's showing error in my XML file.

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

1 errors, 0 warnings

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':app:lintVitalRelease'.

    Lint found fatal errors while assembling a release target. To proceed, either fix the issues identified by lint, or modify your build script as follows: ... android { lintOptions { checkReleaseBuilds false // Or, if you prefer, you can continue to check for errors in release builds, // but continue the build even when errors are found: abortOnError false

Here is my XML:

<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:clickable="true"
    android:background="@color/background">

    <androidx.core.widget.NestedScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_below="@+id/all_featured_deals_divider"
        android:orientation="vertical"
        android:overScrollMode="never">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        android:paddingTop="3dp"
        android:paddingRight="6dp"
        android:paddingLeft="6dp"
        android:paddingBottom="3dp">

    <androidx.recyclerview.widget.RecyclerView
        android:id="@+id/notificationsRecyclerView"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:nestedScrollingEnabled="false"/>

    </LinearLayout>

    </androidx.core.widget.NestedScrollView>

</RelativeLayout>

Getting error in this line:

    android:layout_below="@+id/all_featured_deals_divider"

../../src/main/res/layout/notification_view.xml:48: @+id/all_featured_deals_divider is not a sibling in the same RelativeLayout

Error is: Layout constraints in a given ConstraintLayout or RelativeLayout should reference other views within the same relative layout (but not itself!)

2
remove that line android:layout_below - jose praveen

2 Answers

0
votes

Remove android:layout_below="@+id/all_featured_deals_divider"

if you are reusing the xml e.g. using include, do the constraints there.

0
votes

Your @+id/all_featured_deals_divider do not refer to any element in the current xml file.

It is possible that you copied the layout from some other XML file where an element with this name was present but is not included here. You can just remove this line as it is useless and your code should show no errors for this.