使用keyboard_visibility第三方,flutter build apk报错

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':keyboard_visibility:verifyReleaseResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
   > 1 exception was raised by workers:
     com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed
     C:\Users\Administrator\.gradle\caches\transforms-2\files-2.1\da95e0dd41fd0c634661df2a0f122634\core-1.1.0\res\values\values.xml:142:5-173:25: AAPT: error: resource android:attr/fontVariationSettings not found.

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

使用AndroidStudio打开根目录,在左侧Project最下方的External Libraries里面中的Flutter Plugins中,找到keyboard_visibility这个插件的build.gradle,然后把compileSdkVersion修改为和你的主项目中的compileSdkVersion版本一致,重新运行flutter build apk即可

使用keyboard_visibility第三方,flutter build apk报错_第1张图片
image.png

你可能感兴趣的:(使用keyboard_visibility第三方,flutter build apk报错)