R
R
robert_n2022-01-03 17:14:16
Android
robert_n, 2022-01-03 17:14:16

How to disable lint and all warnings when building an android project?

I am working on a large project and faced with the fact that Android Studio builds the project for a very long time, sometimes it takes up to 4-5 minutes. At the same time, this is not a cold build, it happens that I will only make a couple of fixes in the xml markup or add a couple of lines of code and the project seems to be rebuilt on a new one. After lengthy builds, a bunch of warnings fall out with the note "that you have Deprecated there, but here you have Unused Resourses". The number of warnings in the project is more than 1000 pieces. Approximate content:

Parameter 'age' is never used, could be renamed to _
This is a delicate API and its use requires care.
'getColor(Int): Int' is deprecated. Deprecated in Java
'constructor Handler()' is deprecated. Deprecated in Java


What I did:
1. Disabled code inspection via Setting - Editor - Inspections
2. In the settings I wrote Command line options: --offline -x lint
3. Enabled Offline Mode on the Gradle tab
4. Configured lintOptions
lintOptions {
        checkOnly 'NewApi', 'HandlerLeak'
        checkReleaseBuilds false
        abortOnError false
        checkAllWarnings false
        ignoreWarnings true
        quiet true
        tasks.lint.enabled = false
        checkDependencies false
    }


5. I tried this design

tasks.whenTaskAdded { task ->
    if (task.name.equals("lint")) {
        task.enabled = false
    }
}


6. I also tried to set the following values ​​in gradle.properties
org.gradle.jvmargs=-Xms1024m -Xmx4096m -XX:MaxPermSize=1024m -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:+UseParallelGC
org.gradle.daemon=true
org.gradle.configureondemand=false
org.gradle.caching=true
org.gradle.parallel=true
android.useAndroidX=true
android.enableJetifier=true


So far nothing has helped. Moreover, if you use the @SuppressLint and @SuppressWarnings annotations, there is no use either.
Software version:
Android Studio Arctic Fox | 2020.3.1 Patch 3
Build #AI-203.7717.56.2031.7784292, built on October 1, 2021


Please tell me what other settings need to be applied so that Lint does not start during the build of the project, at least the Debug build, or if this is not a problem with Lint, then what can delay the build so much?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
O
Oleg, 2022-01-03
@402d

Check what slows down, and do not guess.
61d3244c1ade5355530268.png
Build Analyzer
On the overview tab, it will show the main plug where.
On the tasks tab, you can see about each

A
Artem Maximum, 2015-09-17
@artem_phantom

The error was that the project was in a directory called D:/[projects]/_frontend_/{project name}
As soon as I dragged it to a folder with a normal name, everything worked right away

A
Alejandro Esquire, 2015-09-17
@A1ejandro

Do you have write permissions?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question