square / assertj-android

A set of AssertJ helpers geared toward testing Android.
https://square.github.io/assertj-android/
Apache License 2.0
1.58k stars 156 forks source link

gradle build fails with android lint errors: "NewApi: Calling new methods on older versions" x 500 #93

Closed avh4 closed 10 years ago

avh4 commented 10 years ago

I'm assuming everyone else is building this with gradle, so I'm guessing something's wrong with my local setup? In that case, any pointers on what might be wrong? On the other hand, fest-assert is just for tests, so maybe abortOnError should be turned off?

./gradlew build yields:

:androidJavadocs UP-TO-DATE
    ... <snipped> ...
:assemble UP-TO-DATE
:checkstyleDebug UP-TO-DATE
:checkstyleRelease UP-TO-DATE
:lint
Ran lint on variant release: 558 issues found
Ran lint on variant debug: 558 issues found
Wrote HTML report to file:fest-android/build/lint-results.html
Wrote XML report to fest-android/build/lint-results.xml
:lint FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':lint'.
> Lint found errors in the project; aborting build.

  Fix the issues identified by lint, or add the following to your build script to proceed with errors:
  ...
  android {
      lintOptions {
          abortOnError false
      }
  }
  ...

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

To see the lint errors: open build/lint-results.html

There are 500 errors similar to this one:

../src/main/java/org/fest/assertions/api/android/widget/AbstractAbsListViewAssert.java:15: 
Call requires API level 11 (current min is 7): android.widget.AbsListView#getCheckedItemCount
JakeWharton commented 10 years ago

Yep. Disabled on master. I never use the build task so it wasn't being invoked.

avh4 commented 10 years ago

Great, thanks for the quick updates!

As a suggestion, maybe you guys should add a line or two in the readme suggesting what build commands to use.