[android studio flutter错误,当尝试发布应用程序时

问题描述 投票:0回答:2

[我在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

与Java 11或8版本有关吗?我已经安装了Java 8

提前感谢您的帮助

android android-studio flutter release android-studio-3.0
2个回答
0
投票

@@ Emad,是的。我认为您需要将Java升级到11。Here与此有关。


0
投票

如果您去

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

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

© www.soinside.com 2019 - 2024. All rights reserved.