Virtual-environments: No version of NDK matched the requested version 20.0.5594570. Versions available locally: 21.0.6113669

Created on 18 Mar 2020  路  11Comments  路  Source: actions/virtual-environments

Im receiving this error when build my tool into Github actions (migrated from travis).

No version of NDK matched the requested version 20.0.5594570. Versions available locally: 21.0.6113669

Log:
https://github.com/ezored/ezored/runs/517098191?check_suite_focus=true#step:14:46

question

Most helpful comment

Hello, thank you for response and confirmation.
You even don't need to specify --sdk_root any more.

echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install "ndk;20.0.5594570" should work.

@samtstern , how much time does it take to install the ndk in runtime?
Agree that ideally, they should be pre-installed (we already pre-install build_tools and platforms so it makes sense to pre-install ndks too).
I am closing this issue because it was caused by incorrect sdk root variable but feel free to open the new one about pre-installing popular ndks to the images. We will consider it

All 11 comments

Hello @prsolucoes ,
Currently, only latest Android NDK (21.0.x) is available on Ubuntu images.

Could you please try to add the step at the begin of your pipeline to install 20.0.5594570 to see if it resolves your issue?

sudo /usr/local/lib/android/tools/bin/sdkmanager --install "ndk;20.0.5594570" --sdk_root=${ANDROID_SDK_ROOT}

@prsolucoes , I see that you are doing the similar command but without --sdk_root=${ANDROID_SDK_ROOT}.
Unfortunately, we need this flag now because sdkmanager is located in non-default location on our images.
We have already prepared the fix #539 to move sdkmanager to correct location and it will be deployed next week to all Ubuntu images.

To summarize, your approach to install ndk will start work in 1 week but for now we have to use the different command.
Sorry for inconvenience, we are working to improve our images

It looks like #539 has been deployed to ubuntu-latest? I am now able to do this:

echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install "ndk;20.0.5594570" --sdk_root=${ANDROID_SDK_ROOT}

I am still not sure why I need to do this (could/should more versions of the NDK be installed by default?) but at least it works.

Hello, thank you for response and confirmation.
You even don't need to specify --sdk_root any more.

echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install "ndk;20.0.5594570" should work.

@samtstern , how much time does it take to install the ndk in runtime?
Agree that ideally, they should be pre-installed (we already pre-install build_tools and platforms so it makes sense to pre-install ndks too).
I am closing this issue because it was caused by incorrect sdk root variable but feel free to open the new one about pre-installing popular ndks to the images. We will consider it

@maxim-lobanov for me it takes about 1.5 minutes which is ~15% or more of my whole build. I could add a caching step probably but my build didn't need any caching before so that's more complexity.

I'll open a new issue for that.

Agree that 1.5 minutes is too much. We will take care about new issue, thanks!

If I'm using NPM and windows and am seeing this problem, what equivalent command would I use to resolve this issue?

@killycal , Sorry, what problem do you mean?
Could you please provide small repro step?

Hello @prsolucoes ,
Currently, only latest Android NDK (21.0.x) is available on Ubuntu images.

Could you please try to add the step at the begin of your pipeline to install 20.0.5594570 to see if it resolves your issue?

sudo /usr/local/lib/android/tools/bin/sdkmanager --install "ndk;20.0.5594570" --sdk_root=${ANDROID_SDK_ROOT}

Using this command It;'s getting download NDK and Building App Fine.
But In Pipeline, when Job runs next time, It is executed again so it's getting re-downloaded.
So is there any way to check whether it's already installed or not?

@chintan369 , every job is run on clean machine where this sdk is not installed. (Changes that were done by your previous job are not saved). So you have to install it on each build

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MSP-Greg picture MSP-Greg  路  3Comments

Tnze picture Tnze  路  4Comments

ydnar picture ydnar  路  3Comments

Poolitzer picture Poolitzer  路  4Comments

ethomson picture ethomson  路  4Comments