gomatcha / matcha

Build native mobile apps in Go.

Home Page:https://gomatcha.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

$ANDROID_HOME does not point to an Android NDK.

bakatest-me opened this issue · comments

$ANDROID_HOME does not point to an Android NDK.
my path is " export ANDROID_HOME=/Users/phantomd/Library/Android/sdk " and i try with " export ANDROID_HOME=/Users/$USER/Library/Android/sdk/ndk-bundle "

It should be looking for ($ANDROID_HOME/ndk-bundle/prebuilt/darwin-x86_64/bin). Does that folder exist?

After installing Android Studio I installed LLDB, CMake and NDK as described here. This puts the SDK under /Users/xxx/Library/Android/sdk. In my .zshrc (or depending on what shell you use .profile, .bash_profile, …) I added export ANDROID_HOME="/Users/xxx/Library/Android/sdk". After that matcha init works as expected.

@m99coder it's work thank you

Is that possible to separate Android and iOS builders? Let's say I'm only interested to play with iOS app and don't have Android SDK installed (coincidentally, I have, but without NDK, so getting the same error while trying to build iOS project).

It could be also beneficial for people on Linux or other platforms, interested only in Android targets, where iOS toolchain may not even be accessible.

Currently, I'm having this output:

$ matcha init
$ANDROID_HOME does not point to an Android NDK. Missing directory at /Users/divan/Library/Android/sdk/ndk-bundle/prebuilt/darwin-x86_64/bin.
$ matcha build --targets ios gomatcha.io/matcha/examples
toolchain partially installed, run `matcha init`

So the question is - can iOS and Android toolchains be logically separated, so match build --targets ios doesn't require Android toolchain?

From the source we can read that we need Android SDK to properly matcha init. Message You got is based on "version" file that is creating after checking if ios and android environment are set.

I'm just starting to learn the install process for matcha.
I noticed in the README file that Android SDK and NDK are both required.

Since one can easily use brew cask install android-studio android-ndk to install both android-sdk and NDK, it seems somewhat reasonable to me that matcha should support NDK installations that are from homebrew.

(Note that at present, I can find a brew formula for cmake but not for LLDB. So it seems that a formula for LLDB might still be needed.)

However, even though I set this:
export ANDROID_HOME="/usr/local/share/android-ndk/"
which DOES have a prebuilt/darwin-x86_64/bin directory...

And up with directory/file structure like this:

ls -la /usr/local/share/android-ndk/prebuilt/darwin-x86_64/bin
2to3             gdb-orig         make             ndk-gdb          ndk-stack        pydoc            python-config    python2          python2.7        smtpd.py
gdb              idle             ndk-depends      ndk-gdb.py       ndk-which        python           python-config.sh python2-config   python2.7-config yasm

I puzzlingly still end up with matcha looking for a directory named ndk-bundle on matcha init:

$ANDROID_HOME does not point to an Android NDK. Missing directory at /usr/local/share/android-ndk/ndk-bundle/prebuilt/darwin-x86_64/bin.

(I guess I could try playing around with symlinks for this)

Since MacOS still seems to be the main target platform here, it seems that matcha install docs should overtly state that users must install required components from the Android Studio component installer GUI
-or-
sufficiently give them docs to complete matcha init completely from the command line, which would be preferred by myself (and probably others too)

Thanks for all your work on Matcha!

@cmosetick Thanks for the feedback. Most of the installation stuff was ripped from gomobile, which is not really maintained. So yeah, I really just need to redo the whole installation process.