gpt4 book ai didi

android - 在项目 'installDebug' 中找不到任务 ':app' - 创建项目后运行 android

转载 作者:行者123 更新时间:2023-12-04 23:51:55 25 4
gpt4 key购买 nike

创建一个 react native 项目后,我尝试在我的 android 设备上运行它。我输入 adb devices进入终端,我看到了我的设备。我跑了react-native run-android .过了一会儿Task 'installDebug' not found in project ':app'弹出。

Jetifier found 962 file(s) to forward-jetify. Using 4 workers
...info Starting JS server...
'D:\Android\android-sdk\platform-tools' is not recognized as an internal or external command, operable program or batch file.
info Launching emulator...
error Failed to launch emulator. Reason: No emulators found as an output of `emulator -list-avds`.
warn Please launch an emulator manually or connect a device. Otherwise app may fail to launch.
info Installing the app...

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.0.1/userguide/command_line_interface.html#sec:command_line_warnings

FAILURE: Build failed with an exception.

* What went wrong:
Task 'installDebug' not found in project ':app'.

* Try:
Run gradlew tasks to get a list of available tasks.
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 15s

error Failed to install the app. Make sure you have the Android development environment set up:
https://reactnative.dev/docs/getting-started.html#android-development-environment. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8
081

FAILURE: Build failed with an exception.

* What went wrong:
Task 'installDebug' not found in project ':app'.

这是 react 原生信息
info Fetching system and libraries information...
System:
OS: Windows 7 6.1.7601
CPU: (4) x64 Intel(R) Core(TM) i3-2100 CPU @ 3.10GHz
Memory: 881.91 MB / 3.97 GB
Binaries:
Node: 10.16.1 - C:\Program Files\nodejs\node.EXE
Yarn: 1.17.3 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 6.9.0 - C:\Program Files\nodejs\npm.CMD
Watchman: Not Found
SDKs:
Android SDK: Not Found
IDEs:
Android Studio: Version 3.2.0.0 AI-181.5540.7.32.5014246
Languages:
Python: Not Found
npmPackages:
@react-native-community/cli: Not Found
react: 16.11.0 => 16.11.0
react-native: 0.62.0 => 0.62.0
npmGlobalPackages:
*react-native*: Not Found

我跑了 gradlew tasks我没有看到 installDebug在安装任务下。我确信我正确设置了环境变量,包括 android SDK、JDK。我尝试重新安装 react-native。我将我的 sdk 的位置放在 android 文件夹下的 local.properties 中。我跑了 gradlew installDebuginstallDebug not found in root project '[app's name]'出现了。互联网上的解决方案都没有奏效。

谁能帮我解决这个问题?
谢谢你。

最佳答案

我也面临同样的问题。
这对我有用。

我在 Android Studio 中打开了 Android 项目。
这可以位于 YourReactNativeProjectFolder/android

当我在 Android Studio 中打开这个项目时,它缺少配置。等待一段时间,让 Android Studio 对其进行配置并要求您更新 Gradle。更新 Gradle,现在您可以从 Android Studio 或使用命令行“npx react-native run-android”运行您的项目

我希望它会有所帮助。

最好的

关于android - 在项目 'installDebug' 中找不到任务 ':app' - 创建项目后运行 android,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60892647/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com