-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
[all OS versions] Android NDK is updated to r22. #2420
Comments
Hello there! We use Azure DevOps pipelines with the macOS 10.15 image to build our Android apps. Yesterday we wanted to build releases of our apps, but we got gradle errors back that the NDK version was not available. We googled and found this issue :). We then tried out your specified mitigation way, but that unfortunately did not work. We tried out all of these commands, but they all failed:
Error:
Could you please tell us when the migration will be finished, or how we can mitigate the issue? Seems like today is the last day of migration, but the rollout progress is only at 25%. Thanks in advance! |
Hello @carstenhag, Could you please provide image version from your last successful build and first failed build? (Image version can be found in the logs of first step of build). |
ndk-bundle now don't contain directory called : Issue happened first time yesterday afternoon and continues today. Can you please support ? |
Hello there! We have been using But now we seem to always get old images again which don't have So basically, some images were 20201212.1, some 20210110.1, as expected as the rollout is not finished. Just the mitigation way provided does not work, which is bad. |
Same here. I know that Azure DevOps does announce brownouts of image and have seen those before. Would have been very good to announce this as well. |
@ystefinko, could you please try mitigation step above? Adding @carstenhag , sorry for inconvenience, deployment should be finished on Monday.
|
@maxim-lobanov unfortunately the suggested line does not work (I had posted the errors we got at #2420 (comment)). (We have queued our release pipeline 30 times today and our two releases did now go through, seems like 2 out of 30 times it did get the new image) |
@dentuzhik , have you tried to subscribe to releases?
@carstenhag , sorry for inconvenience. Usually deployment of macOS takes less 2 days but this week we have stuck with multiple environment issues. |
Maybe we are talking past eachother, I will try to be more specific :). It is not a problem that the rollout takes some time. For us it is a problem, that the mitigation does not work. We would have been happy if the mitigation would have installed the ndk version. |
For us root cause was in bug with Android gradle plugin - https://issuetracker.google.com/issues/144111441 |
@carstenhag , oh, just realized an issue. |
Thanks, that did work (I used |
I have logged bug for an issue with sudo: #2454 |
This behavior is by design for sudo: you should use flag -E to pass env variables, because JAVA_HOME is missing:
unset JAVA_HOME:
|
@maxim-lobanov sudo ${ANDROID_HOME}/tools/bin/sdkmanager --sdk_root=${ANDROID_HOME} --install "ndk;22.0.7026061" |
@ystefinko As maxim wrote at #2420 (comment), leave out the
|
@carstenhag and @maxim-lobanov issue still exist. I ran it without |
Hello @ystefinko. As a solution you can try
|
@dmitry-shibanov hello! All your suggestions helped. Build passed.
|
This broke our CI as well - would love for there to be an announcement channel for stuff like this. Quick note that the docs here for the macos-10.15 installed software (and probably in the lists for other images) don't show this as updated, noticed when I went googling for a solution. |
Azure updated their pre-installed NDK from 21 to 22. Also NDK 22 don't include `platforms` directory. Examples were not compiling due to error: "NDK is missing a "platforms" directory" Fixed by installing NDK 21 in job and using it for further compilations. Discussed in: actions/runner-images#2420 Also gradle and android-gradle-plugin were updated. Relates-To: OLPEDGE-2443 Signed-off-by: Yaroslav Stefinko <[email protected]>
Azure updated their pre-installed NDK from 21 to 22. Also NDK 22 don't include `platforms` directory. Examples were not compiling due to error: "NDK is missing a "platforms" directory" Fixed by installing NDK 21 in job and using it for further compilations. Discussed in: actions/runner-images#2420 Also gradle and android-gradle-plugin were updated. Relates-To: OLPEDGE-2443 Signed-off-by: Yaroslav Stefinko <[email protected]>
Hi all, We will revisit the strategy of NDK support, and will rollout image with the fix next week. |
@sashaweiss About the readme being out of date: The READMEs only get updated after the rollout is 100% through. No clue where I saw it, but a contributor mentioned this |
@carstenhag @sashaweiss the proper link to the readme can be found in the set up job step |
@miketimofeev thanks for the tip! I'll use that next time, that'll be handy. |
Earlier in the week I bumped to 22.x and a few actions have run fine. This morning...
Was this rolled back in |
Unfortunately, yes. We have got a lot of reports from customers about breaking builds with NDK 22.x. Also we have got feedback from Xamarin.Android team - NDK 22 is not supported ye. We have to roll images back and freeze NDK 21 on images for a while. A bit more context in #2481 (comment) |
Context: actions/runner-images#2420 Context: dotnet/android#5499 Context: dotnet/android#5526 Context: android/ndk#1427 Context: https://developer.android.com/studio/command-line/variables#envar Xamarin.Android is not (yet) compatible with the recently released Android NDK r22 version. Azure build images have recently rolled out an update which includes NDK r22 and, thus, it breaks builds for customers using any form of Xamarin.Android AOT build. In an attempt to detect broken/incompatible NDK versions as well as to select the "best one", this commit adds code to scan the known NDK locations in search of the preferred version. Given an `AndroidSdkInfo` creation of: var info = new AndroidSdkInfo (logger:logger, androidSdkPath: sdkPath, androidNdkPath: ndkPath, javaSdkPath: javaPath); var usedNdkPath = info.AndroidNdkPath; If `ndkPath` is not `null` and otherwise valid, then `usedNdkPath` is `ndkPath`. If `ndkPath` is `null` or is otherwise invalid (missing `ndk-stack`, etc.), then we search for an `info.AndroidNdkPath` value as follows: 1. If `androidSdkPath` is not `null` and valid, then we check for Android SDK-relative NDK locations, in: * `{androidSdkPath}/ndk/*` * `{androidSdkPath}/ndk-bundle` For each found SDK-relative NDK directory, we filter out NDKs for which we cannot determine the package version, as well as those which are "too old" (< `MinimumCompatibleNDKMajorVersion`) or "too new" (> `MaximumCompatibleNDKMajorVersion`), currently r22. We prefer the NDK location with the highest version number. 2. If `androidSdkPath` is not `null` and valid and if there are no Android SDK-relative NDK locations, then we use the user-selected "preferred NDK location". See also `AndroidSdkInfo.SetPreferredAndroidNdkPath()`. 3. If `androidSdkPath` is not `null` and valid and if the preferred NDK location isn't set or is invalid, then we check directories specified in `$PATH`, and use the directory which contains `ndk-stack`. 4. If `androidSdkPath` is not `null` and valid and `$PATH` didn't contain `ndk-stack`, then we continue looking for NDK locations within the Android SDK locations specified by the `$ANDROID_HOME` and `$ANDROID_SDK_ROOT` environment variables. As with (1), these likewise look for e.g. `${ANDROID_HOME}/ndk/*` or `${ANDROID_SDK_ROOT}/ndk-bundle` directories and select the NDK with the highest supported version. 5. If `androidSdkPath` is `null`, then *first* we try to find a valid Android SDK directory, using on Unix: a. The preferred Android SDK directory; see also `AndroidSdkInfo.SetPreferredAndroidSdkPath(). b. The `$ANDROID_HOME` and `ANDROID_SDK_ROOT` environment variables. c. Directories within `$PATH` that contain `adb`. Once an Android SDK is found, steps (1)…(4) are performed. In (1) and (4), we now look for the Android SDK packages containing the NDK. There are two kinds of such packages: * `ndk-bundle` is the older package which allows for installation of only one NDK inside the SDK directory * `ndk/*` is a newer package which allows for installation of several NDK versions in parallel. Each subdirectory of `ndk` is an `X.Y.Z` version number of the NDK. In each of these directories we look for the `source.properties` file from which we then extract the NDK version and then we sort thus discovered NDK instances using their version as the key, in the descending order. The latest compatible (currently: less than 22 and more than 15) version is selected and its path returned to the caller.
Context: actions/runner-images#2420 Context: dotnet/android#5499 Context: dotnet/android#5526 Context: android/ndk#1427 Context: https://developer.android.com/studio/command-line/variables#envar Xamarin.Android is not (yet) compatible with the recently released Android NDK r22 version. Azure build images have recently rolled out an update which includes NDK r22 and, thus, it breaks builds for customers using any form of Xamarin.Android AOT build. In an attempt to detect broken/incompatible NDK versions as well as to select the "best one", this commit adds code to scan the known NDK locations in search of the preferred version. Given an `AndroidSdkInfo` creation of: var info = new AndroidSdkInfo (logger:logger, androidSdkPath: sdkPath, androidNdkPath: ndkPath, javaSdkPath: javaPath); var usedNdkPath = info.AndroidNdkPath; If `ndkPath` is not `null` and otherwise valid, then `usedNdkPath` is `ndkPath`. If `ndkPath` is `null` or is otherwise invalid (missing `ndk-stack`, etc.), then we search for an `info.AndroidNdkPath` value as follows: 1. If `androidSdkPath` is not `null` and valid, then we check for Android SDK-relative NDK locations, in: * `{androidSdkPath}/ndk/*` * `{androidSdkPath}/ndk-bundle` For each found SDK-relative NDK directory, we filter out NDKs for which we cannot determine the package version, as well as those which are "too old" (< `MinimumCompatibleNDKMajorVersion`) or "too new" (> `MaximumCompatibleNDKMajorVersion`), currently r22. We prefer the NDK location with the highest version number. 2. If `androidSdkPath` is not `null` and valid and if there are no Android SDK-relative NDK locations, then we use the user-selected "preferred NDK location". See also `AndroidSdkInfo.SetPreferredAndroidNdkPath()`. 3. If `androidSdkPath` is not `null` and valid and if the preferred NDK location isn't set or is invalid, then we check directories specified in `$PATH`, and use the directory which contains `ndk-stack`. 4. If `androidSdkPath` is not `null` and valid and `$PATH` didn't contain `ndk-stack`, then we continue looking for NDK locations within the Android SDK locations specified by the `$ANDROID_HOME` and `$ANDROID_SDK_ROOT` environment variables. As with (1), these likewise look for e.g. `${ANDROID_HOME}/ndk/*` or `${ANDROID_SDK_ROOT}/ndk-bundle` directories and select the NDK with the highest supported version. 5. If `androidSdkPath` is `null`, then *first* we try to find a valid Android SDK directory, using on Unix: a. The preferred Android SDK directory; see also `AndroidSdkInfo.SetPreferredAndroidSdkPath(). b. The `$ANDROID_HOME` and `ANDROID_SDK_ROOT` environment variables. c. Directories within `$PATH` that contain `adb`. Once an Android SDK is found, steps (1)…(4) are performed. In (1) and (4), we now look for the Android SDK packages containing the NDK. There are two kinds of such packages: * `ndk-bundle` is the older package which allows for installation of only one NDK inside the SDK directory * `ndk/*` is a newer package which allows for installation of several NDK versions in parallel. Each subdirectory of `ndk` is an `X.Y.Z` version number of the NDK. In each of these directories we look for the `source.properties` file from which we then extract the NDK version and then we sort thus discovered NDK instances using their version as the key, in the descending order. The latest compatible (currently: less than 22 and more than 15) version is selected and its path returned to the caller.
Closing this issue, because we reverted image with r22 and will deploy this week with default to r21. |
Here we go again #4144 |
Breaking changes
Default Android NDK was updated to r22.
Target date
Images deployment starts January, 11 and will take 3-4 days.
The motivation for the changes
We provide only the latest NDK by default due to space concerns
Possible impact
If your workflow uses features that were removed from r22 — your build will be broken. Please, refer to NDR r22 changelog for more information.
Virtual environments affected
Mitigation ways
sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install "ndk;<exact_version>"
${ANDROID_HOME}/tools/bin/sdkmanager --install "ndk;<exact_version>"
$env:ANDROID_HOME/tools/bin/sdkmanager --install "ndk;<exact_version>"
If the time is critical for you, consider using actions/cache to win some installation time.
The text was updated successfully, but these errors were encountered: