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


  • 相关阅读:
    解决MySql报错:1130
    Mac 安装 RabbitMQ 出现的问题
    Java 中的关键字
    ExtJS 去除水印
    MAC VMware fusion 12.1.0 Centos7 网络配置
    Linux常见目录结构
    CentOS 设置网络及安装 ifconfig
    Web项目部署到IIS的方法
    异常处理-System.IO.IOException: 由于远程方已关闭传输流,身份验证失败
    C#委托总结-匿名方法&Lambda表达式
  • 原文地址:https://www.cnblogs.com/yunmenzhe/p/7505842.html
Copyright © 2011-2022 走看看