首页 > 解决方案 > 尝试发布应用程序时android studio颤动错误

问题描述

我在android studio中使用flutter制作了这个应用程序,当我尝试发布应用程序时出现这个错误:

错误:Android Pre Dex:[flutter.jar] 未捕获的翻译错误:com.android.dx.cf.code.SimException:io.flutter.plugin.platform.PlatformViewsController$1.createPlatformView 中的错误:(Lio/flutter/embedding/engine /systemchannels/PlatformViewsChannel$PlatformViewCreationRequest;)J: 无效的操作码 ba - invokedynamic 需要 --min-sdk-version >= 26(当前为 13)

错误:Android Pre Dex:[flutter.jar] 未捕获的翻译错误:com.android.dx.cf.code.SimException:io.flutter.view.AccessibilityBridge.shouldSetCollectionInfo 中的错误:(Lio/flutter/view/AccessibilityBridge$SemanticsNode; )Z: 无效的操作码 ba - invokedynamic 需要 --min-sdk-version >= 26 (当前为 13) 11

这是我的颤振医生输出:

[√] Flutter (Channel stable, v1.9.1+hotfix.6, on Microsoft Windows [Version 10.0.17763.864], locale en-US)
    • Flutter version 1.9.1+hotfix.6 at D:\flutter
    • Framework revision 68587a0916 (2 months ago), 2019-09-13 19:46:58 -0700
    • Engine revision b863200c37
    • Dart version 2.5.0

[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    • Android SDK at C:\Users\user\AppData\Local\Android\sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 29.0.2
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
    • All Android licenses accepted.

[√] Android Studio (version 3.5)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin version 41.1.2
    • Dart plugin version 191.8593
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)

[!] Connected device
    ! No devices available

! Doctor found issues in 1 category.
Process finished with exit code 0

提前感谢您的帮助。

标签: androidandroid-studioflutterreleaseandroid-studio-3.0

解决方案


如果你去

文件 -> 设置 -> 构建、执行、部署 -> 编译器 -> Java 编译器

有一个使用“--release”选项的选项,如果勾选,则需要 Java 9 或更高版本。取消勾选或更新您的 Java 可能会为您解决问题。


推荐阅读