How to ignore the “avoid non-default constructors in fragments” error?

后端 未结 4 1012
执笔经年
执笔经年 2021-02-03 23:23

I got this error while trying to generate the signed APK. The thing is, my app is able to run and debug normally on my device. I don\'t know why when I try to generate APK, this

4条回答
  •  甜味超标
    2021-02-03 23:47

    For me only worked the combination of the two previous answers:

    android {
        lintOptions {
            disable 'ValidFragment'
            checkReleaseBuilds false
        }
    }
    

    But remember, these a bad patch to avoid lint warnings/errors, the solution is to adapt the Fragment constructor to a public static Fragment newInstance(params) Fragment constructor.

提交回复
热议问题