在studio上打包签名apk时遇到的一些报错 在此记录
1.Error: Expected resource of type drawable [ResourceType]
在build.gradle文件中增加一下信息,然后打包成功了:
1
2
3
4
5
|
android {
lintOptions {
disable
"ResourceType"
}
}
|
只需要在报错位置所在的类上面添加一句话:
@SuppressWarnings("ResourceType")
3.
解决办法,在build.gradle里面添加如下代码,放在android下面
把布局文件的 xmlns:app="http://schemas.android.com/tools" 改成 xmlns:app="http://schemas.android.com/apk/res-auto"
5.Error: The WIFI_SERVICE must be looked up on the Application
Android 7.0 在获取 WifiManager的时候需要使用.getApplicationContext(),如果未使用会造成内存泄露。
解决方法
原来的:
- 1
修改为: