无法在本机反应中生成APK::app:lintVitalRelease

时间:2019-10-27 18:54:11

标签: android react-native gradle react-native-android

我使用以下命令创建密钥:

keytool -genkey -v -keystore first-key.keystore -alias first-key-alias -keyalg RSA -keysize 2048 -validity 1000

并将其添加到gradle文件中:

signingConfigs {
        release {
            storeFile file('/home/mohamadreza/keys/first-key.keystore')
            storePassword '1234567890'
            keyAlias = 'first-key-alias'
            keyPassword 'qq-2012'
        }
    }
    buildTypes {
        release {
            // Caution! In production, you need to generate your own keystore file.
            // see https://facebook.github.io/react-native/docs/signed-apk-android.
            signingConfig signingConfigs.release
            minifyEnabled enableProguardInReleaseBuilds
            proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
        }
    }

然后我运行以下命令:
cd android && ./gradlew assembleRelease

我收到此错误:

Could not determine the dependencies of task ':app:lintVitalRelease'.
> Could not resolve all task dependencies for configuration ':app:lintClassPath'.
   > Could not find com.android.tools.lint:lint-gradle:26.4.2.
     Searched in the following locations:
...

我的类路径:classpath('com.android.tools.build:gradle:3.4.2')

我该如何解决?

1 个答案:

答案 0 :(得分:0)

我今天面对同样的问题。 我尝试了以下操作:

  1. 我从文件夹中删除了output.json文件 “ yourProject / android / app / build / outputs / apk / release”。

  2. 和RUN命令来构建应用程序。

对我有用。 希望也能为您服务