Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-8864

Add lintOptions (checkReleaseBuilds OR abortOnError) to the build.gradle script for the default cordova-android project

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 4.0.0
    • Fix Version/s: None
    • Component/s: cordova-android
    • Environment:

      Mac OS X 10.10.3; cordova-cli@4.3.0; cordova-android@4.0.0; Android Studio

      Description

      Please can you add in the following to the build.gradle script for the android module in the cordova-android project:

      ...
      
      android {
          lintOptions {
              checkReleaseBuilds false
          }
      }
      
      ...
      

      Or:

      ...
      
      android {
          lintOptions {
              abortOnError false
          }
      }
      
      ...
      

      The former has the advantage that all lint errors will display for debug purposes should you need to review them.

      The issue occurred when using the plugin com.phonegap.plugins.barcodescanner and creating a signed APK in Android Studio - this plugin uses translations and because the strings.xml contains additional items which are not present in the plugin's translation XML files, Lint/Android Studio throws a wobbly and does not export the APK because of an error.

      It could be argued that the plugin should alter their XML translations and include the MissingTranslations attribute, but there are over 30 files and this fix seemed to quickly resolve the issue instead of editing each one manually.

      See: http://stackoverflow.com/questions/27472282/how-to-sign-apk-on-android-studio-even-with-non-translated-strings for more info.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              keldar Kelvin Dart
            • Votes:
              3 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: