我正在尝试根据react-native-code-push 文档的这一部分配置我的 RN android 项目
我的 build.gradle 文件有这样的配置:
buildTypes {
debug {
}
releaseStaging {
buildConfigField "String", "CODEPUSH_KEY", CODEPUSH_KEY_STAGING
}
release {
buildConfigField "String", "CODEPUSH_KEY", CODEPUSH_KEY_PRODUCTION
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
signingConfig signingConfigs.release
}
}
但是当我运行时:react-native run-android --variant releaseStaging
我得到错误:Task 'installReleaseStagingDebug' not found in root project 'MyAppName'.
也试过跑步react-native run-android --configuration releaseStaging
这给了我一个稍微好一点的错误:
Task 'installReleaseStaging' not found in root project 'MyAppName'. Some candidates are: 'uninstallReleaseStaging'.
知道我缺少什么吗?
谢谢!
乌里