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.
本文标签:
版权声明:本文标题:android - Type mismatch and unresolved reference errors in build.gradle.kts while building Flutter app - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741261165a2367649.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论