Mediapipe: Build Error - Android Studio

Created on 30 Oct 2020  路  11Comments  路  Source: google/mediapipe

Hi Team,

I am getting below error, while trying to build:

ERROR Error:While resolving toolchains for target //third_party:androidx_material: no matching toolchains found for types @bazel_tools//tools/android:sdk_toolchain_type Error:While resolving toolchains for target //mediapipe/java/com/google/mediapipe/components:android_microphone_helper: no matching toolchains found for types @bazel_tools//tools/android:sdk_toolchain_type Error:While resolving toolchains for target //mediapipe/examples/android/src/java/com/google/mediapipe/apps/instantmotiontracking:instantmotiontracking_lib: no matching toolchains found for types @bazel_tools//tools/android:sdk_toolchain_type Error:While resolving toolchains for target //mediapipe/examples/android/src/java/com/google/mediapipe/apps/basic:basic_lib: no matching toolchains found for types @bazel_tools//tools/android:sdk_toolchain_type Error:While resolving toolchains for target //third_party:androidx_constraint_layout: no matching toolchains found for types @bazel_tools//tools/android:sdk_toolchain_type Error:While resolving toolchains for target //mediapipe/java/com/google/mediapipe/components:android_components: no matching toolchains found for types @bazel_tools//tools/android:sdk_toolchain_type Error:While resolving toolchains for target //third_party:androidx_recyclerview: no matching toolchains found for types @bazel_tools//tools/android:sdk_toolchain_type Error:While resolving toolchains for target //mediapipe/java/com/google/mediapipe/framework:android_framework: no matching toolchains found for types @bazel_tools//tools/android:sdk_toolchain_type Error:While resolving toolchains for target //mediapipe/java/com/google/mediapipe/framework:android_framework_no_mff: no matching toolchains found for types @bazel_tools//tools/android:sdk_toolchain_type Error:While resolving toolchains for target //mediapipe/java/com/google/mediapipe/components:android_camerax_helper: no matching toolchains found for types @bazel_tools//tools/android:sdk_toolchain_type Error:While resolving toolchains for target //third_party:camerax_lifecycle: no matching toolchains found for types @bazel_tools//tools/android:sdk_toolchain_type Error:While resolving toolchains for target //third_party:camerax_core: no matching toolchains found for types @bazel_tools//tools/android:sdk_toolchain_type Error:While resolving toolchains for target //third_party:camerax_camera2: no matching toolchains found for types @bazel_tools//tools/android:sdk_toolchain_type Error:While resolving toolchains for target //third_party:androidx_core: no matching toolchains found for types @bazel_tools//tools/android:sdk_toolchain_type Error:While resolving toolchains for target //third_party:androidx_appcompat: no matching toolchains found for types @bazel_tools//tools/android:sdk_toolchain_type Error:While resolving toolchains for target //mediapipe/java/com/google/mediapipe/glutil:glutil: no matching toolchains found for types @bazel_tools//tools/android:sdk_toolchain_type Error:While resolving toolchains for target //mediapipe/java/com/google/mediapipe/framework:android_framework_no_proguard: no matching toolchains found for types @bazel_tools//tools/android:sdk_toolchain_type Error:While resolving toolchains for target //third_party:androidx_legacy_support_v4: no matching toolchains found for types @bazel_tools//tools/android:sdk_toolchain_type Error:While resolving toolchains for target //third_party:androidx_annotation: no matching toolchains found for types @bazel_tools//tools/android:sdk_toolchain_type Error:While resolving toolchains for target //mediapipe/java/com/google/mediapipe/framework:android_core: no matching toolchains found for types @bazel_tools//tools/android:sdk_toolchain_type Error:While resolving toolchains for target //mediapipe/java/com/google/mediapipe/framework:framework_proto_lite: no matching toolchains found for types @bazel_tools//tools/android:sdk_toolchain_type Error:While resolving toolchains for target //mediapipe/java/com/google/mediapipe/framework:mediapipe_exception_android: no matching toolchains found for types @bazel_tools//tools/android:sdk_toolchain_type Error:While resolving configuration keys for @com_google_absl//absl/memory:memory: Analysis of target '@local_config_cc//:toolchain' failed Error:While resolving configuration keys for @com_google_absl//absl/synchronization:synchronization: Analysis of target '@local_config_cc//:toolchain' failed Error:While resolving configuration keys for @com_google_absl//absl/strings:strings: Analysis of target '@local_config_cc//:toolchain' failed Error:While resolving configuration keys for @com_google_absl//absl/time:time: Analysis of target '@local_config_cc//:toolchain' failed Error:While resolving configuration keys for @com_google_absl//absl/base:core_headers: Analysis of target '@local_config_cc//:toolchain' failed Error:While resolving configuration keys for @com_google_protobuf//:protobuf: Analysis of target '@local_config_cc//:toolchain' failed Error:While resolving configuration keys for @com_google_absl//absl/status:status: Analysis of target '@local_config_cc//:toolchain' failed Error:While resolving configuration keys for @com_google_absl//absl/strings:str_format: Analysis of target '@local_config_cc//:toolchain' failed Error:While resolving configuration keys for @com_google_absl//absl/container:flat_hash_set: Analysis of target '@local_config_cc//:toolchain' failed Error:While resolving toolchains for target //mediapipe/examples/android/src/java/com/google/mediapipe/apps/upperbodyposetrackinggpu:upperbodyposetrackinggpu: no matching toolchains found for types @bazel_tools//tools/android:sdk_toolchain_type Error:While resolving configuration keys for @com_google_absl//absl/meta:type_traits: Analysis of target '@local_config_cc//:toolchain' failed Error:While resolving configuration keys for @com_google_absl//absl/algorithm:container: Analysis of target '@local_config_cc//:toolchain' failed Error:While resolving configuration keys for @com_google_absl//absl/types:optional: Analysis of target '@local_config_cc//:toolchain' failed Error:While resolving configuration keys for @com_google_absl//absl/flags:flag: Analysis of target '@local_config_cc//:toolchain' failed Error:While resolving configuration keys for @com_google_absl//absl/container:node_hash_map: Analysis of target '@local_config_cc//:toolchain' failed Error:While resolving configuration keys for @com_google_absl//absl/container:fixed_array: Analysis of target '@local_config_cc//:toolchain' failed Error:While resolving configuration keys for @com_google_absl//absl/container:flat_hash_map: Analysis of target '@local_config_cc//:toolchain' failed Error:While resolving configuration keys for @com_google_absl//absl/base:base: Analysis of target '@local_config_cc//:toolchain' failed Error:While resolving configuration keys for @com_google_absl//absl/base:config: Analysis of target '@local_config_cc//:toolchain' failed Error:While resolving configuration keys for @com_google_absl//absl/base:dynamic_annotations: Analysis of target '@local_config_cc//:toolchain' failed Error:While resolving toolchains for target //mediapipe/examples/android/src/java/com/google/mediapipe/apps/templatematchingcpu:templatematchingcpu: no matching toolchains found for types @bazel_tools//tools/android:sdk_toolchain_type Error:While resolving toolchains for target //mediapipe/examples/android/src/java/com/google/mediapipe/apps/objecttrackinggpu:objecttrackinggpu: no matching toolchains found for types @bazel_tools//tools/android:sdk_toolchain_type Error:While resolving toolchains for target //mediapipe/examples/android/src/java/com/google/mediapipe/apps/objectdetectiongpu:objectdetectiongpu: no matching toolchains found for types @bazel_tools//tools/android:sdk_toolchain_type Error:While resolving toolchains for target //mediapipe/examples/android/src/java/com/google/mediapipe/apps/objectdetectioncpu:objectdetectioncpu: no matching toolchains found for types @bazel_tools//tools/android:sdk_toolchain_type Error:While resolving toolchains for target //mediapipe/examples/android/src/java/com/google/mediapipe/apps/objectdetection3d:objectdetection3d: no matching toolchains found for types @bazel_tools//tools/android:sdk_toolchain_type Error:While resolving toolchains for target //mediapipe/examples/android/src/java/com/google/mediapipe/apps/multihandtrackinggpu:multihandtrackinggpu: no matching toolchains found for types @bazel_tools//tools/android:sdk_toolchain_type Error:While resolving toolchains for target //mediapipe/examples/android/src/java/com/google/mediapipe/apps/iristrackinggpu:iristrackinggpu: no matching toolchains found for types @bazel_tools//tools/android:sdk_toolchain_type Error:While resolving toolchains for target //mediapipe/examples/android/src/java/com/google/mediapipe/apps/instantmotiontracking:instantmotiontracking: no matching toolchains found for types @bazel_tools//tools/android:sdk_toolchain_type Error:While resolving toolchains for target //mediapipe/examples/android/src/java/com/google/mediapipe/apps/handtrackinggpu:handtrackinggpu: no matching toolchains found for types @bazel_tools//tools/android:sdk_toolchain_type Error:While resolving toolchains for target //mediapipe/examples/android/src/java/com/google/mediapipe/apps/handdetectiongpu:handdetectiongpu: no matching toolchains found for types @bazel_tools//tools/android:sdk_toolchain_type Error:While resolving toolchains for target //mediapipe/examples/android/src/java/com/google/mediapipe/apps/hairsegmentationgpu:hairsegmentationgpu: no matching toolchains found for types @bazel_tools//tools/android:sdk_toolchain_type Error:While resolving toolchains for target //mediapipe/examples/android/src/java/com/google/mediapipe/apps/facemeshgpu:facemeshgpu: no matching toolchains found for types @bazel_tools//tools/android:sdk_toolchain_type Error:While resolving toolchains for target //mediapipe/examples/android/src/java/com/google/mediapipe/apps/faceeffect:faceeffect: no matching toolchains found for types @bazel_tools//tools/android:sdk_toolchain_type Error:While resolving toolchains for target //mediapipe/examples/android/src/java/com/google/mediapipe/apps/facedetectiongpu:facedetectiongpu: no matching toolchains found for types @bazel_tools//tools/android:sdk_toolchain_type Error:While resolving toolchains for target //mediapipe/examples/android/src/java/com/google/mediapipe/apps/facedetectioncpu:facedetectioncpu: no matching toolchains found for types @bazel_tools//tools/android:sdk_toolchain_type Error:While resolving toolchains for target //mediapipe/examples/android/src/java/com/google/mediapipe/apps/basic:helloworld: no matching toolchains found for types @bazel_tools//tools/android:sdk_toolchain_type Error:command succeeded, but not all targets were analyzed /home/rathish/.cache/bazel/_bazel_rathish/6177f93bf2f49f7460cc9a193478adce/external/local_config_cc/BUILD Error:(47, 19) in cc_toolchain_suite rule @local_config_cc//:toolchain: cc_toolchain_suite '@local_config_cc//:toolchain' does not contain a toolchain for cpu 'darwin_x86_64' Error:(47, 19) in cc_toolchain_suite rule @local_config_cc//:toolchain: cc_toolchain_suite '@local_config_cc//:toolchain' does not contain a toolchain for cpu 'ios_x86_64' /home/rathish/android/mediapipe/mediapipe/gpu/BUILD Error:(942, 14) no such package 'testing/utp/ios': BUILD file not found in any of the following directories. Add a BUILD file to a directory to mark it as a package.

Please someone help on this.

Most helpful comment

I had this issue and it was because my environment variables were not specified. Try this part of the tutorial

export ANDROID_HOME= "path to Android SDK"
export ANDROID_NDK_HOME= "path to the Android NDK"

All 11 comments

same, did you get it resolved?

same here. bazel 3.7.0 - android studio 4.1.1 - debian 10

Solution for me was to run the file setup_android_sdk_and_ndk.sh via 'bash setup_android_sdk_and_ndk.sh'.

@moderateroni I'm running on Mac and couldn't get it to work, even after running the bash script.
What version of "Android SDK Platform-Tools" do you see in your SDK manager? For some reason, mine is 30.0.5, even though my SDK build-tools is 29.0.1 as expected

@david-siqi-liu any update on this issue? I'm having the same problem. Running on mac and the version of the android sdk tools are version 30.0.5.

I had this issue and it was because my environment variables were not specified. Try this part of the tutorial

export ANDROID_HOME= "path to Android SDK"
export ANDROID_NDK_HOME= "path to the Android NDK"

It was because of environment variable. I have already set the ANDROID_HOME & ANDROID_NDK_HOME, but still faced this issue in Android Studio.

I fixed this by explicitly specifying SDK & NDK path in WORKSPACE file (line 242 - you can define this at the beginning as well).

# You may run setup_android.sh to install Android SDK and NDK.
android_sdk_repository(
    name = "androidsdk",
    path = "/Library/android/sdk"
)

android_ndk_repository(
    name = "androidndk",
    path = "/Library/android/sdk/ndk/21.3.6528147"
)

same, did you get it resolved?

Yes, I am able to resolve and move forward.

@david-siqi-liu @Andrec-Dxs @cdibona @moderateroni I am closing this - notified to view solution.

where was this edited - I have the same issue

@FELS-Zak you need to specify the envrionment variables in the terminal session

where was this edited - I have the same issue

There is a file called - WORKSPACE (learn more about this in bazel documentation). Specify the SDK & NDK versions there.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

suyashjoshi picture suyashjoshi  路  3Comments

Bluebie picture Bluebie  路  3Comments

calvin422 picture calvin422  路  3Comments

Rakeshvcr picture Rakeshvcr  路  4Comments

Choons picture Choons  路  4Comments