【问题标题】:Gradle task assembleDebug failed with exit code 1 in flutter upgradeGradle 任务 assembleDebug 在颤振升级中失败,退出代码为 1
【发布时间】:2022-07-19 15:15:15
【问题描述】:

我升级了颤振,但之后我无法运行我的代码并查看结果 这是我的代码。我也想使用音频播放器包,但它对我不起作用。 更改 SDK 版本也没有用。

import 'package:flutter/material.dart';

void main() => runApp(XylophoneApp());

class XylophoneApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: SafeArea(
          child: Center(
            child:TextButton
              (onPressed: (){


              },
             child:Text('Click Me')),
          ),
        ),
      ),
    );
  }
}

这是我无法解决的错误

Running "flutter pub get" in tessssssssssssssst...
Launching lib\main.dart on AOSP on IA Emulator in debug mode...
Running Gradle task 'assembleDebug'...

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction
   > One or more issues found when checking AAR metadata values:

     Dependency 'androidx.core:core:1.9.0-alpha05' requires 'compileSdkVersion' to be set to 32 or higher.
     Compilation target for module ':app' is 'android-31'

     Dependency 'androidx.core:core-ktx:1.9.0-alpha05' requires 'compileSdkVersion' to be set to 32 or higher.
     Compilation target for module ':app' is 'android-31'

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

【问题讨论】:

    标签: android flutter gradle


    【解决方案1】:

    在你的

    android/app/build.gradle

    compileSdkVersion 更改为 32

    【讨论】:

      猜你喜欢
      • 2020-03-08
      • 2021-06-13
      • 2021-06-24
      • 2019-11-05
      • 2021-06-24
      • 2020-09-19
      • 2020-10-31
      • 2021-06-30
      • 1970-01-01
      相关资源
      最近更新 更多