Error when running cordova build –release android

后端 未结 8 1335
野趣味
野趣味 2020-12-25 10:35

I\'m trying to publish my Android app by following the instructions here:

http://ionicframework.com/docs/guide/publishing.html

However, when I run cordova bu

相关标签:
8条回答
  • 2020-12-25 11:14

    Add the following entry to the /platforms/android/build.gradle file in your Ionic project:

    android {
       lintOptions { disable 'MissingTranslation', 'ExtraTranslation' }
    }
    

    worked.

    0 讨论(0)
  • 2020-12-25 11:14

    For those who prefer to keep platforms directory out of the VCS (Git, etc),
    the best solution at the moment is to use a plugin called ignore-lint-translation.

    cordova plugin add cordova-plugin-ignore-lint-translation --save
    

    The effective result is the addition of a gradle file that will disable such lint options (doh!).

    0 讨论(0)
  • 2020-12-25 11:15

    If your build failed because of MissingTranslation issues, and if the string should not be translated, you can add the attribute translatable="false" on that <string> element in /platforms/android/app/src/main/res/values/strings.xml file.

    So, if the strings in the strings.xml file is like this:

    <string name="app_name">Your App Name</string>
    <string name="launcher_name">@string/app_name</string>
    <string name="activity_name">@string/launcher_name</string>
    

    Edit them to look like this:

    <string name="app_name" translatable="false">Your App Name</string>
    <string name="launcher_name" translatable="false">@string/app_name</string>
    <string name="activity_name" translatable="false">@string/launcher_name</string>
    

    This solution worked for me.

    0 讨论(0)
  • 2020-12-25 11:24

    Solved this by adding

    lintOptions {
        abortOnError false
    }
    

    to the android {} section in /platforms/android/build.gradle

    0 讨论(0)
  • 2020-12-25 11:24
    echo "android { lintOptions { checkReleaseBuilds false } }" >> platforms/android/build-extras.gradle
    
    0 讨论(0)
  • 2020-12-25 11:29

    To fixed this error you should add

    lintOptions {
        checkReleaseBuilds false
        // Or, if you prefer, you can continue to check for errors in release builds,
        // but continue the build even when errors are found:
        abortOnError false
    }
    

    In android {} section in /platforms/android/build.gradle

    0 讨论(0)
提交回复
热议问题