找不到用于配置``release''签名的密钥库.-React Native [英] keystore not found for signing config 'release'.-- React native

查看:551
本文介绍了找不到用于配置``release''签名的密钥库.-React Native的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为反应本机项目生成Signed APK. 按照android的步骤操作,并对本地文档做出反应.

I'm trying to generate a Signed APK for react native project. Followed steps from android and react native documentation.

我的Build.gradle文件

android {
compileSdkVersion 23
buildToolsVersion '26.0.2'

defaultConfig {
    applicationId "com.appmobile"
    minSdkVersion 16
    targetSdkVersion 22
    versionCode 1
    versionName "1.0"
    ndk {
        abiFilters "armeabi-v7a", "x86"
    }
}
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
        }
    }
}
buildTypes {
    release {
        signingConfig signingConfigs.release
        // minifyEnabled enableProguardInReleaseBuilds
        // proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
    }
}
splits {
    abi {
        reset()
        enable enableSeparateBuildPerCPUArchitecture
        universalApk false  // If true, also generate a universal APK
        include "armeabi-v7a", "x86"
    }
}
// buildTypes {
//     release {
//         minifyEnabled enableProguardInReleaseBuilds
//         proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
//     }
// }
// applicationVariants are e.g. debug, release
applicationVariants.all { variant ->
    variant.outputs.each { output ->
        // For each separate APK per architecture, set a unique version code as described here:
        // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
        def versionCodes = ["armeabi-v7a":1, "x86":2]
        def abi = output.getFilter(OutputFile.ABI)
        if (abi != null) {  // null for the universal-debug, universal-release variants
            output.versionCodeOverride =
                    versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
        }
    }
}

}

我已将密钥库文件放置在Android/app目录中

I have placed keystore file in Android/app directory

我的grade.properties

    android.useDeprecatedNdk=true
MYAPP_RELEASE_STORE_FILE=sampleReleasekeyStore.jks
MYAPP_RELEASE_KEY_ALIAS=*****
MYAPP_RELEASE_STORE_PASSWORD=*****
MYAPP_RELEASE_KEY_PASSWORD=*****

在执行cd android && ./gradlew assembleRelease时.

它抛出Build失败

任务':app:validateSigningRelease'的执行失败. 找不到用于签名配置发布"的密钥库文件/Users/username/Projects/appMobile/android/app/sampleReleasekeyStore.jks.

Execution failed for task ':app:validateSigningRelease'. Keystore file /Users/username/Projects/appMobile/android/app/sampleReleasekeyStore.jks not found for signing config 'release'.

我正在使用Mac环境.请让我知道我要去哪里了.

I'm using Mac environment. Please let me know where I'm going wrong.

推荐答案

  1. 打开Android Studio
  2. 将密钥库文件拖放到应用程序文件夹中
  3. 单击文件->同步项目

这篇关于找不到用于配置``release''签名的密钥库.-React Native的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆