我正在创建一个 Flutter 应用程序,当我运行我的代码时,我收到此错误消息:
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
Try the new cross-platform PowerShell https://aka.ms/pscore6
PS C:\Users\aayus\OneDrive\Desktop\MYP 5\IB Unit ICT\flutter app buddy\flutter_application_buddy> & 'c:\Users\aayus\OneDrive\Desktop\MYP 5\IB Unit ICT\flutter app buddy\flutter_application_buddy\lib\main.dart'
PS C:\Users\aayus\OneDrive\Desktop\MYP 5\IB Unit ICT\flutter app buddy\flutter_application_buddy> flutter run
Launching lib\main.dart on AC2001 in debug mode...
Parameter format not correct -
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource linking failed
AAPT: error: failed to open APK: Invalid file.
* 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 14s
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done 15.3s
Exception: Gradle task assembleDebug failed with exit code 1
PS C:\Users\aayus\OneDrive\Desktop\MYP 5\IB Unit ICT\flutter app buddy\flutter_application_buddy>
有人可以指导我并帮助我解决这个错误吗?
答案 0 :(得分:1)
您是否手动将 Flutter 项目迁移到 AndroidX?如果是,我建议检查 compileSdkVersion
并确保它至少设置为 28。这个问题似乎与这个 GitHub issue thread 类似。