Flutter APK build android 资源链接失败的震动包

Posted

技术标签:

【中文标题】Flutter APK build android 资源链接失败的震动包【英文标题】:Flutter APK build android resource linking failed vibrate package 【发布时间】:2020-09-18 01:16:08 【问题描述】:

我正在尝试为我的应用构建一个 apk,但我在 vibrate 包上遇到资源链接失败。 我可以在发布模式下运行我的应用程序,也可以构建一个应用程序包而不会失败。 两天前我已经做了一个成功的 apk 构建,自此构建以来我所做的更改: - 升级到 android Studio 4.0 - 运行 pub 缓存修复(由于现在解决了另一个错误)

我得到的错误:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':vibrate:verifyReleaseResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
   > Android resource linking failed
     C:\Users\plest\.gradle\caches\transforms-2\files-2.1\1aeb117cf01e0e03a347b2b45aacb6fb\core-1.1.0\res\values\values.xml:142:5-173:25: AAPT: error: resource android:attr/fontStyle not found.

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

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

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

     C:\Users\plest\.gradle\caches\transforms-2\files-2.1\1aeb117cf01e0e03a347b2b45aacb6fb\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 22s







Running Gradle task 'assembleRelease'...                           24,3s
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 cloud_firestore...
Running Gradle task 'assembleAarRelease'...                     
The plugin cloud_firestore could not be built due to the issue above.
Process finished with exit code 1

我的颤振医生很好,颤振清洁不会改变任何事情。 右键单击android面板时无法访问颤振面板。

编辑: 如果我以详细的方式运行,我会在我的日志中得到这个

[  +17 ms] > Task :vibrate:extractDebugAnnotations UP-TO-DATE
[   +1 ms] > Task :vibrate:mergeDebugGeneratedProguardFiles UP-TO-DATE
[   +1 ms] > Task :vibrate:mergeDebugConsumerProguardFiles UP-TO-DATE
[   +1 ms] > Task :vibrate:prepareLintJarForPublish UP-TO-DATE
[   +1 ms] > Task :vibrate:mergeDebugJavaResource UP-TO-DATE
[   +1 ms] > Task :vibrate:transformClassesAndResourcesWithSyncLibJarsForDebug UP-TO-DATE
[   +2 ms] > Task :vibrate:transformNativeLibsWithSyncJniLibsForDebug UP-TO-DATE
[   +1 ms] > Task :vibrate:bundleDebugAar UP-TO-DATE
[   +1 ms] > Task :vibrate:compileDebugSources UP-TO-DATE
[   +1 ms] > Task :vibrate:assembleDebug UP-TO-DATE
[ +253 ms] > Task :app:mergeDebugNativeLibs
[   +1 ms] Unable to strip library
'C:\Users\plest\StudioProjects\the_spot\build\app\intermediates\merged_native_libs\debug\out\lib\x86\libflutter.so' due to
missing strip tool for ABI 'X86'. Packaging it as is.
[  +97 ms] > Task :app:stripDebugDebugSymbols
[   +1 ms] Compatible side by side NDK version was not found.
[   +1 ms] Unable to strip library
'C:\Users\plest\StudioProjects\the_spot\build\app\intermediates\merged_native_libs\debug\out\lib\x86_64\libflutter.so' due
to missing strip tool for ABI 'X86_64'. Packaging it as is.

【问题讨论】:

【参考方案1】:

我解决了将 vibrate 0.0.4 升级到 flutter_vibrate 1.0.0 的问题

【讨论】:

以上是关于Flutter APK build android 资源链接失败的震动包的主要内容,如果未能解决你的问题,请参考以下文章

Flutter APK build android 资源链接失败的震动包

Flutter Build apk 错误

在 Flutter 中发布的“flutter build apk”出现错误

Flutter App Build apk报错但运行正确解决

Flutter build apk 有 bug 而 debug 完美

Flutter:build/app/outputs下的apk/release目录和flutter-apk目录有啥区别?