-
Notifications
You must be signed in to change notification settings - Fork 5.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue while building the android example using bazel #1281
Comments
The error is "Expected directory at /home/sreehari/Android/Sdk/ndk/22.0.6917172/platforms but it is not a directory or it does not exist. Unable to read the Android NDK at /home/sreehari/Android/Sdk/ndk/22.0.6917172, the path may be invalid.". Can you do |
@jiuqiant it is a directory, and the path is valid. |
What's in the /home/sreehari/Android/Sdk/ndk/22.0.6917172 directory? Does it have a platforms subdirctory? I am asking because the error says /home/sreehari/Android/Sdk/ndk/22.0.6917172/platforms is not a directory or does not exist. Normally, the directory should look like this:
|
Yes it is similar |
Try |
@jiuqiant I had already tried clearing the cache, can reverting back to previous version of bazel fix this issue? |
If you plan to downgrade to an earlier version of Bazel, please checkout an earlier version of MediaPipe as well. Another thing you can try is to delete the ndk directory and reinstall it by Android Studio again. The error message also mentions that "If the path is correct, the contents in the Android NDK directory may have been modified." |
@jiuqiant changed the ANDROID_NDK_HOME path to Android/Sdk/ndk-bundle/android-ndk-r18b/ and its building now, I haven't changed the bazel version. |
Hello, this is the list of my folder
and the Android/Sdk/ndk-bundle/android-ndk-r18b/ doesn't exist neither This is a fresh install of Android Studio |
@pulpoec I downloaded the ndk separately in Android studio and made it work. |
Hi @Aprameyah Ap |
Install older NDK-version e.g. 18.1.5063045Abstract: NDK folder & file structure has changed somewhere between 18.xxx & 20.xxx and bazel (e.g. 3.7.0) does not get it. So simply installing an older NDK-version fixed this issue and issue #98 for me. I had the same problem, either developer@9da2071fdabf:~/Android/Sdk/ndk$ ll
total 0
drwxr-xr-x 1 developer developer 48 Jan 19 19:12 ./
drwxr-xr-x 1 developer developer 262 Jan 19 16:00 ../
drwxr-xr-x 1 developer developer 420 Jan 19 19:12 18.1.5063045/
drwxr-xr-x 1 developer developer 382 Jan 19 17:27 22.0.7026061/
developer@9da2071fdabf:~/Android/Sdk/ndk$ ll 18.1.5063045/
total 3660
drwxr-xr-x 1 developer developer 420 Jan 19 19:12 ./
drwxr-xr-x 1 developer developer 48 Jan 19 19:12 ../
-rw-r--r-- 1 developer developer 5772 Jan 19 19:12 CHANGELOG.md
-rw-r--r-- 1 developer developer 3476824 Jan 19 19:12 NOTICE
-rw-r--r-- 1 developer developer 210037 Jan 19 19:12 NOTICE.toolchain
-rw-r--r-- 1 developer developer 730 Jan 19 19:12 README.md
drwxr-xr-x 1 developer developer 534 Jan 19 19:12 build/
drwxr-xr-x 1 developer developer 46 Jan 19 19:12 meta/
-rwxr-xr-x 1 developer developer 72 Jan 19 19:12 ndk-build*
-rwxr-xr-x 1 developer developer 94 Jan 19 19:12 ndk-depends*
-rwxr-xr-x 1 developer developer 90 Jan 19 19:12 ndk-gdb*
-rwxr-xr-x 1 developer developer 92 Jan 19 19:12 ndk-stack*
-rwxr-xr-x 1 developer developer 92 Jan 19 19:12 ndk-which*
-rw-r--r-- 1 developer developer 17856 Jan 19 19:12 package.xml
drwxr-xr-x 1 developer developer 220 Jan 19 19:12 platforms/
drwxr-xr-x 1 developer developer 122 Jan 19 19:12 prebuilt/
drwxr-xr-x 1 developer developer 84 Jan 19 19:12 python-packages/
drwxr-xr-x 1 developer developer 24 Jan 19 19:12 shader-tools/
drwxr-xr-x 1 developer developer 612 Jan 19 19:12 simpleperf/
-rw-r--r-- 1 developer developer 51 Jan 19 19:12 source.properties
drwxr-xr-x 1 developer developer 50 Jan 19 19:12 sources/
drwxr-xr-x 1 developer developer 18 Jan 19 19:12 sysroot/
drwxr-xr-x 1 developer developer 166 Jan 19 19:12 toolchains/
drwxr-xr-x 1 developer developer 122 Jan 19 19:12 wrap.sh/
developer@9da2071fdabf:~/Android/Sdk/ndk$ ll 22.0.7026061/
total 1576
drwxr-xr-x 1 developer developer 382 Jan 19 17:27 ./
drwxr-xr-x 1 developer developer 48 Jan 19 19:12 ../
-rw-r--r-- 1 developer developer 8186 Jan 19 17:27 CHANGELOG.md
-rw-r--r-- 1 developer developer 666233 Jan 19 17:27 NOTICE
-rw-r--r-- 1 developer developer 888795 Jan 19 17:27 NOTICE.toolchain
-rw-r--r-- 1 developer developer 730 Jan 19 17:27 README.md
drwxr-xr-x 1 developer developer 556 Jan 19 17:27 build/
drwxr-xr-x 1 developer developer 78 Jan 19 17:27 meta/
-rwxr-xr-x 1 developer developer 72 Jan 19 17:27 ndk-build*
-rwxr-xr-x 1 developer developer 90 Jan 19 17:27 ndk-gdb*
-rwxr-xr-x 1 developer developer 90 Jan 19 17:27 ndk-lldb*
-rwxr-xr-x 1 developer developer 92 Jan 19 17:27 ndk-stack*
-rwxr-xr-x 1 developer developer 92 Jan 19 17:27 ndk-which*
-rw-r--r-- 1 developer developer 17856 Jan 19 17:27 package.xml
drwxr-xr-x 1 developer developer 122 Jan 19 17:27 prebuilt/
drwxr-xr-x 1 developer developer 64 Jan 19 17:27 python-packages/
drwxr-xr-x 1 developer developer 24 Jan 19 17:27 shader-tools/
drwxr-xr-x 1 developer developer 656 Jan 19 17:27 simpleperf/
-rw-r--r-- 1 developer developer 51 Jan 19 17:27 source.properties
drwxr-xr-x 1 developer developer 50 Jan 19 17:27 sources/
drwxr-xr-x 1 developer developer 166 Jan 19 17:27 toolchains/
drwxr-xr-x 1 developer developer 14 Jan 19 17:27 wrap.sh/ |
From bazel source code: https://github.com/bazelbuild/bazel/blob/13aba68083fa0f7cfc21c1d994c4ae50014ab61c/src/main/java/com/google/devtools/build/lib/bazel/rules/android/AndroidNdkRepositoryFunction.java#L322 Edit the WORKSPACE file and change the android_ndk_repository rule to include api_level=22 or whatever ndk you downloaded; this worked for me. |
Hello, I'm also affected by this issue. I'm missing the platforms directory and no RELEASE.txt. It's great we have a workaround, but it would be really awesome if we could get NDK code building for Bazel with the default configurations. It's be nice if the NDK sample for Android building with Bazel worked out of the box, is there a bug I could possibly follow for this? |
Bazel doesn't support android ndk r22+ yet. Please use r21 instead. |
I'm using the link to build android example of the hand tracking app. I have installed Android studio and have specified the path for sdk and ndk. Im getting the following error:
Please provide a solution for the same.
The text was updated successfully, but these errors were encountered: