admin管理员组

文章数量:1276665

I am working on a Flutter application and trying to build it for Android. However, I encountered a Gradle build error related to my build.gradle.kts file. The error messages indicate type mismatches and unresolved references. Here are the details:

Launching lib/main.dart on sdk gphone64 x86 64 in debug mode...
e: file:///home/user/myapp/android/app/build.gradle.kts:45:33: Type mismatch: inferred type is Unit but Boolean was expected
e: file:///home/user/myapp/android/app/build.gradle.kts:49:17: Expected a value of type Boolean
e: file:///home/user/myapp/android/app/build.gradle.kts:49:74: Unresolved reference: outputFileName
FAILURE: Build failed with an exception.
* Where:
Build file '/home/user/myapp/android/app/build.gradle.kts' line: 45
* What went wrong:
Script compilation errors:
  Line 45:             variant.outputs.all {
                                           ^ Type mismatch: inferred type is Unit but Boolean was expected
  Line 49:                 (this as com.android.build.gradle.api.BaseVariantOutput).outputFileName = outputFileName
                           ^ Expected a value of type Boolean
  Line 49:                 (this as com.android.build.gradle.api.BaseVariantOutput).outputFileName = outputFileName
                                                                                    ^ Unresolved reference: outputFileName
3 errors
* 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 .
BUILD FAILED in 3s
Running Gradle task 'assembleDebug'...                              3.3s
Error: Gradle task assembleDebug failed with exit code 1

Expected Behavior: The Gradle build should complete successfully, and the Flutter app should launch on the emulator.

Actual Behavior: The build fails with the above errors, and the app does not launch.

本文标签: