Java 获取错误:无法确定任务';的依赖项:应用程序:installDebug';。在设备或模拟器上运行react native时

Java 获取错误:无法确定任务';的依赖项:应用程序:installDebug';。在设备或模拟器上运行react native时,java,android,react-native,emulation,Java,Android,React Native,Emulation,在android设备或模拟器上运行react本机应用程序时遇到问题。我总是遇到这个错误,我无法修复它 info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag. Jetifier found 903 file(s) to forward-jetify. Using 16 workers... info Starting JS ser

在android设备或模拟器上运行react本机应用程序时遇到问题。我总是遇到这个错误,我无法修复它

info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 903 file(s) to forward-jetify. Using 16 workers...
info Starting JS server...
info Installing the app...

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:installDebug'.
> SDK location not found. Define location with an ANDROID_SDK_ROOT environment variable or by setting the sdk.dir path in your project's local properties file at 'C:\Users\saadb\Desktop\ReactNative\MyApp\android\local.properties'.

* 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 2s

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:installDebug'.
> SDK location not found. Define location with an ANDROID_SDK_ROOT environment variable or by setting the sdk.dir path in your project's local properties file at 'C:\Users\saadb\Desktop\ReactNative\MyApp\android\local.properties'.

* 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 2s

    at makeError (C:\Users\saadb\Desktop\ReactNative\MyApp\node_modules\@react-native-community\cli-platform-android\node_modules\execa\index.js:174:9)    
    at C:\Users\saadb\Desktop\ReactNative\MyApp\node_modules\@react-native-community\cli-platform-android\node_modules\execa\index.js:278:16
    at processTicksAndRejections (node:internal/process/task_queues:94:5)
    at async runOnAllDevices (C:\Users\saadb\Desktop\ReactNative\MyApp\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:5)
    at async Command.handleAction (C:\Users\saadb\Desktop\ReactNative\MyApp\node_modules\@react-native-community\cli\build\index.js:186:9)
info Run CLI with --verbose flag for more details.
我试着在线清理grandlew和其他一些东西,比如删除node_模块和运行npm安装。但我还是有同样的问题