您好,我正在尝试为我的项目构建 Apk,但我遇到了这些错误,我尝试了互联网上的所有解决方案,但仍然无法正常工作……有什么想法吗?

Hello, I'm trying to build Apk for my project and I got these errors, I tried every solution on the internet but still not working.. any idea?

任务“:clipboard_manager:verifyReleaseResources”执行失败。

A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade Android resource linking failed C:\Users\zraed.gradle\caches\transforms-2\files-2.1ffd94dd4be5a0ccaa73c0d1aa53e0e\core-1.1.0\res\values\values.xml:142:5-173:25: AAPT: error: resource android:attr/fontVariationSettings not found.

 C:\Users\zraed\.gradle\caches\transforms-2\files-2.1ffd94dd4be5a0ccaa73c0d1aa53e0e\core-1.1.0\res\values\values.xml:142:5-173:25: AAPT: error: resource android:attr/ttcIndex not found.

SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.

您需要使用以下命令定义 sdk.dir

   flutter config --android-sdk <path-to-your-android-sdk-path>

或者您可以在项目的 Android 文件夹下创建一个 local.properties 文件。并添加以下行:

     sdk.dir=C:\Users\UserName\AppData\Local\Android\sdk

here 中有一篇关于此问题的博客。