Skip to content

✗ Android license status unknown. #16025

Closed
@NatoBoram

Description

@NatoBoram

Steps to Reproduce

Please tell us what you were doing and what went wrong. If you are running flutter tools from the command line, please try adding the -v or --verbose option to gather more information.

  1. Run flutter upgrade.

What went wrong

✗ Android license status unknown.

What should happen
There shouldn't be a problem. The build from last week did not output a problem, and this week's build shouldn't output a problem.

What I tried to fix the problem

  1. Upgraded Android Studio
  2. Added a few random SDK in the SDK Manager
  3. sudo chown -R $USER:$USER /opt/*
  4. flutter doctor --android-licenses

If the problem is with your application's rendering, please attach a screenshot and any relevant source code.
If you are getting an exception in the logs, and your code is implicated in the first few frames, then please include the source code for the functions involved.

Logs

Run your application with flutter run and attach all the log output.

Launching lib/main.dart on Nexus 5 in debug mode...
Initializing gradle...                                       0.8s
Resolving dependencies...                                   11.8s
Running 'gradlew assembleDebug'...                           4.7s
Built build/app/outputs/apk/debug/app-debug.apk (26.9MB).

The app then opens in the device and immediately crashes.

Run flutter analyze and attach any output of that command also.

Analyzing /home/users/n.gendron/GitLab/n.gendron/techno_store...
  lint • Close instances of `dart.core.Sink` at lib/server.dart:10:20 • close_sinks
  hint • 'BASE64' is deprecated and shouldn't be used at lib/edit.dart:85:9 • deprecated_member_use
  hint • 'JSON' is deprecated and shouldn't be used at lib/globals.dart:70:12 • deprecated_member_use
  hint • 'JSON' is deprecated and shouldn't be used at lib/globals.dart:80:19 • deprecated_member_use
  hint • 'BASE64' is deprecated and shouldn't be used at lib/item.dart:83:11 • deprecated_member_use
  hint • 'JSON' is deprecated and shouldn't be used at lib/server.dart:50:36 • deprecated_member_use
  hint • 'JSON' is deprecated and shouldn't be used at lib/server.dart:129:17 • deprecated_member_use
7 issues found.
(Ran in 8.2s)

Oh, what happened the last two days?

Flutter Doctor

Paste the output of running flutter doctor -v here.

[✓] Flutter (Channel beta, v0.2.3, on Linux, locale en_US.UTF-8)
    • Flutter version 0.2.3 at /home/users/n.gendron/GitHub/flutter
    • Framework revision 5a58b36e36 (2 weeks ago), 2018-03-13 13:20:13 -0700
    • Engine revision e61bb9ac3a
    • Dart version 2.0.0-dev.35.flutter-290c576264

[!] Android toolchain - develop for Android devices (Android SDK 27.0.3)
    • Android SDK at /opt/android-sdk/
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-27, build-tools 27.0.3
    • ANDROID_HOME = /opt/android-sdk/
    • Java binary at: /opt/android-studio/jre/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
    ✗ Android license status unknown.

[✓] Android Studio (version 3.1)
    • Android Studio at /opt/android-studio
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)

[✓] Connected devices (1 available)
    • Nexus 5 • 05473ea90a673764 • android-arm • Android 7.1.2 (API 25)

! Doctor found issues in 1 category.
flutter doctor --android-licenses
Warning: java.net.ConnectException: Connection timed out (Connection timed out) 
Warning: Failed to download any source lists! Fetch remote repository...        
Warning: File /home/users/n.gendron/.android/repositories.cfg could not be loaded.
All SDK package licenses accepted.======] 100% Computing updates... 

For more information about diagnosing and reporting Flutter bugs, please see https://flutter.io/bug-reports/.

Edit : Oh hey, I forgot to add some info about my system. It should probably be noted somewhere in the template to add it.

OS: Ubuntu 16.04.4 LTS x86_64 
Kernel: 4.13.0-38-generic 
Uptime: 17 hours, 31 mins 
Packages: 3069 
Shell: bash 4.3.48 
Resolution: 1024x768, 1920x1080 
DE: GNOME 3.18.5 
WM: GNOME Shell 
WM Theme: Adwaita 
Theme: Greybird [GTK2/3] 
Icons: Elementary-xfce-darker [GTK2/3] 
CPU: Intel i5 660 (4) @ 2.035GHz 
GPU: NVIDIA GeForce 8400 GS Rev. 2 
Memory: 4576MiB / 7840MiB 
java -version
openjdk version "1.8.0_151"
OpenJDK Runtime Environment (build 1.8.0_151-8u151-b12-0ubuntu0.16.04.2-b12)
OpenJDK 64-Bit Server VM (build 25.151-b12, mixed mode)

Edit : Most people stumbling here had a different problem from the one I had, and its solution is here.

Modify sdkmanager to use Java 8 by setting JAVA_HOME inside sdkmanager to a Java 8 installation. It's, by default, at ~/Android/Sdk/tools/bin/sdkmanager.

# Add default JVM options here. You can also use JAVA_OPTS and SDKMANAGER_OPTS to pass JVM options $
JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64
DEFAULT_JVM_OPTS='"-Dcom.android.sdklib.toolsdir=$APP_HOME" -XX:+IgnoreUnrecognizedVMOptions'
@rem Add default JVM options here. You can also use JAVA_OPTS and SDKMANAGER_OPTS to pass JVM options to this script.
set JAVA_HOME="C:\ProgramData\scoop\apps\android-studio\current\jre"
set DEFAULT_JVM_OPTS="-Dcom.android.sdklib.toolsdir=%~dp0\.."

This way, you can keep using a sane and maintained version of Java on your system while simultaneously using sdkmanager.

# Java
export JAVA_HOME=/usr/lib/jvm/default-java

And now I've got some pipelines to repair.

Metadata

Metadata

Assignees

No one assigned

    Labels

    platform-androidAndroid applications specificallytoolAffects the "flutter" command-line tool. See also t: labels.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions