【问题标题】:IntelliJ IDEA won't run Flutter appIntelliJ IDEA 不会运行 Flutter 应用程序
【发布时间】:2023-03-24 08:08:01
【问题描述】:

我在使用 Flutter 开发和 IntelliJ IDEA 时遇到了一个奇怪的问题。我正在使用 IntelliJ IDEA 2017 1.4 内部版本号 IC-171.4694.23 开发一个颤振应用程序,我无法在连接的 Android 设备上运行应用程序,当我运行该应用程序时,它显示一个后台进程正在运行“正在运行 gradle assembleDebug ... " 然后进程停止,尽管我能够更早地运行和调试它,但什么也没有发生。 已尝试解决方案,

  1. 禁用/启用 adb 插件。
  2. 禁用/启用开发者选项和 USB 调试。
  3. 重新安装颤振。

我也试过安卓模拟器,同样的事情发生了。所以我认为问题不在于设备。任何帮助表示赞赏。

更新:

当我将 image_picker 插件添加到我的 pubspec.yaml 时会发生此问题。

  dependencies:
    flutter:
      sdk: flutter
   image_picker:

【问题讨论】:

  • 你能通过flutter run使用命令行运行你的flutter应用吗?
  • 我做到了,没有运气。我还制作了一个新的颤振应用程序,运行和安装都很好。

标签: intellij-idea flutter


【解决方案1】:

flutter run 是否因以下错误而失败?

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> Failed to notify project evaluation listener.
   > Could not resolve all dependencies for configuration ':app:_debugApkCopy'.
      > Could not find com.github.esafirm.android-image-picker:imagepicker:1.5.0.
        Required by:
            project :app > project :image_picker
   > Could not get unknown property 'compileDebugJavaWithJavac' for project ':app' of type org.gradle.api.Project.

如果是这样,您可以按照image_picker 文档中的说明修改您的build.gradle 来解决此问题。

allprojects {
   repositories {
       jcenter()
       maven { url "https://maven.google.com" }
       maven { url "https://jitpack.io" }    // add this line
   }
}

【讨论】:

  • 成功了,但我没有收到任何异常,构建过程不会完成并停止,不会引发任何异常。
猜你喜欢
  • 2022-11-23
  • 2011-12-24
  • 2023-03-07
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-12-04
  • 2016-03-15
  • 1970-01-01
相关资源
最近更新 更多