Skip to content
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

mozc is giving errors of Android NDK when building with bazel 5.0 #544

Closed
silverhikari opened this issue Jan 27, 2022 · 4 comments
Closed

Comments

@silverhikari
Copy link

after running "bazel build package --config oss_linux -c opt" the error

mozc-ut-united/src/mozc/src/WORKSPACE.bazel:12:23: fetching android_ndk_repository rule //external:androidndk: java.io.IOException: Expected directory at /opt/android-ndk/platforms but it is not a directory or it does not exist. Unable to read the Android NDK at /opt/android-ndk, the path may be invalid. Is the path in android_ndk_repository() or ANDROID_NDK_HOME set correctly? If the path is correct, the contents in the Android NDK directory may have been modified.

which should not be happening as this is being build and run on linux, so i do not know why is trying to build android

@hiroyuki-komatsu hiroyuki-komatsu changed the title mozc is giving strange errors when building with bazel 5.0 mozc is giving errors of Android NDK when building with bazel 5.0 Jan 30, 2022
@hiroyuki-komatsu
Copy link
Collaborator

Hi Ethan,

Please try either of:

  • install Android NDK
  • comment out the setting for Android NDK in WORKSPACE.bazel
# Android NDK version should be r11c+ for Abseil.
# This rule reffers $ANDROID_NDK_HOME
# android_ndk_repository(name = "androidndk")  # ← here

Did it work with the previous Bazel versions before Bazel 5.0?

@silverhikari
Copy link
Author

yes, the last version tested that built successfully was 4.2.2

@hiroyuki-komatsu
Copy link
Collaborator

Here is the discussion in the Bazel project.

bazelbuild/rules_android_ndk#92

hiroyuki-komatsu added a commit that referenced this issue Jul 4, 2022
* #544
* #567

PiperOrigin-RevId: 458727674
@hiroyuki-komatsu
Copy link
Collaborator

e05888b is a workaround of this issue.

If ANDROID_NDK_HOME env var is not specified, Android NDK is not initialized.
Then this error doesn't happen.

Thanks,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants