【问题标题】:Flutter project issue with enabling Android/iOS启用 Android/iOS 的 Flutter 项目问题
【发布时间】:2021-10-15 23:35:38
【问题描述】:

我希望以后能够添加 Android/iOS 版本。创建项目后添加 Android/iOS 支持似乎存在问题。

重现步骤

  1. 创建一个新的 Flutter 项目
  2. 仅启用网络

  1. 使用flutter config --enable-android添加Android配置
  2. 我已尝试重新启动 Android Studio。运行flutter cleanflutter pub getflutter pub upgrade 无效。

知道可能出了什么问题吗?我也尝试过四处搜索,但似乎找不到任何有关如何使其正常工作的文档。目前我能想到的唯一解决方法就是创建一个新的 Flutter 项目并从 lib/ 迁移现有代码

我目前正在使用 Android Studio 北极狐 2020.3.1

[✓] Flutter (Channel stable, 2.2.3, on macOS 11.5.1 20G80 darwin-x64, locale en)
    • Flutter version 2.2.3
    • Framework revision f4abaa0735 (6 weeks ago), 2021-07-01 12:46:11 -0700
    • Engine revision 241c87ad80
    • Dart version 2.13.4

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    • Android SDK 
    • Platform android-30, build-tools 30.0.2
    • Java binary at: /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java
    • Java version Java(TM) SE Runtime Environment (build 1.8.0_221-b11)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.0.1, Build version 12A7300
    • CocoaPods version 1.10.0

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[!] Android Studio (version 2020.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      ???? https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      ???? https://plugins.jetbrains.com/plugin/6351-dart
    ✗ Unable to find bundled Java version.
    • Try updating or re-installing Android Studio.

[✓] VS Code (version 1.59.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.25.0

[✓] Connected device (2 available)
    • AOSP on IA Emulator (mobile) • emulator-5554 • android-x86    • Android 9 (API 28) (emulator)
    • Chrome (web)                 • chrome        • web-javascript • Google Chrome 92.0.4515.131

! Doctor found issues in 1 category.

【问题讨论】:

    标签: flutter android-studio


    【解决方案1】:

    原来flutter config --enable-android/ios 没有在项目中添加缺少的 Android/iOS 文件。 flutter create --platforms=android,ios [PROJECT] 应该改为运行。

    【讨论】:

      猜你喜欢
      • 2021-07-13
      • 2022-11-09
      • 2019-08-01
      • 2023-02-11
      • 2020-07-17
      • 2022-12-31
      • 2021-12-16
      • 2020-04-25
      • 2020-06-28
      相关资源
      最近更新 更多