android - 任务“:app:processReleaseGoogleServices”执行失败。删除失败:...../values.xml
问题描述
我有一个 React Native 项目。我正在为 macOS 上的 android(我对 iOS 没有问题)构建发布版本。我一直在关注本指南:https ://facebook.github.io/react-native/docs/signed-apk-android 。当我运行时./gradlew assembleRelease
,我收到以下错误:
:app:processReleaseGoogleServices
Parsing json file: /Users/robavery/repositories/ourdailystrength_app/android/app/google-services.json
:app:processReleaseGoogleServices FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processReleaseGoogleServices'.
> Failed to delete: /Users/robavery/repositories/ourdailystrength_app/android/app/build/generated/res/google-services/release/values/values.xml
* Try:
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 47s
当我尝试清理我的项目时(无论我是通过 Android Studio、./gradlew clean
还是清理npm run clean:android
),我已经清理并得到了同样的错误。
我尝试运行sudo ./gradlew assembleRelease
,但后来我得到了这个错误:
> Task :app:processReleaseGoogleServices
Parsing json file: /Users/robavery/repositories/ourdailystrength_app/android/app/google-services.json
FAILURE: Build failed with an exception.
* What went wrong:
Failed to capture snapshot of input files for task ':app:bundleReleaseJsAndAssets' property '$1' during up-to-date check.
> Failed to create MD5 hash for file '/Users/robavery/repositories/ourdailystrength_app/.buckd/sock' as it does not exist.
* Try:
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 16s
不过,我宁愿能够以用户身份而不是 sudo 运行它。
是什么导致了这个错误?如何解决这个问题并成功地为发布进行 gradle 构建,而无需使用 sudo?
解决方案
如果问题是权限,这不是超级安全,但应该可以工作
sudo chmod -R 777 /Users/robavery/repositories/ourdailystrength_app
仅chmod
用于修改777
作为所有组的别名的 persions,所有权限,-R
标志递归地运行它,以便您点击目录中的每个文件。
如果这不起作用,那么可以尝试清除您的项目缓存
推荐阅读
- flutter - 无法访问嵌套数组对象颤动
- docker - Docker 连接错误 [Errno99] 中的 Pymodbus
- r - R:dplyr 不能过滤()某些字符
- css - 未应用 Mapbox 标记样式
- ios - 如何将值从 Swift 代码发送到 C Wrapper
- c - 为地址清理程序抑制 gtest 的 unitest
- javascript - 地理位置不断请求许可
- android - 离子电容器构建找不到符号 android.support.v4.app.ActivityCompat
- html - 如何在每张照片下方对齐标题?
- api - 如图所示,当我运行 dotnet run 命令时,命令提示符上没有任何反应