-
-
Notifications
You must be signed in to change notification settings - Fork 10.7k
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
Improve Android NDK path #58883
Comments
Can you open a PR with your proposed changes? Might be easier to discuss that way. |
Hmm, I was hoping to discuss this first before I do anything. Changing caveat information is easy and at least it could guide people what to do, however, I think we can do better than this. So let's focus on the other idea. I think it would be best to symlink the
Almost because in both solutions ndk might already be installed via sdkmanager - this means there is a conflicting folder These are two ideas I have right now - which way should we go? If any at all, maybe you or someone else that have a better understanding of homebrew code can come up with a more suitable solution 😄 |
I have so many questions. Is |
Yes it is. It is located at
Well, you can always download it manually and put it in any convenient directory. It all comes down to providing ndk location either explicitly in command-line invocation or implicitly via environment variable or AndroidStudio or other IDE.
I think only when you would like to use an older version of android-ndk. As currently sdkmanager does not support installing multiple ndk versions (although there is a ticket for it). Then if you're using AndroidStudio you need to specify the location of this older version via
android-ndk was designed as a companion toolset so it needs at lest the basic sdk tools. Hope this helps 😃 |
Since the cask is always at the latest version, does it even make sense to keep it at all, then? |
I think you're right - it is not necessary to have android-ndk cask. |
Mind submitting a PR to remove the cask? Thanks. |
Analytics:
I haven’t followed the conversation closely, but are we sure |
The same question I have asked here apparently has been asked before: And apparently the SDK automatically installs the NDK on-demand. |
@reitermarkus |
What if keep |
@plastiv That would make it an atypical (and weird) cask. Best not to follow that route, as it’d require bending over backwards, |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
@reitermarkus you ask, and you receive: #59874 EDIT: On why people install cask android-ndk - they probably followed some reliable-looking blog post, and like me end up with an extra ~/Android/Sdk folder, and cask-installed Android Studio working fine, while things like starting an emulator from the command line fails. I'll now fix up my android paths as suggested above and shut up :) |
Question: if we merge #59874, can this issue be closed as well (i.e. does its underlying problem get solved)? |
I only know that I tried cask installing android-ndk by following some trustable-looking guide and it surprised me that it didn't work and had me experimenting with ~/Android/Sdk vs /usr/local/..... when the problem was really that I should've used the command line tool to download the NDK and delete my ~/Android folder completely instead. Android Studio can update (maybe also create) a Above the idea to have the ndk package depend on the sdk package was dismissed. The remaining alternatives seem to be
(Now I'm off to manage my time better :impish-smile:) |
Let’s remove the other cask and see what happens. |
@vitorgalvao you should at least add some message saying why this cask was removed and what is the alternative. Many people like myself are used to install |
@MuntashirAkon There is a message. It’s this whole thread, which also includes the alternative.
Then please tell us why! This whole thread is about the usefulness (or lack thereof) of that cask. We asked (in more than one place) and nobody answered. I know “many people” install the cask, I ran the numbers. What we need to know is why, and if If you want to comment on this change, I ask you to advance the discussion. Currently all we have to go on is one complaint (yours) for something that is easily reversible and we’re unsure of. Make an argument for reinstating the cask, if that’s what you want to happen. Then the people who suggested this removal will be able to respond to it. HBC maintainers aren’t Android developers, we need the insights from the users of these casks to know how to deal with them. |
Thanks for reopening. As I explained in #65250, there are some use-cases for installing the NDK without the SDK when developing and testing native libraries for use on Android. In those use-cases, the cask is much easier to use than the SDK's built-in management system, so this seems like an excellent case for having a cask available. My setup doesn't involve Android Studio or the |
@Skoti @sesam I’ve now marked the cask to be reintroduced, but I’ll give you some time to reply to @rcombs’ points before merging (or closing). |
Reintroducing seems fine given above rationale. Maybe the new ndk cask could show a post-install oneliner that it is suited primarily for use when you don't have the sdk, and via And if the ndk cask still is not compatible to have installed together with a sdk and/or ndk installed via other routes, and symlinks still off the table, how about also updating this ndk cask default paths to use the new standard paths? |
@rcombs
However, it is true that it needs some Java dependencies which is an additional step to configure it and it is unfortunate for you as you don't really need it. So I guess we could reintroduce the ndk cask, but maybe as @sesam suggested with a short information that it's intended to use independently (when you're not using android-sdk cask). Or maybe we could merge the two casks into one? It will be named android-kit or still android-sdk to be backward compatible? This would install sdkmanager like android-sdk did, but it would also install a script. |
From “Homebrew Cask is not a discoverability service”:
If a user doesn’t know the difference between the
That confusion stems from the Android developers, not the casks themselves. It’s something that needs to be clarified upstream.
Making it a highly atypical cask with a heightened maintenance burden, with no one on the core team knowing how to deal with it. Looks like the best bet is to reintroduce the Thank you everyone for the discussion. |
Description of feature/enhancement
It seems like
ANDROID_NDK_HOME
is no longer respected by Android Studio and sdkmanager as now there is only one path and it isANDROID_SDK_ROOT
which contains everything. NDK should be in thendk-bundle
subfolder.There are only 2 ways to make it work:
/usr/local/share/android-sdk/ndk-bundle
pointing to/usr/local/share/android-ndk
. This will make the current NDK installation to be used as a default for all projects.ndk.dir=/usr/local/share/android-ndk
in thelocal.properties
file of an AndroidStudio project. This needs to be done for every project which uses android-ndk.Would it be possible to either change the android-ndk installation path to
/usr/local/share/android-sdk/ndk-bundle
or change the caveat information to set ndk.dir instead of usingANDROID_NDK_HOME
environment variable?The text was updated successfully, but these errors were encountered: