安卓工作室错误:在根项目中找不到项目'app',命令失败:



Q。我得到了两个错误(在根项目中找不到项目"app")和(错误:命令失败:gradlew.bat-app:installDebug-PrecactNativeDevServerPort=8081)。我试图更改端口号或渐变版本。。等。但这两个错误一直在发生:(请帮帮我,我太累了。

//This is my version
buildToolsVersion = "29.0.2"
minSdkVersion = 16
compileSdkVersion = 29
targetSdkVersion = 29
classpath("com.android.tools.build:gradle:3.2.0")
classpath 'com.google.gms:google-services:4.0.1'
gradleVersion = '4.6'
distributionUrl=https://services.gradle.org/distributions/gradle-4.6-all.zip
//settings.gradle
rootProject.name = 'keynoti'
include ':app'
include ':react-native-firebase'
project(':react-native-firebase').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-firebase/android')
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)


// This is my error explanation
FAILURE: Build failed with an exception.

* What went wrong:
Project 'app' not found in root project 'keynoti'.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.        

* Get more help at https://help.gradle.org

BUILD FAILED in 23s

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

尝试在Android Studio IDE中清理项目并重建项目,如果不起作用,则从react native重建。

我也遇到了同样的问题。对我有用的是,我添加了一个文件(settings.gradle),你应该添加其中一行:

相关内容

最新更新