react-native-smart-splashscreen:verifyReleaseResources

时间:2019-04-11 06:01:09

标签: react-native splash-screen

在生成发行版APK 我收到此错误:

失败:构建失败,并出现异常。

出了什么问题: 任务':react-native-smart-splashscreen:verifyReleaseResources'的执行失败。

我使用react-native-splashscreen react-native-cli:2.0.1 反应本机:0.59.4

这是我的代码

android {     compileSdkVersion rootProject.ext.compileSdkVersion

compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}

defaultConfig {
    applicationId "com.inclo"
    minSdkVersion rootProject.ext.minSdkVersion
    targetSdkVersion rootProject.ext.targetSdkVersion
    versionCode 1
    versionName "1.0"
}

signingConfigs {
    release {
        if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) {
            storeFile file(MYAPP_RELEASE_STORE_FILE)
            storePassword MYAPP_RELEASE_STORE_PASSWORD
            keyAlias MYAPP_RELEASE_KEY_ALIAS
            keyPassword MYAPP_RELEASE_KEY_PASSWORD
        }
    }
}

splits {
    abi {
        reset()
        enable enableSeparateBuildPerCPUArchitecture
        universalApk false  // If true, also generate a universal APK
        include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
    }
}
buildTypes {
    release {
        minifyEnabled enableProguardInReleaseBuilds
        proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
    }
}

}

2 个答案:

答案 0 :(得分:0)

导航到

sudo kill -9 20152

编辑并保留node_modules/react-native-splashscreen/android/build.gradle compileSdkVersion buildToolsVersion minSdkVersion与您在

中相同
targetSdkVersion

再次同步项目。
在终端上运行android/app/build.gradle ,或尝试重新注册APK版本。



希望它能起作用!

答案 1 :(得分:0)

只需运行此命令即可发布

  

./ gradlew app:assembleRelease