question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Android Lint claims NewApi for try-with-resources

See original GitHub issue

With retrolambda and android lint, I got “Try-with-resources requires API level 19 (current min is 14)” on below line.

try (Realm realm = getRealm()) {

But to suppress this requires ignoring all NewApi usage incl. other than try-with-resources. Is there any workaround for this…?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
evantcommented, Oct 14, 2015
  <issue id="NewApi">
    <ignore regexp="Try-with-resources requires API level 19"/>
  </issue>
0reactions
yprestocommented, Nov 2, 2015

oops… Android Studio also claims it. But there seems to be no regexp option.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android Lint API Guide - Google Samples
The Detector API: “Implement a new lint check”. This is the API which lets checkers analyze code and report problems that they find....
Read more >
Improve your code with lint checks - Android Developers
The lint tool checks your Android project source files for potential bugs and optimization improvements for correctness, security, performance, usability, ...
Read more >
Android Lint flagging NewAPI Error where it should not
I think that you get the error because you are mixing in a single method two different methods for different api version. You...
Read more >
NewApi lint check does not factor in usage of core library ...
The NewApi lint check incorrectly reports that certain APIs are not available on devices using the minimum SDK level, despite core library desugaring...
Read more >
ApiDetector.java - Google Git
import static com.android.tools.lint.detector.api.ClassContext. ... Constructs a new API check */ ... new API level; it's highly likely that the constructor.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found