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

"Required toolchain not found for platform" printed instead of more helpful errors such as "ANDROID_NDK_ROOT not set". #791

Open
nathanfranke opened this issue Jul 20, 2022 · 2 comments

Comments

@nathanfranke
Copy link

I wanted to build my extension for Android, so I casually ran scons p=android assuming it would tell me what's wrong. Instead I got "Required toolchain not found for platform".

In android.py, the helpful error is only printed in generate, which is called after exists in SConstruct:

SConstruct:

if tool is None or not tool.exists(env):
    raise ValueError("Required toolchain not found for platform " + env["platform"])

tool.generate(env)

android.py:

def exists(env):
    if not "ANDROID_NDK_ROOT" in os.environ:
        return False
    return True


def generate(env):
    if not "ANDROID_NDK_ROOT" in os.environ:
        raise ValueError(
            "To build for Android, ANDROID_NDK_ROOT must be defined. Please set ANDROID_NDK_ROOT to the root folder of your Android NDK installation."
        )
@Atem1995
Copy link

Atem1995 commented Mar 27, 2023

I met the same problem and saw your issue.
at the end:
scons platform=android arch=arm64 ANDROID_NDK_ROOT=C:\Users\Administrator\AppData\Local\Android\Sdk\ndk\23.2.8568313

@nathanfranke nathanfranke changed the title "Required toolchain not found for platform" printed instead of more helpful error. "Required toolchain not found for platform" printed instead of more helpful errors such as "ANDROID_NDK_ROOT not set". Apr 2, 2023
@DmitriySalnikov
Copy link
Contributor

It is still not specified anywhere that it is necessary to explicitly add ANDROID_NDK_ROOT to environment variables or arguments.

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

3 participants