java.lang.NullPointerException(没有错误消息)当试图使标志apk

时间:2018-02-23 15:05:00

标签: android split apk

我正在使用apply plugin: 'com.android.application' android { compileSdkVersion 27 defaultConfig { applicationId "com.example.me" minSdkVersion 14 targetSdkVersion 27 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled true // shrinkResources true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } splits { abi { enable true reset() include 'x86_64', 'x86', 'armeabi', 'armeabi-v7a', 'arm64-v8a', 'mips' universalApk false } } } ext.versionCodes = ['armeabi': 1, 'armeabi-v7a': 2, 'arm64-v8a': 3, mips: 4, 'x86': 5, 'x86_64': 6] import com.android.build.OutputFile android.applicationVariants.all { variant -> // assign different version code for each output variant.outputs.each { output -> output.versionCodeOverride = project.ext.versionCodes.get(output.getFilter(OutputFile.ABI)) * 1000000 + android.defaultConfig.versionCode } } dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'com.android.support:appcompat-v7:27.0.2' implementation 'com.android.support:design:27.0.2' implementation 'com.android.support:support-v4:27.0.2' testImplementation 'junit:junit:4.12' androidTestImplementation 'com.android.support.test:runner:1.0.1' compile 'com.google.android.gms:play-services-ads:11.8.0' compile 'uk.co.chrisjenx:calligraphy:2.3.0' androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1' compile 'com.github.barteksc:android-pdf-viewer:1.6.0' } Android PdfViewer在我的应用中显示pdf。但是在添加这个库之后,apk的大小变得非常大。所以我在build.gradle(moudle:app)文件中添加了这个。 一切都还可以,但是当我尝试制作一个标志时,只能显示此错误消息。

错误消息 错误:任务':app:lintVitalRelease'。

的执行失败
  

无法删除旧的D:\ Google Play \ exampleapp \ app \ build \ reports \ lint-results-release-fatal.html

这是我的build.gradle文件

 @{
    var test = "";
    if (Model.ItemNo != null)
    {
        test = "<div>";
        test += "<div style='padding:3px'>";
        test += "<label>ItemNo</label>";
        test += Model.ItemNo;
        test += "</div>";
        test += "</div>";
    }
}

1 个答案:

答案 0 :(得分:1)

你的android {}标签内的

只需添加此

    // This is important, it will run lint checks but won't abort build
android {   
   lintOptions {
          abortOnError false
      }
}

如果abortOnError false无法解决您的问题,可以试试这个

android {
    lintOptions {
        checkReleaseBuilds false
    }
}

它应该解决你的问题