Android原生项目引入最新的React Native包
16lz
2021-12-11
做一个记录,解决androidstudio无法下载最新的React Native问题
在你的 android/app/build.gradle添加代码
compile 'com.facebook.react:react-native:'
然后在android/build.gradle文件里面添加
allprojects { repositories { mavenLocal() jcenter() maven { // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm //********这里必须写对应的目录,否则找不到本地node_modules下面的包 url "$rootDir/../node_modules/react-native/android" } } configurations.all { resolutionStrategy { eachDependency { DependencyResolveDetails details -> if (details.requested.group == 'com.facebook.react' && details.requested.name == 'react-native') { details.useVersion "" } } } }}
更多相关文章
- android post提交数据到web端
- Caused by: com.android.builder.dexing.DexArchiveBuilderExcep
- Android(安卓)Uri
- android应用去掉title bar
- Android(安卓)Studio(十):添加assets目录
- Android(安卓)WebView加载H5音视频自动播放、关闭Activity停止播
- Android横竖屏加载不同布局的适配方案
- Android地图添加标记和文字【代码片段】
- 错误 'roundIcon' in package 'android'