简体   繁体   English

无法生成签名的 APK?

[英]Not able to generate signed APK?

I am trying to generate signed APK.我正在尝试生成签名的 APK。 but not able to generate it due to the lint error at the time of generating.但由于生成时的 lint 错误而无法生成它。 I checked my lint report and it's showing error in my XML file.我检查了我的 lint 报告,它在我的 XML 文件中显示错误。

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!) “NotSibling”类型问题的解释:给定 ConstraintLayout 或 RelativeLayout 中的布局约束应该引用同一相对布局中的其他视图(但不是它本身!)

1 errors, 0 warnings 1 个错误,0 个警告

FAILURE: Build failed with an exception. FAILURE:构建失败,出现异常。

  • What went wrong: Execution failed for task ':app:lintVitalRelease'.出了什么问题:任务 ':app:lintVitalRelease' 执行失败。

    Lint found fatal errors while assembling a release target. Lint 在组装发布目标时发现了致命错误。 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要继续,要么修复 lint 确定的问题,要么按如下方式修改构建脚本: ... android { lintOptions { checkReleaseBuilds false // 或者,如果您愿意,可以继续检查发布版本中的错误, // 但是即使发现错误也继续构建:abortOnError false

Here is my XML:这是我的 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 ../../src/main/res/layout/notification_view.xml:48: @+id/all_featured_deals_divider 不是同一个RelativeLayout 中的兄弟

Error is: Layout constraints in a given ConstraintLayout or RelativeLayout should reference other views within the same relative layout (but not itself!)错误是:给定 ConstraintLayout 或 RelativeLayout 中的布局约束应该引用同一相对布局中的其他视图(但不是它本身!)

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

if you are reusing the xml eg using include, do the constraints there.如果您正在重用 xml,例如使用 include,请在那里执行约束。

Your @+id/all_featured_deals_divider do not refer to any element in the current xml file.您的@+id/all_featured_deals_divider未引用当前 xml 文件中的任何元素。

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.您可能从其他 XML 文件中复制了布局,其中存在具有此名称的元素但未包含在此处。 You can just remove this line as it is useless and your code should show no errors for this.您可以删除此行,因为它没有用,并且您的代码不应显示任何错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM