【问题标题】:Running an app on flutter dev channel gives error "Could not find io.flutter:x86_release xxx "在颤振开发频道上运行应用程序会出现错误“找不到 io.flutter:x86_release xxx”
【发布时间】:2019-10-26 17:32:25
【问题描述】:

我正在尝试在开发频道上运行颤振应用。这给出了以下错误。但其他一些应用程序工作正常。除了 API 兼容性之外,现有应用程序是否需要任何配置才能在开发通道上运行。请参阅下面的颤振医生等的输出。我尝试在flutter clean 之后再次运行,但结果相同。

编辑: 看起来像一个特定于 android 的问题,因为它在 IOS 模拟器上构建和运行良好! 编辑2: 它也适用于 Android Studio,但不能通过 vscode / 命令行(颤振运行)

flutter run --debug
Using hardware rendering with device Android SDK built for x86. If you
get graphics artifacts, consider enabling software rendering with
"--enable-software-rendering".
Launching lib/main.dart on Android SDK built for x86 in debug mode...
Initializing gradle...                                              1.3s
Resolving dependencies...                                           1.7s

FAILURE: Build failed with an exception.                                

* What went wrong:                                                      
Could not determine the dependencies of task ':app:compileDebugKotlin'. 
> Could not resolve all files for configuration ':app:releaseRuntimeClasspath'.
   > Could not find io.flutter:x86_release:1.0.0-1d62160fdb2f5a1d20f1dccb761a2caa96804c22.
     Searched in the following locations:                               
       - https://dl.google.com/dl/android/maven2/io/flutter/x86_release/1.0.0-1d62160fdb2f5a1d20f1dccb761a2caa96804c22/x86_release-1.0.0-1d62160fdb2f5a1d20f1dccb761a2caa96804c22.pom
       - https://dl.google.com/dl/android/maven2/io/flutter/x86_release/1.0.0-1d62160fdb2f5a1d20f1dccb761a2caa96804c22/x86_release-1.0.0-1d62160fdb2f5a1d20f1dccb761a2caa96804c22.jar
       - https://jcenter.bintray.com/io/flutter/x86_release/1.0.0-1d62160fdb2f5a1d20f1dccb761a2caa96804c22/x86_release-1.0.0-1d62160fdb2f5a1d20f1dccb761a2caa96804c22.pom
       - https://jcenter.bintray.com/io/flutter/x86_release/1.0.0-1d62160fdb2f5a1d20f1dccb761a2caa96804c22/x86_release-1.0.0-1d62160fdb2f5a1d20f1dccb761a2caa96804c22.jar
       - http://download.flutter.io/io/flutter/x86_release/1.0.0-1d62160fdb2f5a1d20f1dccb761a2caa96804c22/x86_release-1.0.0-1d62160fdb2f5a1d20f1dccb761a2caa96804c22.pom
       - http://download.flutter.io/io/flutter/x86_release/1.0.0-1d62160fdb2f5a1d20f1dccb761a2caa96804c22/x86_release-1.0.0-1d62160fdb2f5a1d20f1dccb761a2caa96804c22.jar
     Required by:                                                       
         project :app                                                   

* Try:                                                                  
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org                              

BUILD FAILED in 14s                                                     
Running Gradle task 'assembleDebug'...                                  
Running Gradle task 'assembleDebug'... Done                        15.3s
Gradle task assembleDebug failed with exit code 1

$ flutter channel
Flutter channels:
  beta
* dev
  master
  stable
$ flutter upgrade
Upgrading Flutter from /Users/.../sdk/flutter...
Already up to date.

Upgrading engine...
Downloading Android Maven dependencies...                           1.4s

Flutter 1.10.14 • channel dev • https://github.com/flutter/flutter.git
Framework • revision 1946fc4da0 (3 weeks ago) • 2019-10-07 15:23:31 -0700
Engine • revision 1d62160fdb
Tools • Dart 2.6.0 (build 2.6.0-dev.1.0 d6c6d12ebf)

Running flutter doctor...
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel dev, v1.10.14, on Mac OS X 10.15 19A602, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 11.1)
[✓] Android Studio (version 3.5)
[✓] Android Studio
[✓] VS Code (version 1.39.2)
[✓] Connected device (1 available)

• No issues found!

【问题讨论】:

  • 将Android虚拟设备设为x86_64

标签: flutter


【解决方案1】:

为什么它在 Android Studio 和 IOS 上工作而不是在 VSCode 上工作的奥秘在于两者都使用不同的 dart 和颤振 SDK,以及包/依赖项。这是因为编辑器插件使用自己的 sdk 和缓存。因此,将其全部配置为指向同一个 sdk 解决了这个问题。

【讨论】:

    猜你喜欢
    • 2021-02-23
    • 2022-01-09
    • 2020-03-15
    • 2021-03-20
    • 2021-12-24
    • 2021-04-22
    • 2021-09-20
    • 2020-12-20
    • 2021-06-27
    相关资源
    最近更新 更多