Closed Ramees025 closed 3 weeks ago
ERROR: An error occurred during the fetch of repository 'androidndk': Traceback (most recent call last): File "/home/test/.cache/bazel/_bazel_test/595332dd80a1b8d4c4daca7eb4d09658/external/rules_android_ndk/rules.bzl", line 49, column 21, in _android_ndk_repository_impl _create_symlinks(ctx, ndk_path, clang_directory, sysroot_directory) File "/home/test/.cache/bazel/_bazel_test/595332dd80a1b8d4c4daca7eb4d09658/external/rules_android_ndk/rules.bzl", line 116, column 24, in _create_symlinks ctx.symlink(p, repo_relative_path) Error in symlink: Cannot write outside of the repository directory for path /home/test/Android/Sdk/ndk-bundle/android-ndk-r21e/toolchains/llvm/prebuilt/linux-x86_64/libexec
Hi @Ramees025,
Please run this command after navigating to the MediaPipe cloned repository on your local machine and let us know if you can build it successfully.
chmod +x setup_android_sdk_and_ndk.sh
./setup_android_sdk_and_ndk.sh
Thank you!!
The error message you're encountering suggests that Bazel is attempting to create symlinks outside of the repository directory, which is not allowed. Steps to resolve the issue:-
android_ndk_repository(
name = "androidndk",
path = "/home/test/Android/Sdk/ndk/21.4.7075529", # Update with your actual path
)
sudo chown -R $(whoami) /home/test/Android/Sdk/ndk-bundle
sudo chown -R $(whoami) /home/test/.cache/bazel
4.Use Correct Bazel Version: Ensure you are using a compatible version of Bazel. MediaPipe might require a specific version. Check MediaPipe's documentation for the recommended Bazel version and install it. 5, Clean Bazel Cache: Sometimes, Bazel's cache might be corrupted or outdated. Cleaning the cache might resolve the issue.
bazel clean --expunge
android_ndk_repository(
name = "androidndk",
path = "/home/test/Android/Sdk/ndk/21.4.7075529", # Update this path
api_level = 21 # Or your desired API level
)
bazel build --cxxopt=-DABSL_FLAGS_STRIP_NAMES=0 -c opt --config=android_arm64 mediapipe/tasks/cc/genai/inference/c:llm_inference_engine_cpu_main
Hope this helps, Thanks
Hi @Ramees025.
Can you please go through the above comment https://github.com/google-ai-edge/mediapipe/issues/5540#issuecomment-2244364781 and let us know the status of this?
Thank you!!
This issue has been marked stale because it has no recent activity since 7 days. It will be closed if no further activity occurs. Thank you.
This issue was closed due to lack of activity after being marked stale for past 7 days.
OS Platform and Distribution
Ubuntu
Compiler version
No response
Programming Language and version
c++
Installed using virtualenv? pip? Conda?(if python)
No response
MediaPipe version
No response
Bazel version
No response
XCode and Tulsi versions (if iOS)
No response
Android SDK and NDK versions (if android)
r21e
Android AAR (if android)
None
OpenCV version (if running on desktop)
No response
Describe the problem
ERROR: An error occurred during the fetch of repository 'androidndk':
Complete Logs