我有一个本地项目。我正在构建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的身份运行它。
是什么导致了这个错误?我该如何绕过这一点,在不使用sudo的情况下成功地为发行版构建一个渐变版本呢?