Skip to content

tool should validate that discovered java version is 1.8 before running certain SDK tools #62924

@stuart-little

Description

@stuart-little

Steps to Reproduce

  1. clone this repo
  2. install SDK command-line tools by unzipping the file available at developer.android (for Linux; I'm on Ubuntu 18.04) to $HOME/cmdline-tools. This provides me with an sdkmanager executable at $HOME/cmdline-tools/tools/bin/sdkmanager
  3. prep SDK by mimicking the commands listed in the file dev/bots/download_android_sdk.sh in this repo:
yes | $ANDROID_SDK_ROOT/cmdline-tools/tools/bin/sdkmanager --licenses
$ANDROID_SDK_ROOT/cmdline-tools/tools/bin/sdkmanager tools
$ANDROID_SDK_ROOT/cmdline-tools/tools/bin/sdkmanager platform-tools
$ANDROID_SDK_ROOT/cmdline-tools/tools/bin/sdkmanager  "platforms;android-28" \
    "build-tools;28.0.3" \
    "platforms;android-27" \
    "build-tools;27.0.3" \
    "extras;google;m2repository" \
    "extras;android;m2repository"

where for me ANDROID_SDK_ROOT is $HOME/Android. As far as I can tell, all goes well with these.

  1. run <path-to-flutter> doctor -v; this finds SDK all right, but cries about licenses (see the output below). I am instructed to run doctor --android-licenses.

  2. Finally, this last command produces an error:

$ export ANDROID_HOME=~/Android && ~/repos/flutter/bin/flutter doctor --android-licenses
---
Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
        at com.android.repository.api.SchemaModule$SchemaModuleVersion.<init>(SchemaModule.java:156)
        at com.android.repository.api.SchemaModule.<init>(SchemaModule.java:75)
        at com.android.sdklib.repository.AndroidSdkHandler.<clinit>(AndroidSdkHandler.java:81)
        at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:73)
        at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:48)
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlSchema
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
        ... 5 more

Logs

Output to <path-to-flutter> doctor -v:

[✓] Flutter (Channel master, 1.21.0-6.0.pre.180, on Linux, locale en_US.UTF-8)
    • Flutter version 1.21.0-6.0.pre.180 at $HOME/repos/flutter
    • Framework revision 428be90768 (3 hours ago), 2020-08-04 14:31:05 -0700
    • Engine revision 033dd45607
    • Dart version 2.10.0 (build 2.10.0-2.0.dev 0f0e04ec3a)

[!] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at $HOME/Android
    • Platform android-28, build-tools 28.0.3
    • ANDROID_HOME = $HOME/Android
    • ANDROID_SDK_ROOT = $HOME/Android
    • Java binary at: /usr/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.8+10-post-Ubuntu-0ubuntu118.04.1)
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/linux#android-setup for more details.

[!] Android Studio (not installed)
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/docs/get-started/install/linux#android-setup for detailed instructions).

[!] Connected device
    ! No devices available

! Doctor found issues in 3 categories.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: first hourThe first hour of using Fluttera: qualityA truly polished experienceplatform-androidAndroid applications specificallyteam-androidOwned by Android platform teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-androidTriaged by Android platform team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions