【发布时间】: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