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

Android NDK not detected in side-by-side installation style #218

Open
mikehardy opened this issue Feb 11, 2022 · 1 comment
Open

Android NDK not detected in side-by-side installation style #218

mikehardy opened this issue Feb 11, 2022 · 1 comment

Comments

@mikehardy
Copy link

The new ndk directory is also no longer $ANDROID_HOME/ndk-bundle, but $ANDROID_HOME/ndk/<version>. I guess this is due to the new Sidy-by-side install method, where you can have multiple versions of the ndk installed.

Originally posted by @hidde-jan in #168 (comment)


Code reference:

const getNdk = () => {
if (process.env.ANDROID_NDK) {
return getNdkVersionFromPath(process.env.ANDROID_NDK);
}
if (process.env.ANDROID_NDK_HOME) {
return getNdkVersionFromPath(process.env.ANDROID_NDK_HOME);
}
if (process.env.ANDROID_HOME) {
return getNdkVersionFromPath(path.join(process.env.ANDROID_HOME, 'ndk-bundle'));
}
return undefined;
};
const ndkVersion = getNdk();

Suggest that

-if ANDROID_NDK environment variables are not set and ANDROID_HOME is set,

  • then the conditional is expanded to check ndk-bundle first (backwards compatibility)
  • then if ndk-bundle dir does not exist, to check for ndk side-by-side dir, do a directory listing sorted alphanumeric and the highest version is selected as the path (it contains the source.properties file that is then parsed for version)

If that sounds like an acceptable sketch, this seems like an easy PR to do. What do you think?

@mikehardy
Copy link
Author

Hey @gengjiawen 👋 - I could make a PR based on the above sketch if it seems like a reasonable way to handle side-by-side android NDKs

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

1 participant