react native笔记-个人记录-初始化工程遇到的问题

使用Expo工具

在mac上安装expo,如果是权限问题可以参考以下解决方法
https://blog.csdn.net/testcs_dn/article/details/78869419
https://jingyan.baidu.com/article/9c69d48ff88b3813c9024e9d.html

这是第二条链接的说明:对于Mac OS X 10.11 El Capitan用户,由于系统启用了SIP(System Integrity Protection), 导致root用户也 没有权限修改/usr/bin目录。按如下方式可恢复权限。
屏蔽方法:重启Mac,按住command+R,进入recovery模式。选择打开Utilities下的终端,输入:csrutil disable并回车,然后正常重启Mac即可。

报错: react native fsevents unavailable (this watcher can only be used on Darwin)

解决的办法参考链接
npm r -g watchman
brew install watchman
注意:这里我使用npm install watchman还是有问题的,但是换成brew安装后没有问题

react-native run-ios报错

Could not find iPhone 6 simulator参考链接

Command+shift+.可以显示/隐藏以"."开头的文件或者文件夹
解决 React-Native mac 运行报错 error Failed to build iOS project. We ran “xcodebuild” command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by ope

地址,如果按照以上的还有问题使用sudo跑下https://www.cnblogs.com/stevexu/archive/2019/04/21/10745769.html

如果显示像下面图片一样,但是模拟器没有安装程序,可能需要kill一下进程,下面的链接很详细的说明了各种情况

react-native run-ios遇到的问题说明:https://juejin.im/post/5ca2e560e51d456d3550dd5c

在这里插入图片描述

解决node.js - Node already installed, it’s just not linked

解决链接:http://www.itkeyword.com/doc/7125537006697543345/node-already-installed-its-just-not-linked

解决升级到Xcode10,react native项目运行报错问题

我遇到的错误是下面这个或者没有config.f的,**

这个链接很有用**

错误一:Xcode 10: Build input file double-conversion cannot be found
error: Build input file cannot be found: '../node_modules/react-native/third-party/double-conversion-1.1.6/src/strtod.cc'
configure: error: in `../node_modules/react-native/third-party/glog-0.3.4'

解决链接:https://blog.csdn.net/chensenp/article/details/83543724

完美解决:"library not found for - "

该文章提供了很多的解决方案:https://blog.csdn.net/liujia216/article/details/53112709
我也遇到了该问题,但是项目的这个库是别人封装的,所以我暂时是把该库移除了

React Native 日常报错 ‘config.h’ file not found

解决链接:https://blog.csdn.net/qq_28978893/article/details/78720488

修改模拟器
react-native run-ios --simulator "iPhone X" //iPhone X是需要使用的模拟器

真机调试链接

真机调试查看连接的设备
adb devices

注意:需要确保你的电脑和手机设备在同一个Wi-Fi环境下,要不然我的会出现闪退
真机调试修改和查看

把就项目放到android studio报错
Error:(24, 0) Could not find method implementation() for arguments [directory ‘libs’] on object of t

这种方式会有警告,告诉你compile过时了,你可以选择升级gradle,解决链接

Android Studio 报错:Could not find com.android.support:appcompat-v7:28.0.0-beta01.

加上google(),解决链接

AManifest merger failed : Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91 is also present at [androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory).Suggestion: add ‘tools:replace="android:appComponentFactory"’ to element at AndroidManifest.xml:5:5-20:19 to override.

解决链接
添加tools

android studio 历史版本下载地址

历史版本下载地址

android studio mac完全卸载

https://blog.csdn.net/elonspace/article/details/51800949

gradle各个版本下载

http://services.gradle.org/distributions/

Lint found fatal errors while assembling a release target. 问题的解决方案

https://www.jianshu.com/p/9a3d4dddfcb2

Android Studio编译报Couldn’t follow symbolic link错误
Could not list contents of '/Users/sunrifa/sendiWork/special_form_app_react_v2/node_modules/react-native/scripts/third-party/glog-0.3.5/test-driver'. Couldn't follow symbolic link.

https://www.jianshu.com/p/11a304b670e5

Error: EACCES: permission denied, mkdir 类的问题

https://stackoverflow.com/questions/49679808/error-eacces-permission-denied-mkdir-usr-local-lib-node-modules-node-sass-b

找不到资源,可能需要统一版本依赖
Android resource linking failed
error: resource android:style/TextAppearance.Material.Widget.Button.Borderless.Colored not found.
error: resource android:style/TextAppearance.Material.Widget.Button.Colored not found.
/Users/sunrifa/sendiWork/dr_reborn_app_react/android/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values-v26/values-v26.xml:7: error: resource android:attr/colorError not found.
/Users/sunrifa/sendiWork/dr_reborn_app_react/android/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values-v26/values-v26.xml:11: error: resource android:attr/colorError not found.
/Users/sunrifa/sendiWork/dr_reborn_app_react/android/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values-v26/values-v26.xml:15: error: style attribute ‘android:attr/keyboardNavigationCluster’ not found.
/Users/sunrifa/sendiWork/dr_reborn_app_react/android/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values-v28/values-v28.xml:7: error: resource android:attr/dialogCornerRadius not found.
/Users/sunrifa/sendiWork/dr_reborn_app_react/android/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values-v28/values-v28.xml:11: error: resource android:attr/dialogCornerRadius not found.
/Users/sunrifa/sendiWork/dr_reborn_app_react/android/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:2637: error: resource android:attr/fontStyle not found.
/Users/sunrifa/sendiWork/dr_reborn_app_react/android/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:2637: error: resource android:attr/font not found.
/Users/sunrifa/sendiWork/dr_reborn_app_react/android/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:2637: error: resource android:attr/fontWeight not found.
/Users/sunrifa/sendiWork/dr_reborn_app_react/android/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:2637: error: resource android:attr/fontVariationSettings not found.
/Users/sunrifa/sendiWork/dr_reborn_app_react/android/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:2637: error: resource android:attr/ttcIndex not found.
/Users/sunrifa/sendiWork/dr_reborn_app_react/android/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:2689: error: resource android:attr/startX not found.
/Users/sunrifa/sendiWork/dr_reborn_app_react/android/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:2689: error: resource android:attr/startY not found.
/Users/sunrifa/sendiWork/dr_reborn_app_react/android/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:2689: error: resource android:attr/endX not found.
/Users/sunrifa/sendiWork/dr_reborn_app_react/android/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:2689: error: resource android:attr/endY not found.
/Users/sunrifa/sendiWork/dr_reborn_app_react/android/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:2690: error: resource android:attr/offset not found.
error: failed linking references.

在这里插入图片描述

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.1.1'
    compile 'com.facebook.react:react-native:0.54.2'
    compile 'com.google.android.gms:play-services-gcm:11.0.4'
    compile 'me.leolin:ShortcutBadger:1.1.8@aar'
}

修改上面的三个值,保持依赖版本统一

Cannot add task ‘wrapper’ as a task with that name already exists

https://stackoverflow.com/questions/53709282/cannot-add-task-wrapper-as-a-task-with-that-name-already-exists

react-native-keychain: 错误: 找不到符号 符号: 类 StrongBoxUnavailableException

重新装下 yarn add react-native-keychain@3.0.0,装后打开报错的文件,发现代码少了报错的代码,不知是否是之前开发添加的

Invoke-customs are only supported starting with Android O (–min-api 26)

https://www.jianshu.com/p/434928537a90

React Native version mismatch 错误

https://blog.csdn.net/awy1988/article/details/80336913

有可能是你在跑两个react-native不同的版本时也会有这个问题

特批项目

升级gradle为3.4.1
重新安装react-native-keychain,解决找不到类的问题
升级video为4.1.0
修改react-native-device-info的依赖包中的play-services-gcm的版本为15.0.1

react-native run-ios命令失败(PCH问题),但是在xcode中构建成功

http://www.voidcn.com/article/p-owrbmtsz-btr.html
把项目根目录下的ios/build目录删除,重新构建

Error: Duplicate resources

https://stackoverflow.com/questions/47084810/react-native-android-duplicate-file-error-when-generating-apk/49589616#49589616
需要修改react-native/react.gradle,暂时使用了该解决方案,需要修改node_modules里的模块不好

个人证书打包ios教程

https://www.jianshu.com/p/924e2a0d2236
本人没试过,记录下,有需要再用

调试react-native跨域问题

在chrome商店下载扩展 Allow-Control-Allow-Origin: *

mysql错误:[Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated

解决链接

有时react-native编译ios会出现一些问题,一般处理是删除项目下ios的build目录、关闭终端和模拟器重新跑、还有这个地址
链接器命令失败,退出代码1(使用-v查看调用)在xcode 10和ld:找不到-lFirebaseCore库

https://www.soinside.com/question/U6dwRm6i5m89d2BABGJ7fL

如果没有手动的react-native软件包 #18472, iOS main.jsbundle将不会自动创建或更新

https://translate.google.com/translate?hl=zh-CN&sl=en&u=https://github.com/facebook/react-native/issues/18472&prev=search

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值