Android Lint error : Execution failed for task ':react-native-sensitive-info:lint'

Android Lint error : Execution failed for task ':react-native-sensitive-info:lint'

我在我的项目中使用了 react-native-sensitive-info 包,但我遇到了一个问题。构建失败并出现以下错误 Execution failed for task ':react-native-sensitive-info:lint'

我在网上查看并尝试添加 abortOnError falsecheckReleaseBuilds false,但两者都不起作用。

任何人都可以建议我可以做些什么来解决这个问题。

谢谢 R

[(> Task :react-native-sensitive-info:lint FAILED
Ran lint on variant release: 37 issues found
Ran lint on variant debug: 37 issues found
Wrote HTML report to file:///C:/Development/xxx-Retail-ReactNative/retail-native-app/node_modules/react-native-sensitive-info/android/build/reports/lint-results.html
Wrote XML report to file:///C:/Development/xxx-Retail-ReactNative/retail-native-app/node_modules/react-native-sensitive-info/android/build/reports/lint-results.xml

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-sensitive-info:lint'.
> Lint found errors in the project; aborting build.

  Fix the issues identified by lint, or add the following to your build script to proceed with errors:
  ...
  android {
      lintOptions {
          abortOnError false
      }
  }
  ...

  The first 3 errors (out of 10) were:
  C:\Development\xxx-Retail-ReactNative\retail-native-app\node_modules\react-native-sensitive-info\android\src\main\java\br\com\classapp\RNSensitiveInfo\view\Fragments\FingerprintAuthenticationDialogFragment.java:115: Error: Call requires API level 23 (current min is 18): android.content.Context#getSystemService [NewApi]
                  mActivity.getSystemService(FingerprintManager.class),
                            ~~~~~~~~~~~~~~~~
  C:\Development\xxx-Retail-ReactNative\retail-native-app\node_modules\react-native-sensitive-info\android\src\main\java\br\com\classapp\RNSensitiveInfo\view\Fragments\FingerprintAuthenticationDialogFragment.java:115: Error: Class requires API level 23 (current min is 18): android.hardware.fingerprint.FingerprintManager [NewApi]
                  mActivity.getSystemService(FingerprintManager.class),
                                             ~~~~~~~~~~~~~~~~~~
  C:\Development\xxx-Retail-ReactNative\retail-native-app\node_modules\react-native-sensitive-info\android\src\main\java\br\com\classapp\RNSensitiveInfo\view\Fragments\FingerprintUiHelper.java:35: Error: Class requires API level 23 (current min is 18): android.hardware.fingerprint.FingerprintManager.AuthenticationCallback [NewApi]
  public class FingerprintUiHelper extends FingerprintManager.AuthenticationCallback {
                                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
See https://docs.gradle.org/4.8/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 2m 23s

我也添加了'abortOnError false'。

这里是 build.gradle.

 lintOptions {
        abortOnError false
        //checkReleaseBuilds false
    }


subprojects {
        project.configurations.all {
            afterEvaluate {project ->
                if (project.hasProperty("android")) {
                    android {
                        compileSdkVersion rootProject.ext.compileSdkVersion
                        buildToolsVersion rootProject.ext.buildToolsVersion
                    }
                }
            }
            resolutionStrategy.eachDependency { details ->
                if (details.requested.group == 'com.android.support'
                    && !details.requested.name.contains('multidex') ) {
                details.useVersion rootProject.ext.buildToolsVersion
                }
            }
        }
    }

buildscript {
    repositories {
        jcenter()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.3'
        classpath 'com.google.gms:google-services:3.0.0'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

ext {
    compileSdkVersion = 28
    buildToolsVersion = "27.0.3"
    minSdkVersion = 18
    targetSdkVersion = 28    
}

settings.gradle

include ':react-native-sensitive-info'
project(':react-native-sensitive-info').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-sensitive-info/android')

gradle.properties

android.useDeprecatedNdk=true
android.enableAapt2=false
android.enableJetifier=false
android.useAndroidX=false

package.json

"react-native-sensitive-info": "5.4.1",

你能建议一下如何解决这个问题吗

基于错误'Error: Class requires API level 23 (current min is 18)',我建议在build.gradle.

中将 minSdkVersion = 18 更改为 minSdkVersion = 23
ext {
    compileSdkVersion = 28
    buildToolsVersion = "27.0.3"
    minSdkVersion = 23
    targetSdkVersion = 28    
}