如何忽略“避免片段中的非默认构造函数"?错误? [英] How to ignore the "avoid non-default constructors in fragments" error?

查看:65
本文介绍了如何忽略“避免片段中的非默认构造函数"?错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试生成签名的APK时出现此错误.问题是,我的应用程序能够在我的设备上正常运行和调试.我不知道为什么当我尝试生成APK时出现此错误.如何忽略此错误并生成签名的APK?我正在使用适用于Mac的Android Studio 1.2.1.1.

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 error came out. How to ignore this error and generate the signed APK? I am using Android Studio 1.2.1.1 for Mac.

推荐答案

找到了解决方案.更简单的方法是将它们添加到gradle中:

Found the solution. The easier way is to add these to the gradle:

 android {
          lintOptions {
              checkReleaseBuilds false
          }
      }

或者另一种方法是添加 @SuppressLint("ValidFragment")

Or another way is to add @SuppressLint("ValidFragment")

这篇关于如何忽略“避免片段中的非默认构造函数"?错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆