djinni icon indicating copy to clipboard operation
djinni copied to clipboard

NDK not seems not compatible

Open coxfilur opened this issue 2 years ago • 5 comments

ERROR: /Users/lichunyu/work/djinni-main/WORKSPACE:13:23: fetching android_ndk_repository rule //external:androidndk: java.io.IOException: Could not read RELEASE.TXT in Android NDK: /Users/lichunyu/Library/Android/sdk/ndk/RELEASE.TXT (No such file or directory) Unable to read the Android NDK at /Users/lichunyu/Library/Android/sdk/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.

My ndk version:(in /Users/lichunyu/Library/Android/sdk/ndk) 21.3.6528147 21.4.7075529

coxfilur avatar Sep 09 '22 09:09 coxfilur

I just tested and it works for me. My $ANDROID_NDK_HOME is "~/Library/Android/sdk/ndk/21.3.6528147"

li-feng-sc avatar Sep 09 '22 12:09 li-feng-sc

Also ndk in this repo is only used for building the android example app. You can use any android sdk/ndk version to build your own app.

li-feng-sc avatar Sep 09 '22 12:09 li-feng-sc

did you use Bazel to build? It seem Bazel error. you can edit your WORKSPACE and locate the NDK path to android_ndk_repository() like: android_ndk_repository(name = "androidndk", path = "/path/to/ndk", api_level = 21)

or, the value can be omitted if ANDROID_NDK_HOME environment variable is set.

cucbin avatar Nov 14 '22 02:11 cucbin

If the NDK is only used to build the Android example app, why is it part of the build step for Djinni? It just adds an unnecessary dependency to users of the library who might just need to generate code with Djinni without Android support.

floriansegginger avatar Apr 11 '23 08:04 floriansegginger

@floriansegginger you are absolutely right. I think the reason this hasn't bothered us at Snap is because the main purpose of using Djinni is to support Android and iOS development so pretty much all developers already have NDK installed. But on the other hand, the Java support in Djinni is not really tied to Android so NDK does not have to be a hard dependency. When I have some time, I'll try if I could remove this dependency. In the mean time, if you want to open a PR to fix this, I'm happy to review and merge it.

li-feng-sc avatar Apr 11 '23 23:04 li-feng-sc