首页 > 解决方案 > Flutter Build APK:失败 - 任务“:keyboard_visibility:verifyReleaseResources”执行失败

问题描述

更新颤振或 android studio 后,我面临一个奇怪的问题。我之前能够运行 flutter build apk 命令。但我可以为同一应用程序的 iOS 版本导出 ipa。

我已经更新了最新版本的软件包。检查“compilesdkversion 28”。我认为一切看起来都不错。

你可以在下面看到我失败的包。

这是错误输出;

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
   > Android resource linking failed                                    
     /Users/serkanerkan/.gradle/caches/transforms-2/files-2.1/a528b13ac93e64cafa3d0480e2c93207/core-1.1.0/res/values/values.xml:142:5-173:25: AAPT: error: resource android:attr/fontVariationSettings not found.
                                                                        
     /Users/serkanerkan/.gradle/caches/transforms-2/files-2.1/a528b13ac93e64cafa3d0480e2c93207/core-1.1.0/res/values/values.xml:142:5-173: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 16s                                                     
Running Gradle task 'assembleRelease'...                                
Running Gradle task 'assembleRelease'... Done                      17.8s
The built failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using Jetfier to solve the incompatibility.
Building plugin connectivity...
Running Gradle task 'assembleAarRelease'...                             
Running Gradle task 'assembleAarRelease'... Done                 1,391ms


FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'connectivity'.
> SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.

* 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 1s


The plugin connectivity could not be built due to the issue above.

标签: flutter

解决方案


转到这个文件夹-> C:\flutter.pub-cache\hosted\pub.dartlang.org\keyboard_visibility-0.5.6\android 打开 build.gradle 将 compileSdkVersion 27 更改为 compileSdkVersion 28 然后 flutter clean -> flutter pub get - > 颤振构建 apk --release


推荐阅读