ERROR:An error occurred during the fetch of repository 'Maven': Traceback(most recent call last): File "/home/zhg/.cache/bazel/bazel_zhg/fdb94f3cc526bbd2b2e68780cd60f6b4/external/rules_jvm_ external/coursier.bzl", line 894, column 17, in _coursier_fetch_impl _download_jq(repository_ctx) File "/home/zhg/.cache/bazel/_bazel_zhg/fdb94f3cc526bbd2b2e68780cd60f6b4/external/rules_jvm_external/coursier.bzl",line 876, column 32,in _download_jqrepository_ctx.download(value.url,"jq-%s" % os, sha256 = value. sha256,executable = True) Error in download: java.io.IOException: Error downloading [https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64]to /home/zhg/.cache/bazel/_bazelzhg/fdb94f3cc526bbd2b2e68780cd60f6b4/external/maven/jq-linux: Read timed out
原因
网络问题,给终端配置vpn或者代理环境,或者重试
4.3 网络问题(Error fetching)
错误信息
1 2 3
ERROR: /home/zhg/Mine/Workplace/envoy/mobile/library/kotlin/io/envoyproxy/envoymobile/BUILD:9:18: //library/kotlin/io/envoyproxy/envoymobile:envoy_aar_android_javadocs depends on @maven//:org_jetbrains_dokka_dokka_cli in repository @maven which failed to fetch. no such package '@maven//': Error while fetching artifact with coursier: Error fetching artifacts: https://maven.google.com/androidx/core/core/1.3.2/core-1.3.2.jar: download error: Caught java.net.SocketException (Unexpected end of file from server) while downloading https://maven.google.com/androidx/core/core/1.3.2/core-1.3.2.jar
解决方法
重试或检查网络环境
4.4 Android sdk 版本不匹配
错误日志
1 2 3 4
ERROR: Analysis of target '//:android_dist' failed; build aborted: Android SDK api level 30 was requested but it is not installed in the Android SDK at /home/zhg/Mine/Android/AndroidSdk. The api levels found were [34]. Please choose an available api level or install api level 30 from the Android SDK Manager. INFO: Elapsed time: 30.879s INFO: 0 processes.
Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging Error parsing command line: While parsing option --androidJar external/androidsdk/platforms/android-34/android.jar: external/androidsdk/platforms/android-34/android.jar is not a valid path: it does not exist. Try --help.
解决
检查配置的Android sdk路径或者环境变量
4.6 c++环境报错
错误日志
1 2
Error in fail: Auto-Configuration Error: Cannot find gcc or CC; either correct your path or set the CC environment variable
解决方法
配置C++环境,安装C/C++编译器和make
1 2 3 4 5 6 7 8 9
// 安装gcc(C编译器) sudo apt-get install gcc
// 安装g++(C++编译器) sudo apt-get install g++
// 安装make sudo apt-get install make
4.7 内存不足(command: Killed)
错误信息
1 2 3 4 5 6 7 8 9
Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging clang: error: unable to execute command: Killed clang: error: linker command failed due to signal (use -v to see invocation) Target //library/kotlin/io/envoyproxy/envoymobile:envoy_aar_with_artifacts failed to build INFO: Elapsed time: 5243.412s, Critical Path: 196.75s INFO: 12923 processes: 801 internal, 12090 linux-sandbox, 32 worker. FAILED: Build did NOT complete successfully
4.8 内存不足(Not enough space)
错误信息
1 2
OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x0000000600000000, 8589934592, 0) failed; error='Not enough space' (errno=12)