当前位置:网站首页>[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 .
边栏推荐
- Analysis of eventbus source code
- TDengine 已经支持工业英特尔 边缘洞见软件包
- Community group buying has triggered heated discussion. How does this model work?
- High performance spark_ Transformation performance
- Are databases more popular as they get older?
- idea用debug调试出现com.intellij.rt.debugger.agent.CaptureAgent,导致无法进行调试
- TDengine 连接器上线 Google Data Studio 应用商店
- Deep understanding of C language pointer
- From "chemist" to developer, from Oracle to tdengine, two important choices in my life
- Observation cloud and tdengine have reached in-depth cooperation to optimize the cloud experience of enterprises
猜你喜欢
Figure neural network + comparative learning, where to go next?
Android privacy sandbox developer preview 3: privacy, security and personalized experience
TDengine可通过数据同步工具 DataX读写
High performance spark_ Transformation performance
代码语言的魅力
Officially launched! Tdengine plug-in enters the official website of grafana
Node-RED系列(二九):使用slider与chart节点来实现双折线时间序列图
What about wechat mall? 5 tips to clear your mind
MySQL installation configuration and creation of databases and tables
[ctfhub] Title cookie:hello guest only admin can get flag. (cookie spoofing, authentication, forgery)
随机推荐
Uncover the practice of Baidu intelligent testing in the field of automatic test execution
【数组的中的某个属性的监听】
Gradientdrawable get a single color
SQL learning alter add new field
What are the advantages of the live teaching system to improve learning quickly?
[Yugong series] go teaching course 003-ide installation and basic use in July 2022
初识结构体
What should we pay attention to when entering the community e-commerce business?
idea用debug调试出现com.intellij.rt.debugger.agent.CaptureAgent,导致无法进行调试
Cloud computing technology hotspot
Figure neural network + comparative learning, where to go next?
Data visualization platform based on template configuration
LeetCode 556. 下一个更大元素 III
百度交易中台之钱包系统架构浅析
Community group buying has triggered heated discussion. How does this model work?
为什么不建议你用 MongoDB 这类产品替代时序数据库?
LeetCode 503. Next bigger Element II
La voie de l'évolution du système intelligent d'inspection et d'ordonnancement des petites procédures de Baidu
[ManageEngine] how to make good use of the report function of OpManager
移动端异构运算技术-GPU OpenCL编程(进阶篇)