Execution failed for task ':shared_preferences:verifyReleaseResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource linking failed
C:\Users\me\.gradle\caches\transforms-2\files-2.1\e9dab9c67c1ee3668e0bbf86c6d8cbd8\core-1.1.0\res\values\values.xml:142:5-173:25: AAPT: error: resource android:attr/fontVariationSettings not found.
C:\Users\me\.gradle\caches\transforms-2\files-2.1\e9dab9c67c1ee3668e0bbf86c6d8cbd8\core-1.1.0\res\values\values.xml:142:5-173:25: AAPT: error: resource android:attr/ttcIndex not found.
1、由于昨天还能成功build apk。期间迁移了androidX ,适配1.12的android api,首先怀疑是gradle问题
查gradle版本正常,5.4.1的zip包,build.gradle(project) classpath 3.5.3
2、AAPT: error: resource android:attr/fontVariationSettings not found
尝试在gradle.properties 添加 android.enableAapt2=false (昨天添加此句后能成功build) ————此处无用,throw exception明明说是AAPT,你弄Aapt2干嘛。Aapt2为Aapt的优化
3、拿第2点的关键字去搜索
https://github.com/flutter/flutter/issues/27226
https://github.com/flutter/flutter/issues/27106
提醒我要去看抛出异常的库包版本
4、去pub.dev 查看:shared_preferences:版本
更新到最新版本0.5.12+4
Success!