Android studio使用过程中提示“警告: [deprecation] android.hardware中的Camera已过时”
来源:互联网 发布:火爆网络的ann是谁 编辑:程序博客网 时间:2024/05/20 00:51
在打包时你可能遇到这样的问题:
警告: [deprecation] android.hardware中的Camera已过时
虽然对于打包没什么影响,但对于我这样有点吹毛求疵的人可能就是忍受不了,
解决方式:在module下的gradle加入了:
android{
lintOptions {checkReleaseBuilds false
abortOnError false
}
allprojects {
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
}
}
}
例如:
在Android Studio 1.2.2中编译代码时遇到Resources中getDrawable(int)已过时的警告信息:
Warning:(133, 52) java: android.content.res.Resources中的getDrawable(int)已过时
查看API文档:https://developer.android.com/reference/android/content/res/Resources.html?hl=zh-cn
Resources类中有两个方法在API level 22中被废弃:
废弃接口:Drawable getDrawable(int id)
替代接口:Drawable getDrawable(int id, Resources.Theme theme), 第二个参数@theme可以为空值.
或Context.getDrawable(int)
废弃原因:在JELLY_BEAN(也就是Android 4.1版本)之前, 当这里传递的资源ID是另一个Drawable资源的别名, 则该函数不能正确地获取到最终配置density。即别名资源(alias resource)的density配置不同于实际资源的, 返回的Drawable对象的density将不正确, 这样缩放时将出错。
- Android studio使用过程中提示“警告: [deprecation] android.hardware中的Camera已过时”
- 【已解决】Android Studio编译OsmAnd出现警告:GeoPointParserUtil.java使用或覆盖了已过时的 API。有关详细信息请使用-Xlint:deprecation重新编
- Android studio使用过程中提示过时操作怎么办?
- android studio编译警告:请使用 -Xlint:deprecation 重新编译
- android studio 已过时
- android studio 打包过时警告问题解决方案
- 使用Android studio打包应用程序出现如下错误: 注: 某些输入文件使用或覆盖了已过时的 API。 注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。
- android-android.hardware.Camera
- Android Studio 错误提示 注: 某些输入文件还使用或覆盖了已过时的 API。
- android.hardware.Camera
- android.hardware.Camera
- 在Visual Studio 2005中遇到 提示"ConfigurationSettings 已过时"
- Android Studio有关详细信息, 请使用 -Xlint:deprecation 重新编译
- 注: 某些输入文件使用或覆盖了已过时的 API。 android studio
- 注: 某些输入文件使用或覆盖了已过时的 API。 android studio
- Sqoop-1.4.6 mysql数据导出到HDFS提示;注: java使用或覆盖了已过时的 API。关详细信息, 请使用 -Xlint:deprecation 重新编译。
- android出现注: 某些输入文件使用或覆盖了已过时的 API。 注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。 注: 某些输入文件使用了未经检查或不安全的操作。 注
- android出现注: 某些输入文件使用或覆盖了已过时的 API。 注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。 注: 某些输入文件使用了未经检查或不安全的操作。 注
- 基于Android的Word文档阅读器
- java finalize方法的使用
- Discuz! 内存缓存机制与使用方法
- Qt下载地址
- 《ACM书中题目》 B
- Android studio使用过程中提示“警告: [deprecation] android.hardware中的Camera已过时”
- 润乾报表插入Word文档
- 如何配置Linux服务,确保崩溃或重启后自动加以运行——第一部分:应用实例
- angular用ng-repeat遍历对象
- 链表一些操作
- 在service里面用dialog
- Studio结构的第三方库
- Python:10054错误
- 解决求很大数阶层时数据溢出的两种方法