【问题标题】:How can I fix the Keystore file not found for signing config 'debug' error?如何修复未找到用于签名配置“调试”错误的密钥库文件?
【发布时间】:2020-06-22 02:32:08
【问题描述】:

我正在尝试设置一个新的 react-native 项目,但在尝试 react-native run-android 时遇到了这个错误:

What went wrong:
Execution failed for task ':app:validateSigningDebug'.
> Keystore file 'C:\Users\Ahers\Downloads\reactnative-beautiful-ui-master (1)\reactnative-beautiful-ui-master\android\app\debug.keystore' not found for signing config 'debug'. 

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
Note: C:\Users\Ahers\Downloads\reactnative-beautiful-ui-master (1)\reactnative-beautiful-ui-master\node_modules\react-native-gesture-handler\android\src\main\java\com\swmansion\gesturehandler\react\RNGestureHandlerButtonViewManager.java uses or overrides a deprecated API.

这是我的 build.grade 代码:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext {
        buildToolsVersion = "28.0.3"
        minSdkVersion = 16
        compileSdkVersion = 28
        targetSdkVersion = 28
        supportLibVersion = "28.0.0"
    }
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath("com.android.tools.build:gradle:3.4.1")

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        mavenLocal()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url("$rootDir/../node_modules/react-native/android")
        }
        maven {
            // Android JSC is installed from npm
            url("$rootDir/../node_modules/jsc-android/dist")
        }

        google()
        jcenter()
    }
}

我尝试运行此命令以修复它,但它不起作用:

keytool -genkey -v -keystore debug.keystore
  -storepass android -alias androiddebugkey -keypass android -keyalg RSA -keysize 2048 -validity 10000

老实说,我不确定该怎么做,所以如果有任何建议,我将不胜感激。

【问题讨论】:

    标签: android ios reactjs react-native mobile


    【解决方案1】:

    您的密钥库文件似乎已被删除或更改。

    您可以通过 Android Studio 生成它。使用这个link

    【讨论】:

    • 您好,先生。当我点击构建时,这些选项对我来说并没有出现。我有什么办法可以消除对这个密钥库文件的需要吗?
    • 对不起,先生,无法消除密钥库文件以生成签名版本。如果你想生成调试版本,那就没有必要了。
    • 您是否尝试过通过 Android Studio 生成密钥库?
    • 您好,先生。我试过了,谢天谢地。非常感谢!
    猜你喜欢
    • 1970-01-01
    • 2016-06-25
    • 2020-09-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-01-21
    • 2020-02-22
    • 1970-01-01
    相关资源
    最近更新 更多