Closed Bug 1883910 Opened 2 years ago Closed 1 year ago

The ANDROID_SDK_TOO_OLD message is confusing, blaming sdkmanager not existing when it does exist

Categories

(Firefox Build System :: General, defect, P3)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: saschanaz, Unassigned)

References

Details

After bug 1822171 I got this while bootstrapping:

> ./mach build && ./mach wpt testing/web-platform/tests/clipboard-apis/
 0:01.01 W Clobber not needed.
 Config object not found by mach.
 0:01.43 Using Python 3.11.4 from C:\Users\sasch\.mozbuild\srcdirs\gecko-23ebcb979905\_virtualenvs\build\Scripts\python.exe
 0:01.43 Adding configure options from D:\gecko\mozconfig-android-x86-64
 0:01.43   --disable-optimize
 0:01.44   --enable-project=mobile/android
 0:01.44   --target=x86_64
 0:01.44 checking for vcs source checkout... git
 0:01.46 checking for a shell... C:/mozilla-build/msys2/usr/bin/sh.exe
 0:01.46 checking for host system type... x86_64-pc-windows-msvc
 0:01.46 checking for target system type... x86_64-unknown-linux-android
 0:01.95 checking whether cross compiling... yes
 0:04.38 checking for the target C compiler... C:/Users/sasch/.mozbuild/clang/bin/clang.exe
 0:04.38 checking for ccache... not found
 0:04.47 checking whether the target C compiler can be used... yes
 0:04.47 checking for the target C++ compiler... C:/Users/sasch/.mozbuild/clang/bin/clang++.exe
 0:04.55 checking whether the target C++ compiler can be used... yes
 0:04.55 ERROR: You must specify --with-android-ndk=/path/to/ndk when targeting Android, or try |mach bootstrap|.
*** Fix above errors and then restart with "./mach build"
> ./mach bootstrap

Note on Artifact Mode:

Artifact builds download prebuilt C++ components rather than building
them locally. Artifact builds are faster!

Artifact builds are recommended for people working on Firefox or
Firefox for Android frontends, or the GeckoView Java API. They are unsuitable
for those working on C++ code. For more information see:
https://firefox-source-docs.mozilla.org/contributing/build/artifact_builds.html.

Please choose the version of Firefox you want to build (see note above):
  1. Firefox for Desktop Artifact Mode [default]
  2. Firefox for Desktop
  3. GeckoView/Firefox for Android Artifact Mode
  4. GeckoView/Firefox for Android
  5. SpiderMonkey JavaScript engine
Your choice: 4
Requirement already satisfied: glean-sdk==58.0.0 in c:\users\sasch\.mozbuild\srcdirs\gecko-23ebcb979905\_virtualenvs\mach\lib\site-packages (58.0.0)
Requirement already satisfied: semver>=2.13.0 in c:\users\sasch\.mozbuild\srcdirs\gecko-23ebcb979905\_virtualenvs\mach\lib\site-packages (from glean-sdk==58.0.0) (3.0.2)
Requirement already satisfied: glean_parser~=13.0 in c:\users\sasch\.mozbuild\srcdirs\gecko-23ebcb979905\_virtualenvs\mach\lib\site-packages (from glean-sdk==58.0.0) (13.0.0)
Requirement already satisfied: appdirs>=1.4 in c:\users\sasch\.mozbuild\srcdirs\gecko-23ebcb979905\_virtualenvs\mach\lib\site-packages (from glean_parser~=13.0->glean-sdk==58.0.0) (1.4.4)      
Requirement already satisfied: Click>=7 in d:\gecko\third_party\python\click (from glean_parser~=13.0->glean-sdk==58.0.0) (8.1.6)
Requirement already satisfied: diskcache>=4 in c:\users\sasch\.mozbuild\srcdirs\gecko-23ebcb979905\_virtualenvs\mach\lib\site-packages (from glean_parser~=13.0->glean-sdk==58.0.0) (5.6.3)      
Requirement already satisfied: Jinja2>=2.10.1 in d:\gecko\third_party\python\jinja2 (from glean_parser~=13.0->glean-sdk==58.0.0) (3.1.2)
Requirement already satisfied: jsonschema>=3.0.2 in d:\gecko\third_party\python\jsonschema (from glean_parser~=13.0->glean-sdk==58.0.0) (4.17.3)
Requirement already satisfied: PyYAML>=5.3.1 in c:\users\sasch\.mozbuild\srcdirs\gecko-23ebcb979905\_virtualenvs\mach\lib\site-packages (from glean_parser~=13.0->glean-sdk==58.0.0) (6.0.1)     
Requirement already satisfied: colorama in d:\gecko\third_party\python\colorama (from Click>=7->glean_parser~=13.0->glean-sdk==58.0.0) (0.4.5)
Requirement already satisfied: MarkupSafe>=2.0 in d:\gecko\third_party\python\markupsafe\src (from Jinja2>=2.10.1->glean_parser~=13.0->glean-sdk==58.0.0) (2.0.1)
Requirement already satisfied: attrs>=17.4.0 in d:\gecko\third_party\python\attrs (from jsonschema>=3.0.2->glean_parser~=13.0->glean-sdk==58.0.0) (23.1.0)
Requirement already satisfied: pyrsistent!=0.17.0,!=0.17.1,!=0.17.2,>=0.14.0 in d:\gecko\third_party\python\pyrsistent (from jsonschema>=3.0.2->glean_parser~=13.0->glean-sdk==58.0.0) (0.16.0)  
Requirement already satisfied: six in d:\gecko\third_party\python\six (from pyrsistent!=0.17.0,!=0.17.1,!=0.17.2,>=0.14.0->jsonschema>=3.0.2->glean_parser~=13.0->glean-sdk==58.0.0) (1.16.0)
Requirement already satisfied: psutil<=5.9.4,>=5.4.2 in c:\users\sasch\.mozbuild\srcdirs\gecko-23ebcb979905\_virtualenvs\mach\lib\site-packages (5.9.4)
Requirement already satisfied: zstandard<=0.22.0,>=0.11.1 in c:\users\sasch\.mozbuild\srcdirs\gecko-23ebcb979905\_virtualenvs\mach\lib\site-packages (0.22.0)
Downloading https://dl.google.com/android/repository/android-ndk-r26c-windows.zip...
android-ndk-r26c-windows.zip: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 630M/630M [00:07<00:00, 88.6MB/s]
Unpacking C:\Users\sasch\.mozbuild\mozboot\android-ndk-r26c-windows.zip...
Unpacking C:\Users\sasch\.mozbuild\mozboot\android-ndk-r26c-windows.zip... DONE
Error running mach:

    mach bootstrap

The error occurred in code that was called by the mach command. This is either
a bug in the called code itself or in the way that mach is calling it.
You can invoke ``./mach busted`` to check if this issue is already on file. If it
isn't, please use ``./mach busted file bootstrap`` to report it. If ``./mach busted`` is
misbehaving, you can also inspect the dependencies of bug 1543241.

If filing a bug, please include the full output of mach, including this error
message.

The details of the failure are as follows:

NotImplementedError:
Looks like you have an outdated Android SDK installed at:
C:\Users\sasch\.mozbuild\android-sdk-windows
I can't update outdated Android SDKs to have the required 'sdkmanager'
tool.  Move it out of the way (or remove it entirely) and then run
bootstrap again.


  File "D:\gecko\python\mozboot\mozboot\mach_commands.py", line 50, in bootstrap
    bootstrapper.bootstrap(command_context.settings)
  File "d:\gecko\python\mozboot\mozboot\bootstrap.py", line 430, in bootstrap
    getattr(self.instance, "install_%s_packages" % application)(mozconfig_builder)
  File "d:\gecko\python\mozboot\mozboot\mozillabuild.py", line 176, in install_mobile_android_packages
    android.ensure_android(
  File "d:\gecko\python\mozboot\mozboot\android.py", line 346, in ensure_android
    ensure_android_sdk_and_ndk(
  File "d:\gecko\python\mozboot\mozboot\android.py", line 445, in ensure_android_sdk_and_ndk
    raise NotImplementedError(ANDROID_SDK_TOO_OLD % sdk_path)

Sentry event ID: 9fa2617f5bf04f929b6909948f34d0b8

Per bug 1344244 and the comment it seems it's more about not being able to easily upgrade the SDK. But the error message is defined as:

ANDROID_SDK_TOO_OLD = """
Looks like you have an outdated Android SDK installed at:
%s
I can't update outdated Android SDKs to have the required 'sdkmanager'
tool.  Move it out of the way (or remove it entirely) and then run
bootstrap again.
"""

That sounds like the automatic upgrade can't happen because of nonexistent sdkmanager, which sounds misleading unless I'm misunderstanding here.

The severity field is not set for this bug.
:ahochheiden, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(ahochheiden)
Severity: -- → S3
Flags: needinfo?(ahochheiden)
Priority: -- → P3

I think this was effectively resolved by bug 1960055.

Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.