执行 ./gradlew assembleRelease打APK包,报错 Android resource linking failed

来源:14-6 打包发布React Native项目【收获果实】

白昔月

2019-02-25

执行./gradlew assembleRelease打APK包,报错 Android resource linking failed,前去google查找问题解决方案,多半是让我调整版本的,结果都不起效果,请老师帮着看看

Execution failed for task ‘:react-native-os:verifyReleaseResources’.

java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed
Output: error: resource android:style/TextAppearance.Material.Widget.Button.Borderless.Colored not found.
error: resource android:style/TextAppearance.Material.Widget.Button.Colored not found.
/Users/freyazhang/thumbpocket/node_modules/react-native-os/android/build/intermediates/res/merged/release/values-v26/values-v26.xml:7: error: resource android:attr/colorError not found.
/Users/freyazhang/thumbpocket/node_modules/react-native-os/android/build/intermediates/res/merged/release/values-v26/values-v26.xml:11: error: resource android:attr/colorError not found.
/Users/freyazhang/thumbpocket/node_modules/react-native-os/android/build/intermediates/res/merged/release/values-v26/values-v26.xml:15: error: style attribute ‘android:attr/keyboardNavigationCluster’ not found.
/Users/freyazhang/thumbpocket/node_modules/react-native-os/android/build/intermediates/res/merged/release/values/values.xml:226: error: resource android:attr/fontStyle not found.
/Users/freyazhang/thumbpocket/node_modules/react-native-os/android/build/intermediates/res/merged/release/values/values.xml:226: error: resource android:attr/font not found.
/Users/freyazhang/thumbpocket/node_modules/react-native-os/android/build/intermediates/res/merged/release/values/values.xml:226: error: resource android:attr/fontWeight not found.
error: failed linking references.

写回答

1回答

白昔月

提问者

2019-02-25

问题已经解决,报错原因是在react-native-os包中存在版本不一致的地方,修改react-native-os包中build.gradle对于的版本字段即可。

0
1
CrazyCodeBoy
总结的不错,老师为你点赞
2019-02-25
共1条回复

RN入门到进阶,打造高质量上线App

解锁React Native开发应用新姿势,React Native新版本热门技术

3144 学习 · 3241 问题

查看课程