Flutter Build APK:任务':speech_recognition:verifyReleaseResources'的执行失败

时间:2019-11-30 07:31:39

标签: android flutter build speech-recognition release

大家。 我在flutter中将apk作为发行方法存在一些问题。 我真的不知道为什么这有错误。 这是指https://github.com/rxlabz/speech_recognition/tree/master/example

在构建为发布方法期间,出现了以下问题。

FAILURE: Build failed with an exception.                                                                           

* What went wrong:                                                                                                 
Execution failed for task ':speech_recognition:verifyReleaseResources'.                                            
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade                  
   > Android resource linking failed                                                                               
     /Users/kk/.gradle/caches/transforms-2/files-2.1/0a271e99b6771ad4a84318244d532fb7/core-1.0.0/res/values/values.xml:57:5-88:25: AAPT: error: resource android:attr/fontStyle not found.

     /Users/kk/.gradle/caches/transforms-2/files-2.1/0a271e99b6771ad4a84318244d532fb7/core-1.0.0/res/values/values.xml:57:5-88:25: AAPT: error: resource android:attr/font not found.

     /Users/kk/.gradle/caches/transforms-2/files-2.1/0a271e99b6771ad4a84318244d532fb7/core-1.0.0/res/values/values.xml:57:5-88:25: AAPT: error: resource android:attr/fontWeight not found.

     /Users/kk/.gradle/caches/transforms-2/files-2.1/0a271e99b6771ad4a84318244d532fb7/core-1.0.0/res/values/values.xml:57:5-88:25: AAPT: error: resource android:attr/fontVariationSettings not found.

     /Users/kk/.gradle/caches/transforms-2/files-2.1/0a271e99b6771ad4a84318244d532fb7/core-1.0.0/res/values/values.xml:57:5-88:25: AAPT: error: resource android:attr/ttcIndex not found.


* 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 3m 45s         

1 个答案:

答案 0 :(得分:2)

我知道,答案可能为时已晚,但是无论如何,这是一个令人讨厌的问题-我现在遇到了同样的问题,并花了几个小时与之抗争。

最后,解决方法是手动在lib的Android文件夹中的build.gradle中将“ compileSdkVersion”属性从25更改为28,之后我设法编译了该项目。