美文网首页
app:lintVitalBetaRelease

app:lintVitalBetaRelease

作者: xiaotimel | 来源:发表于2021-09-25 18:36 被阅读0次

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"/>

再次打包编译完美通过

相关文章

网友评论

      本文标题:app:lintVitalBetaRelease

      本文链接:https://www.haomeiwen.com/subject/hpgxnltx.html