app:lintVitalBetaRelease

2021-09-25  本文已影响0人  xiaotimel

android 在打包的时候出现检测错误

Explanation for issues of type "Instantiatable":

/data/jenkins-slave/workspace/dev_beta_release/modules/module_one/src/main/res/layout/one_layout_view.xml:43: Error: CustomView must extend android.view.View [Instantiatable]
        <com.one.ui.CustomView
        ^

   Explanation for issues of type "Instantiatable":
   Activities, services, broadcast receivers etc. registered in the manifest
   file (or for custom views, in a layout file) must be "instantiatable" by
   the system, which means that the class must be public, it must have an
   empty public constructor, and if it's an inner class, it must be a static
   inner class.

1 errors, 0 warnings

在自定view的xml文件中添加 tools:ignore="Instantiatable"

 <com.one.ui.CustomView
            android:id="@+id/talkingView"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            tools:ignore="Instantiatable"/>

再次打包编译完美通过

上一篇 下一篇

猜你喜欢

热点阅读