React Native应用程序安装在Andoid上失败

发布于 2025-01-27 13:58:27 字数 731 浏览 5 评论 0原文

在Android上运行或运行Gradlew清洁时会遇到以下错误

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 create an instance of type org.gradle.kotlin.dsl.provider.KotlinScriptPluginFactory.
> Could not create service of type KotlinDslWorkspaceProvider using GradleUserHomeServices.createKotlinDslWorkspaceProvider().
   > Unexpected lock protocol found in lock file. Expected 3, found 0.

我刚刚创建了一个新的React-Native项目,并且在尝试 时刻,所以我的项目之外可能有一个错误。

有人已经经历过这样的事情吗?

I just created a new react-native project and I'm getting the following error when trying to run it on android or running gradlew clean:

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 create an instance of type org.gradle.kotlin.dsl.provider.KotlinScriptPluginFactory.
> Could not create service of type KotlinDslWorkspaceProvider using GradleUserHomeServices.createKotlinDslWorkspaceProvider().
   > Unexpected lock protocol found in lock file. Expected 3, found 0.

After trying to start an old react-native app I noticed I can't install any app at the moment, so there's probably a mistake outside my project.

Did anyone experience something like that already?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一瞬间的火花 2025-02-03 13:58:27

我通过使用Java 11而不是Java 8修复了它。

我删除了Gradle Cashe,然后出现了一个新的错误,告诉我使用Java 11。

I fixed it by using Java 11 instead of java 8.

I deleted the gradle cashe and then got a new error telling me to use java 11.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文