首先:我将全局minSdkVersion变量的值从源代码修改为19,以便所有项目(旧项目和新项目)都使用它.

第二:我添加了Flatter firebase插件,Flatter运行成功

最后:当我看到seedebug控制台时,它在vscode中出错了.我不知道怎么解决它

D:\flutter_application_3_vs\android\app\src\main\java\io\flutter\app\FlutterMultiDexApplication.java:12: ����: �����androidx.multidex������
import androidx.multidex.MultiDex;
                        ^
D:\flutter_application_3_vs\android\app\src\main\java\io\flutter\app\FlutterMultiDexApplication.java:22: ����: �Ҳ�������
    MultiDex.install(this);
    ^
  ����:   ���� MultiDex
  �: �� FlutterMultiDexApplication
2 ������

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

* 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 7s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)

这款Flutter doctor -v应用程序:CompiledBugJavaWithJavaC

[√] Flutter (Channel stable, 3.0.0, on Microsoft Windows [版本 10.0.19044.1645], locale zh-Hans-HK)
    • Flutter version 3.0.0 at D:\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision ee4e09cce0 (2 days ago), 2022-05-09 16:45:18 -0700
    • Engine revision d1b9a6938a
    • Dart version 2.17.0
    • DevTools version 2.12.2
    • Pub download mirror https://pub.flutter-io.cn
    • Flutter download mirror https://storage.flutter-io.cn

[√] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
    • Android SDK at D:\SDK
    • Platform android-32, build-tools 32.0.0
    • ANDROID_HOME = D:\SDK
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840)
    • All Android licenses accepted.

[X] Chrome - develop for the web (Cannot find Chrome executable at .\Google\Chrome\Application\chrome.exe)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

[X] Visual Studio - develop for Windows
    X Visual Studio not installed; this is necessary for Windows development.
      Download at https://visualstudio.microsoft.com/downloads/.
      Please install the "Desktop development with C++" workload, including all of its default components

[√] Android Studio (version 2021.2)
    • Android Studio at C:\Program Files\Android\Android Studio
    • 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
    • Java version OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840)

[√] Connected device (3 available)
    • Android SDK built for x86 64 (mobile) • emulator-5554 • android-x64    • Android 12 (API 31) (emulator)
    • Windows (desktop)                     • windows       • windows-x64    • Microsoft Windows [版本 10.0.19044.1645]
    • Edge (web)                            • edge          • web-javascript • Microsoft Edge 101.0.1210.39

[√] HTTP Host Availability
    • All required HTTP hosts are available

我的应用/构建.格拉德尔

android {
    compileSdkVersion flutter.compileSdkVersion

  defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId "com.example.flutter_application_3_vs"
        minSdkVersion flutter.minSdkVersion
        targetSdkVersion flutter.targetSdkVersion
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
    }

我在app/build中添加了这个.格雷德尔,但没用

 buildToolVersion "23.0.1"

java_home是在我使用vscode建立这个项目之前建立的

环境变量java_home

JAVA_HOME17:
D:\JDK\java\jdk-17.0.1

推荐答案

你有吗

defaultConfig {
  //add this line
    multiDexEnabled true
}
dependencies {
//add these lines
def multidex_version = "2.0.1"
implementation "androidx.multidex:multidex:$multidex_version"
}

2.判断以下内容或添加android/gradle.属性

org.gradle.jvmargs=-Xmx1536M
android.enableR8=true
android.useAndroidX=true
android.enableJetifier=true

Java相关问答推荐

Maven Google Sheets版本问题

当我用OkHttpClient重写shouldInterceptRequest来发布数据时,Android WebView正在以纯HTML加载URL内容

Mat. n_Delete()和Mat. n_release的区别

方法没有用正确的值填充数组—而是将数组保留为null,'

尽管类型擦除,instanceof与泛型在Java中如何工作?

在for—each循环中的AnimationTimer中的if语句'

根据对象和值的参数将映射<;T、值&>转换为列表<;T&>

将不受支持的时区UT重写为UTC是否节省?

SpringBoot+Java 17@Valid未验证POJO

如何在Microronaut中将 map 读取为 map

如何在Application.yaml中连接字符串?

如何在 spring 数据的MongoDB派生查询方法中使用$EXISTS

STREAMS减少部分结果的问题

在使用具有不同成本的谓词调用allMatch之前对Java流进行排序会带来什么好处吗?

如何在IntelliJ IDEA的Build.sbt中添加外部JAR文件?

Java类型推断:为什么要编译它?

获取401未经授权,即使在标头中设置了浏览器名称和cookie

简化每个元素本身都是 map 列表的列表

Cucumber中第二个网页的类对象未初始化

UuidGenerator Bean 类型不匹配?