zoukankan      html  css  js  c++  java
  • Android打包中的两个问题--lint/GC overhead limit exceeded

    Explanation for issues of type "MissingTranslation":

       Explanation for issues of type "MissingTranslation":
       If an application has more than one locale, then all the strings declared
       in one language should also be translated in all other languages.
    
       If the string should not be translated, you can add the attribute
       translatable="false" on the <string> element, or you can define all your
       non-translatable strings in a resource file called donottranslate.xml. Or,
       you can ignore the issue with a tools:ignore="MissingTranslation"
       attribute.
    
       By default this detector allows regions of a language to just provide a
       subset of the strings and fall back to the standard language strings. You
       can require all regions to provide a full translation by setting the
       environment variable ANDROID_LINT_COMPLETE_REGIONS.
    
       You can tell lint (and other tools) which language is the default language
       in your res/values/ folder by specifying tools:locale="languageCode" for
       the root <resources> element in your resource file. (The tools prefix
       refers to the namespace declaration http://schemas.android.com/tools.)
    
    19 errors, 0 warnings
     FAILED
    
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Execution failed for task ':app:lintVital_7lkRelease'.
    > Lint found fatal errors while assembling a release target.
      
      To proceed, either fix the issues identified by lint, or modify your build script as follows:
      ...
      android {
          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
          }
      }

    具体方式已经在log中说明了---在build.gradle里面增加
    android {
          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
          }
      }
    java.lang.OutOfMemoryError: GC overhead limit exceeded

    是发生在GC占用大量时间为释放很小空间的时候发生的,是一种保护机制。我在JSP导大Excel的时候碰到过。 
    最终解决方案是,关闭该功能,在gradle.properties文件中找到这一行org.gradle.jvmargs=..这一行在最后面加入 -XX:-UseGCOverheadLimit 然后去掉前面的#号 ,重新编译,OK.

    详细的gradle.properties文件内容为:
    ## Project-wide Gradle settings.
    #
    # For more details on how to configure your build environment visit
    # http://www.gradle.org/docs/current/userguide/build_environment.html
    #
    # Specifies the JVM arguments used for the daemon process.
    # The setting is particularly useful for tweaking memory settings.
    # Default value: -Xmx10248m -XX:MaxPermSize=256m
     org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:-UseGCOverheadLimit
    #
    # When configured, Gradle will run in incubating parallel mode.
    # This option should only be used with decoupled projects. More details, visit
    # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
    # org.gradle.parallel=true
    #Thu Aug 04 19:18:50 CST 2016
    android.useDeprecatedNdk=true


  • 相关阅读:
    使用JavaScript实现新闻滚动效果
    ArcGIS Server建立缓存(切图)原理解析[图解] (转载)
    tp5 中使用自定义扩展类和函数
    phpstorm 配置点右上角浏览器图标时用浏览器打开当前页面
    PHP命名空间(Namespace)的使用简介
    linux 查看和修改文件时间
    头像上传uploadPreview插件
    富文本编辑器 kindEditor
    linux 计划任务 crontab 简单用法
    阿里 短信 使用方法
  • 原文地址:https://www.cnblogs.com/yunmenzhe/p/7505842.html
Copyright © 2011-2022 走看看