我有一个基于react-native版本0.55.4
构建的项目。它在旧系统上运行良好。由于某些原因我必须更改系统。我在新系统上设置,我可以使用react-native run-android运行项目,但是当使用./gradlew assembleRelease构建签名的APK时,我收到以下错误。
Task :app:processReleaseGoogleServices
Parsing json file:
<Project-Directory>/android/app/google-services.json
FAILURE: Build failed with an exception.
What went wrong:
Could not list contents of
'<Project-Directory>/node_modules/react-native/scripts/third-party/glog-0.3.4/test-driver'. Couldn't follow symbolic link.
我知道这个问题已经在堆栈溢出上 Invalid symlink in node_modules error when trying to deploy to simulator (RN 0.45) 。我已经尝试过了。我也尝试过以下 github 问题。
- https://github.com/facebook/react-native/issues/11212
- https://github.com/facebook/react-native/issues/14417
- https://github.com/facebook/react-native/issues/14548
- https://github.com/facebook/react-native/issues/14464
我也尝试过以下操作。
- 删除节点模块并重新安装
- 删除节点模块中的
.bin
文件夹 - 删除节点模块中的
react-native/third_party
文件夹。 - 从旧系统复制节点模块。
- 从旧系统复制
第三方
和glog-0.3.4
。 - 删除
thirdparty
文件夹内的test-driver
文件。 - 取消链接第三方文件夹内的
test-driver
文件。 - 安装
automake-1.16
并在thirdparty
文件夹中创建test-driver
文件的新别名。
我的java版本是1.8.0_201。我的android studio版本是3.3.2。项目 react 原生版本是0.55.4。我的 Mac 操作系统版本是 10.14.4。我的x代码版本是10.2。
请帮忙。 提前致谢。
最佳答案
如下取消链接并在清除缓存的情况下重新启动
在项目文件夹中:
取消链接./node_modules/react-native/scripts/third-party/glog-0.3.4/test-driver
然后停止js服务器并运行:
npm start -- --reset-cache
应该可以
关于javascript - 无法列出 'third-party/glog-0.3.4/test-driver' 的内容。无法跟踪符号链接(symbolic link),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55478549/