当前位置:网站首页>[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 .
边栏推荐
- Android privacy sandbox developer preview 3: privacy, security and personalized experience
- Nips2021 | new SOTA for node classification beyond graphcl, gnn+ comparative learning
- 90%的人都不懂的泛型,泛型的缺陷和应用场景
- First understanding of structure
- TDengine 已经支持工业英特尔 边缘洞见软件包
- 【el-table如何禁用】
- Solve liquibase – waiting for changelog lock Cause database deadlock
- 微信小程序获取住户地区信息
- Why don't you recommend using products like mongodb to replace time series databases?
- About getfragmentmanager () and getchildfragmentmanager ()
猜你喜欢
从“化学家”到开发者,从甲骨文到 TDengine,我人生的两次重要抉择
[sourcetree configure SSH and use]
项目实战 | Excel导出功能
C language - input array two-dimensional array a from the keyboard, and put 3 in a × 5. The elements in the third column of the matrix are moved to the left to the 0 column, and the element rows in ea
oracle 多行数据合并成一行数据
OpenGL - Model Loading
Principle and performance analysis of lepton lossless compression
百度APP 基于Pipeline as Code的持续集成实践
First understanding of structure
Dry goods sorting! How about the development trend of ERP in the manufacturing industry? It's enough to read this article
随机推荐
Observation cloud and tdengine have reached in-depth cooperation to optimize the cloud experience of enterprises
A detailed explanation of the general process and the latest research trends of map comparative learning (gnn+cl)
H. 265 introduction to coding principles
MySQL does not take effect in sorting string types
SMT32H7系列DMA和DMAMUX的一点理解
百度评论中台的设计与探索
百度APP 基于Pipeline as Code的持续集成实践
Unity SKFramework框架(二十四)、Avatar Controller 第三人称控制
How to empty uploaded attachments with components encapsulated by El upload
[technical live broadcast] how to rewrite tdengine code from 0 to 1 with vscode
On July 2, I invite you to TD Hero online press conference
How do enterprises choose the appropriate three-level distribution system?
SQL learning group by multi table grouping scenario
Wechat applet obtains household area information
A keepalived high availability accident made me learn it again
卷起来,突破35岁焦虑,动画演示CPU记录函数调用过程
An article takes you into the world of cookies, sessions, and tokens
Analysis of eventbus source code
The writing speed is increased by dozens of times, and the application of tdengine in tostar intelligent factory solution
LeetCode 31. 下一个排列