flutter / flutter

Flutter makes it easy and fast to build beautiful apps for mobile and beyond
https://flutter.dev
BSD 3-Clause "New" or "Revised" License
166.8k stars 27.64k forks source link

Add support for Android host #124410

Closed Yisus7u7 closed 1 year ago

Yisus7u7 commented 1 year ago

Screenshot_20230407-124128_Termux

Currently, it is possible to compile android apps, for example, in kotlin on an android device without emulating any GNU/Linux system.

I would like to program in flutter from my cell phone, but flutter does not support android on its supported hosts, please, it would be very good to add support to run it on android.

Screenshot_20230407-124837_Termux

Log:

Flutter crash report.
Please report a bug at https://github.com/flutter/flutter/issues.

## command

flutter 

## exception

_TypeError: Null check operator used on a null value

#0      getHomeDirectory (package:unified_analytics/src/utils.dart:81:27)
#1      new Analytics (package:unified_analytics/src/analytics.dart:112:38)
#2      getDefaultAnalytics (package:flutter_tools/src/globals.dart:97:38)
#3      analytics (package:flutter_tools/src/globals.dart:93:56)
#4      run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:66:21)
#5      _rootRun (dart:async/zone.dart:1399:13)
#6      _CustomZone.run (dart:async/zone.dart:1301:19)
#7      _runZoned (dart:async/zone.dart:1804:10)
#8      runZonedGuarded (dart:async/zone.dart:1792:12)
#9      runZoned (dart:async/zone.dart:1744:12)
#10     run.<anonymous closure> (package:flutter_tools/runner.dart:63:12)
<asynchronous suspension>
#11     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#12     main (package:flutter_tools/executable.dart:91:3)
<asynchronous suspension>

## flutter doctor

[☠] Flutter (the doctor check crashed)
    ✗ Due to an error, the doctor check did not complete. If the error message below is not helpful, please let us know about this issue at https://github.com/flutter/flutter/issues.
    ✗ UnimplementedError: Host OS not supported.
    • #0      _currentHostPlatform (package:flutter_tools/src/artifacts.dart:753:3)
      #1      CachedArtifacts.getArtifactPath (package:flutter_tools/src/artifacts.dart:482:59)
      #2      FlutterValidator.validate (package:flutter_tools/src/doctor.dart:539:47)
      #3      Doctor.startValidatorTasks.<anonymous closure> (package:flutter_tools/src/doctor.dart:251:72)
      #4      asyncGuard.<anonymous closure> (package:flutter_tools/src/base/async_guard.dart:111:32)
      #5      _rootRun (dart:async/zone.dart:1399:13)
      #6      _CustomZone.run (dart:async/zone.dart:1301:19)
      #7      _runZoned (dart:async/zone.dart:1804:10)
      #8      runZonedGuarded (dart:async/zone.dart:1792:12)
      #9      runZoned (dart:async/zone.dart:1744:12)
      #10     asyncGuard (package:flutter_tools/src/base/async_guard.dart:109:3)
      #11     Doctor.startValidatorTasks (package:flutter_tools/src/doctor.dart:243:9)
      #12     DoctorText._validatorTasks (package:flutter_tools/src/doctor.dart:734:60)
      #13     DoctorText._validatorTasks (package:flutter_tools/src/doctor.dart)
      #14     DoctorText._runDiagnosis (package:flutter_tools/src/doctor.dart:738:53)
      #15     DoctorText.text (package:flutter_tools/src/doctor.dart:730:36)
      #16     DoctorText.text (package:flutter_tools/src/doctor.dart)
      #17     _createLocalCrashReport (package:flutter_tools/runner.dart:245:51)
      #18     _handleToolError (package:flutter_tools/runner.dart:207:31)
      <asynchronous suspension>
      #19     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
      <asynchronous suspension>
      #20     main (package:flutter_tools/executable.dart:91:3)
      <asynchronous suspension>

[!] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    • Android SDK at /data/data/com.termux/files/usr/opt/android-sdk
    • Platform android-32, build-tools 33.0.0
    • ANDROID_HOME = /data/data/com.termux/files/usr/opt/android-sdk
    • ANDROID_SDK_ROOT = /data/data/com.termux/files/usr/opt/android-sdk/cmdline-tools/latest/bin
    • Java binary at: /data/data/com.termux/files/usr/opt/openjdk/bin/java
    • Java version OpenJDK Runtime Environment (build 17-internal+0-adhoc..src)
    ! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses

[!] 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 for detailed instructions).

[☠] Connected device (the doctor check crashed)
    ✗ Due to an error, the doctor check did not complete. If the error message below is not helpful, please let us know about this issue at https://github.com/flutter/flutter/issues.
    ✗ Exception: Platform android is not supported.
    • #0      throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
      #1      findChromeExecutable (package:flutter_tools/src/web/chrome.dart:81:3)
      #2      ChromiumLauncher.canFindExecutable (package:flutter_tools/src/web/chrome.dart:141:41)
      #3      ChromiumDevice.isSupported (package:flutter_tools/src/web/web_device.dart:114:41)
      #4      WebDevices.pollingGetDevices (package:flutter_tools/src/web/web_device.dart:362:25)
      #5      PollingDeviceDiscovery._populateDevices (package:flutter_tools/src/device.dart:563:42)
      #6      PollingDeviceDiscovery.discoverDevices (package:flutter_tools/src/device.dart:549:12)
      #7      DeviceManager.refreshAllDevices (package:flutter_tools/src/device.dart:233:20)
      #8      DeviceValidator.validate (package:flutter_tools/src/doctor.dart:683:55)
      #9      Doctor.startValidatorTasks.<anonymous closure> (package:flutter_tools/src/doctor.dart:251:72)
      #10     asyncGuard.<anonymous closure> (package:flutter_tools/src/base/async_guard.dart:111:32)
      #11     _rootRun (dart:async/zone.dart:1399:13)
      #12     _CustomZone.run (dart:async/zone.dart:1301:19)
      #13     _runZoned (dart:async/zone.dart:1804:10)
      #14     runZonedGuarded (dart:async/zone.dart:1792:12)
      #15     runZoned (dart:async/zone.dart:1744:12)
      #16     asyncGuard (package:flutter_tools/src/base/async_guard.dart:109:3)
      #17     Doctor.startValidatorTasks (package:flutter_tools/src/doctor.dart:243:9)
      #18     DoctorText._validatorTasks (package:flutter_tools/src/doctor.dart:734:60)
      #19     DoctorText._validatorTasks (package:flutter_tools/src/doctor.dart)
      #20     DoctorText._runDiagnosis (package:flutter_tools/src/doctor.dart:738:53)
      #21     DoctorText.text (package:flutter_tools/src/doctor.dart:730:36)
      #22     DoctorText.text (package:flutter_tools/src/doctor.dart)
      #23     _createLocalCrashReport (package:flutter_tools/runner.dart:245:51)
      #24     _handleToolError (package:flutter_tools/runner.dart:207:31)
      <asynchronous suspension>
      #25     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
      <asynchronous suspension>
      #26     main (package:flutter_tools/executable.dart:91:3)
      <asynchronous suspension>

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 4 categories.

Links:

Flutter SDK Android builds

Dart SDK Android Builds

Android SDK manager for Android

Aditional info

OS: Android 13 aarch64
Host: motorola moto g(6) plus
Kernel: 4.4.302-lineage-geccf0e75105a
Packages: 392 (dpkg), 1 (pkg)
Shell: bash 5.2.15
CPU: Qualcomm SDM630 (8) @ 2.208GHz
Memory: 3736MiB
iapicca commented 1 year ago

I would like to program in flutter from my cell phone

@Yisus7u7 why?
(sounds dramatic, but seriously... what's the use case?)

Yisus7u7 commented 1 year ago

@iapicca Simply, apart from the fact that many people without a computer will be able to create apps with flutter from their cell phone, it would give me comfort to use neovim on my cell phone and program in flutter while I do not have my computer available. In any case, it is not difficult.

darshankawar commented 1 year ago

Thanks for the report. Labeling this as a potential proposal.

christopherfujino commented 1 year ago

Thank you for filing this issue! However, I am going to close it as a duplicate of https://github.com/flutter/flutter/issues/75864. Please follow that issue for for more information and updates. Thanks!

github-actions[bot] commented 1 year ago

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.