You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "GitToTheHub (via GitHub)" <gi...@apache.org> on 2025/07/08 16:33:25 UTC

[D] Android: Compile with `-Xlint:deprecation` [cordova]

GitHub user GitToTheHub created a discussion: Android: Compile with `-Xlint:deprecation`

Hi,

when I build a plain Android Cordova app without any plugins on the latest master, i get some warnings:

```bash
> Task :CordovaLib:compileDebugJavaWithJavac
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
```

I want to examine, what these problems are by compiling it with `-Xlint:deprecation`, but I don't have a clue how I can do it :)

Regards,

Manuel

GitHub link: https://github.com/apache/cordova/discussions/553

----
This is an automatically sent email for issues@cordova.apache.org.
To unsubscribe, please send an email to: issues-unsubscribe@cordova.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Re: [D] Android: Compile with `-Xlint:deprecation` [cordova]

Posted by "GitToTheHub (via GitHub)" <gi...@apache.org>.
GitHub user GitToTheHub added a comment to the discussion: Android: Compile with `-Xlint:deprecation`

Cool thanks for directly implementing and documenting it :) Maybe it would be good to also note in the documentation, that it sets "-Xlint:deprecation" for compiling? I'm noting this, because when a developer sees:

```bash
> Task :CordovaLib:compileDebugJavaWithJavac
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
```

He could google "cordova -Xlint:deprecation" and he would find the preference flag.

GitHub link: https://github.com/apache/cordova/discussions/553#discussioncomment-13707228

----
This is an automatically sent email for issues@cordova.apache.org.
To unsubscribe, please send an email to: issues-unsubscribe@cordova.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Re: [D] Android: Compile with `-Xlint:deprecation` [cordova]

Posted by "breautek (via GitHub)" <gi...@apache.org>.
GitHub user breautek added a comment to the discussion: Android: Compile with `-Xlint:deprecation`

Maybe in cordova-android@15, we can just flip a preference flag on: https://github.com/apache/cordova-android/pull/1822 ;)

GitHub link: https://github.com/apache/cordova/discussions/553#discussioncomment-13702636

----
This is an automatically sent email for issues@cordova.apache.org.
To unsubscribe, please send an email to: issues-unsubscribe@cordova.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Re: [D] Android: Compile with `-Xlint:deprecation` [cordova]

Posted by "breautek (via GitHub)" <gi...@apache.org>.
GitHub user breautek added a comment to the discussion: Android: Compile with `-Xlint:deprecation`

In the projects build.gradle file (not to be confused with the module/app's build.gradle) the following will enable deprecation prints:

```
allprojects {
    subprojects {
        afterEvaluate {
            tasks.withType(JavaCompile).tap {
                configureEach {
                    options.compilerArgs += "-Xlint:deprecation"
                }
            }
        }
    }
}
```

Not sure on the best way to inject this into the cordova project, but I feel like this should be an option that can be enabled, maybe via a preference.

GitHub link: https://github.com/apache/cordova/discussions/553#discussioncomment-13698966

----
This is an automatically sent email for issues@cordova.apache.org.
To unsubscribe, please send an email to: issues-unsubscribe@cordova.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Re: [D] Android: Compile with `-Xlint:deprecation` [cordova]

Posted by "GitToTheHub (via GitHub)" <gi...@apache.org>.
GitHub user GitToTheHub added a comment to the discussion: Android: Compile with `-Xlint:deprecation`

Thanks, that worked :)

GitHub link: https://github.com/apache/cordova/discussions/553#discussioncomment-13699376

----
This is an automatically sent email for issues@cordova.apache.org.
To unsubscribe, please send an email to: issues-unsubscribe@cordova.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org