首页 > 解决方案 > 更新 React Native(至 0.59.10)后,Assemble Release 构建失败

问题描述

将我的 react-native 版本从 0.58.0 更新到 0.59.10 后,我遇到了 assmlbe 发布版本的问题。

  1. react-native run-ios作品

  2. iOS 构建(在 BuddyBuild 上)有效

  3. react-native run-android在模拟器上 - 工作

但是当我想获得发布构建并运行命令时cd android && ./gradlew assembleRelease- 构建失败。

我检查了链接,但我认为一切都正确链接。

我收到了这个错误:

> Task :react-native-fcm:verifyReleaseResources FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-fcm:verifyReleaseResources'.
> 1 exception was raised by workers:
  com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed
  /Users/myname/Documents/projects/my-project/node_modules/react-native-fcm/android/build/intermediates/res/merged/release/values/values.xml:1968: error: resource android:attr/fontVariationSettings not found.
  /Users/myname/Documents/projects/my-project/node_modules/react-native-fcm/android/build/intermediates/res/merged/release/values/values.xml:1968: error: resource android:attr/ttcIndex not found.
  error: failed linking references.

我能做些什么呢?

标签: androidreactjsreact-nativereact-native-androidreact-native-ios

解决方案


我更新react-native-fcm到版本 16.0.0。之后我做了这个命令:

rm -rf ios/Pods && rm -rf ios/build && cd ios && pod install

现在一切正常。


推荐阅读