简体   繁体   English

安装 react-navigation 和 react-native-gesture-handler 后,React Native 无法构建

[英]React Native Failed to build after Installing react-navigation and react-native-gesture-handler

I did the following我做了以下

   react-native init project-name
   yarn add react-navigation react-native-gesture-handler and
   react-native run-android

The dependencies installed successfully but the app failed to build with the following errors依赖项安装成功,但应用程序无法构建并出现以下错误

> Task :react-native-gesture-handler:packageDebugResources FAILED
17 actionable tasks: 8 executed, 9 up-to-date
> FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-gesture-handler:packageDebugResources'.

> Could not resolve all files for configuration ':react-native-gesture-handler:_
internal_aapt2_binary'.
   > Failed to transform artifact 'aapt2-windows.jar (com.android.tools.build:aa
pt2:3.4.1-5326820)' to match attributes {artifactType=_internal-android-aapt2-bi
nary, org.gradle.usage=java-runtime-jars}.
      > org.gradle.api.GradleException: Could not read path 'C:\Users\DevLewa\.g
radle\caches\transforms-2\files-2.1\3d408b3640f7dfba25695085d22596b0\aapt2-3.4.1
-5326820-windows'.

I have searched all through github issues but found no helping information, how do I resolve this, I have being on it since morning today.我已经搜索了所有 github 问题,但没有找到任何帮助信息,我该如何解决这个问题,我从今天早上开始就一直在关注它。 Thanks谢谢

I had the same problem with some of my initialized projects using reac-native cli. 我使用响应性cli的一些初始化项目也遇到了同样的问题。 it would be solved by running: react-native link in your project directory. 它可以通过在项目目录中运行: react-native link来解决。 I hope it would work for you as me. 我希望它对您和我一样有用。

If it was helpful please vote me up:) 如果有帮助,请给我投票:)

与 rn-0.60.5 相同的错误是否有任何更新?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM