当前位置:网站首页>[app packaging error] to proceed, either fix the issues identified by lint, or modify your build script as follow
[app packaging error] to proceed, either fix the issues identified by lint, or modify your build script as follow
2022-07-05 09:47:00 【Black Mountain demon 2018】
stay studio hit release When the package , Compile not pass , An error is as follows
To proceed, either fix the issues identified by lint, or modify your build script as follows:
...
android {
lintOptions {
checkReleaseBuilds false
// Or, if you prefer, you can continue to check for errors in release builds,
// but continue the build even when errors are found:
abortOnError false
}
}
Many methods on the Internet are in the root directory build.gradle Add this line of code to the file , Found that the compilation passed . In fact, the above plan just ignores the problem , Will give app Bring unexpected hidden dangers , So we still try to find the problem , And solve .
Look at the app/build/reports/lint-results-release-fatal.xml file
<issue
id="WifiManagerLeak"
severity="Fatal"
message="The WIFI_SERVICE must be looked up on the Application context or memory will leak on devices < Android N. Try changing `UniversalDeskApp.getContext()` to `UniversalDeskApp.getContext().getApplicationContext()`"
category="Correctness"
priority="6"
summary="WifiManager Leak"
explanation="On versions prior to Android N (24), initializing the `WifiManager` via `Context#getSystemService` can cause a memory leak if the context is not the application context. Change `context.getSystemService(...)` to `context.getApplicationContext().getSystemService(...)`."
errorLine1=" mWifiManager = (WifiManager) UniversalDeskApp.getContext().getSystemService(Context.WIFI_SERVICE);"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="/Users/chenxuming/AndroidStudioProjects/UniversalDesk/app/src/main/java/com/uniubi/universaldesk/utils/ApHotUtil.java"
line="31"
column="42"/>
</issue>
See here is not suddenly realized , This log prompts very clearly , Can pass locaition Find the file where the error occurred , adopt message Get the cause of the error , The above code can always see that the error is getting WIFI_SERVICE The context of is useless getApplicationContext() Methods lead to , The modification scheme is as follows :
// Before the change
mWifiManager = (WifiManager) UniversalDeskApp.getContext().getSystemService(Context.WIFI_SERVICE);
// After modification
mWifiManager = (WifiManager) UniversalDeskApp.getContext().getApplicationContext().getSystemService(Context.WIFI_SERVICE);
Repackage after modification , Compile and pass .
边栏推荐
- TDengine 连接器上线 Google Data Studio 应用商店
- [sorting of object array]
- H. 265 introduction to coding principles
- 【对象数组的排序】
- STM32 simple multi-level menu (array table lookup method)
- Kotlin introductory notes (VII) data class and singleton class
- TDengine 已经支持工业英特尔 边缘洞见软件包
- Lepton 无损压缩原理及性能分析
- Understand the window query function of tdengine in one article
- Lepton 无损压缩原理及性能分析
猜你喜欢
![[NTIRE 2022]Residual Local Feature Network for Efficient Super-Resolution](/img/f3/782246100bca3517d95869be80d9c5.png)
[NTIRE 2022]Residual Local Feature Network for Efficient Super-Resolution

Kotlin introductory notes (VII) data class and singleton class
![[ManageEngine] how to make good use of the report function of OpManager](/img/15/dc15e638ae86d6cf1d5b989fe56611.jpg)
[ManageEngine] how to make good use of the report function of OpManager

OpenGL - Model Loading

High performance spark_ Transformation performance

Principle and performance analysis of lepton lossless compression

LeetCode 496. Next larger element I

百度交易中台之钱包系统架构浅析
![[ctfhub] Title cookie:hello guest only admin can get flag. (cookie spoofing, authentication, forgery)](/img/78/d9d1a66fc239e7c62de1fce426d30d.jpg)
[ctfhub] Title cookie:hello guest only admin can get flag. (cookie spoofing, authentication, forgery)

Tongweb set gzip
随机推荐
Principle and performance analysis of lepton lossless compression
Tdengine already supports the industrial Intel edge insight package
Android 隐私沙盒开发者预览版 3: 隐私安全和个性化体验全都要
一次 Keepalived 高可用的事故,让我重学了一遍它
E-commerce apps are becoming more and more popular. What are the advantages of being an app?
百度交易中台之钱包系统架构浅析
uni-app---uni. Navigateto jump parameter use
Unity SKFramework框架(二十四)、Avatar Controller 第三人称控制
SQL learning - case when then else
Node の MongoDB Driver
一篇文章带你走进cookie,session,Token的世界
Alibaba's ten-year test brings you into the world of APP testing
微信小程序获取住户地区信息
正式上架!TDengine 插件入驻 Grafana 官网
The most comprehensive promotion strategy: online and offline promotion methods of E-commerce mall
SQL learning alter add new field
【el-table如何禁用】
[ManageEngine] how to make good use of the report function of OpManager
Community group buying exploded overnight. How should this new model of e-commerce operate?
TDengine 连接器上线 Google Data Studio 应用商店