将我的本机版本从0.58.0更新到0.59.10之后,我对assemlbe发行版有疑问。
react-native run-ios
有效
iOS构建(在BuddyBuild上)有效
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.
对此我该怎么办?
答案 0 :(得分:0)
我将react-native-fcm
更新为版本16.0.0。之后,我执行了以下命令:
rm -rf ios/Pods && rm -rf ios/build && cd ios && pod install
现在一切正常。
答案 1 :(得分:0)
尝试
cd android && ./gradlew clean && cd .. && ./gradlew assembleRelease
希望如此会有所帮助