React Native应用程序安装在Andoid上失败
在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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我通过使用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.