The current (and last released) version do not build cleanly. I’d love to contribute, but this is keping me from it…
To reproduce:
./gradlew build
Expected result:
Build runs and finishes without errors.
Actual result:
Build fails with an Androit lint error:
Execution failed for task ':app: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 } } ... The first 3 errors (out of 548) were: /home/michael/src/opencamera/app/src/main/java/net/sourceforge/opencamera/StorageUtils.java:530: Error: Try-with-resources requires API level 19 (current min is 15) [NewApi] try( Cursor cursor = context.getContentResolver().query(uri, null, null, null, null) ) { -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/michael/src/opencamera/app/src/main/res/values/strings.xml:15: Error: "choose_another_folder" is not translated in "it" (Italian) [MissingTranslation] <string name="choose_another_folder">Choose another folder</string> -~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/michael/src/opencamera/app/src/main/res/values/strings.xml:37: Error: "cancelled_repeat_mode" is not translated in "el" (Greek) [MissingTranslation] <string name="cancelled_repeat_mode">Cancelled repeat mode</string> -~~~~~~~~~~~~~~~~~~~~~~~~~~~
Versions tested:
Anonymous
It looks like it's treating the lint errors as compilation errors. This doesn't happen for me - I'm not sure if there's an Android Studio setting for this? I couldn't find one though. I'm on Android Studio 3.5.3.
If nothing else, the suggestion to add "abortOnError false" to the lintOptions should work?
(I do review the lint warnings/error each release, but they shouldn't be compilation errors; although having said that I missed the "Try-with-resources" one - it's fine as that method is only called on Android 5+ codepaths, but I'll look at fixing up the code to reflect that.)
I build straight from the command line, which may explain the different behavior. Haven’t followed up on this, but the same fix you suggested worked in a different project. Any reasons not to add it to the build script? I guess the majority of the folks who build from source don’t want to deal with the build chain complaining about non-critical errors in upstream code, and those who specifically want to fix lint errors hopefully know how to chang this setting…
I've made this change now.