reactnativecn / react-native-website

React Native 中文网
https://reactnative.cn
MIT License
216 stars 327 forks source link

22年11月4日后安卓编译出错的问题 #660

Closed sunnylqm closed 11 months ago

sunnylqm commented 1 year ago

官方发布 0.71-rc.0 版本时候手误,导致 0.71 以下版本编译安卓可能都会遇到问题,解决方案如下


0.63 及以上版本直接更新到最新小版本:

🛳️ 0.70.5: https://github.com/facebook/react-native/releases/tag/v0.70.5 🛳️ 0.69.7: https://github.com/facebook/react-native/releases/tag/v0.69.7 🛳 0.68.5: https://github.com/facebook/react-native/releases/tag/v0.68.5 🛳️ 0.67.5: https://github.com/facebook/react-native/releases/tag/v0.67.5 🛳️ 0.66.5: https://github.com/facebook/react-native/releases/tag/v0.66.5 🛳️ 0.65.3: https://github.com/facebook/react-native/releases/tag/v0.65.3 🛳️ 0.64.4: https://github.com/facebook/react-native/releases/tag/v0.64.4 🛳️ 0.63.5: https://github.com/facebook/react-native/releases/tag/v0.63.5


0.63 以下编辑 android/build.gralde 文件,添加如下绿色部分

+def REACT_NATIVE_VERSION = new File(['node', '--print',"JSON.parse(require('fs').readFileSync(require.resolve('react-native/package.json'), 'utf-8')).version"].execute(null, rootDir).text.trim())

allprojects {
+    configurations.all {
+        resolutionStrategy {
+            // Remove this override in 0.63+, as a proper fix is included in react-native itself.
+            force "com.facebook.react:react-native:" + REACT_NATIVE_VERSION
+        }
+    }

原链接:

https://github.com/facebook/react-native/issues/35210

helloyan commented 1 year ago

浪费了一个美好的周末搞这事,幸好今早搜到了这个帖子

gxl244642529 commented 1 year ago

按上述步骤修改后出现 No interface method pushMap(Lcom/facebook/react/bridge/ReadableMap;)V in class Lcom/facebook/react/bridge/WritableArray;

18308412919 commented 1 year ago

这也太坑了,搞了一天,还好来git逛了逛

zhangxiang1008 commented 1 year ago

真坑爹啊,我说咋回事。

weiweishadow commented 1 year ago

0.61.5 error Unexpected token ':'.Expected a ')' or a ',' after a parameter declaration

no stack

no stack

WDianxin commented 1 year ago

感谢!👍🏻👍🏻

qsjh898 commented 1 year ago

0.61.5 error Unexpected token ':'.Expected a ')' or a ',' after a parameter declaration

no stack

no stack

解决了吗这个问题?

github-actions[bot] commented 11 months ago

👋 Hey there, it looks like there has been no activity on this issue in the last 90 days. Has the issue been fixed, or does it still require the community attention? This issue will be closed in the next 7 days if no further activity occurs. Thank you for your contributions.