博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
react-native启动开发常见错误(持续更新)
阅读量:6003 次
发布时间:2019-06-20

本文共 2844 字,大约阅读时间需要 9 分钟。

react-native启动开发常见错误(持续更新)

1. debug error: make directory ... File exists

error: make directory /Users/mobilewise/Library/Developer/Xcode/DerivedData/MCDM-epoyegaizqaljifbmfuxvovvwxqn/Build/Products/Debug-iphoneos/MCDM_guangzhoudianwang.app/mapapi.bundle/images: File existserror: couldn't remove '/Users/mobilewise/Library/Developer/Xcode/DerivedData/MCDM-epoyegaizqaljifbmfuxvovvwxqn/Build/Products/Debug-iphoneos/MCDM_guangzhoudianwang.app/mapapi.bundle' after command failed: Directory not empty

解决方案:

`Build Phases--->>Copy Bundle Resources,
删除多余的文件即可 .`, 类似的缺少打包后存放目录的文件件等, 新建文件夹即可。

2. iOS开发 Build operation failed without specifying any errors 问题fix

xcode报错如下:

verify final result code for completed build operationBuild operation failed without specifying any errors. Individual build tasks may have failed for unknown reasons.One possible cause is if there are too many (possibly zombie) processes; in this case, rebooting may fix the problem.Some individual build task failures (up to 12) may be listed below.

解决方案如下:

是由于cocoapods版本导致, 重新安装即可:

//删除1.4.0包sudo gem uninstall cocoapods -v 1.4.0//然后安装指定版本的Cocoapodssudo gem install cocoapods -v 1.3.1//检查版本pod --version

3. 项目地址改变后出现问题

Argument list too long: recursive header expansion failed at

解决方案:Build Settings -> User Header Search Paths 删除其中内容

4. 安卓打包报错

':app:bundleReleaseJsAndAssets FAILED'

解决方案: ./gradlew assembleRelease -x bundleReleaseJsAndAssets

5. 安卓打包报错

Execution failed for task ':app:transformClassesAndResourcesWithProguardForRelease

解决方案:add the below to your ProGuard rules
`
-ignorewarnings

-keep class * {

public private *;

}

`

6. 安卓模拟器debbuger报错

CORS issue with JS Remote Debugging when using xip.io

解决办法https://github.com/facebook/react-native/issues/17618

7. 安卓webview无法返回数据

react native android webview onmessage not working

解决方案:

// 方案1if (window.postMessage.length !== 1) {  window.postMessage = function(msg) {    setTimeout(function () {      console.log('window.postMessage not ready')      window.postMessage(msg);    }, 500);  }}// 方案2function waitForBridge() {   //the react native postMessage has only 1 parameter   //while the default one has 2, so check the signature   //of the function   if (window.postMessage.length !== 1){     setTimeout(waitForBridge, 200);   }   else {     window.postMessage('abc');   }}window.onload = waitForBridge;

参考

8. Xcode 10 的一些错误

错误:third-party: 'config.h' file not found

错误:'config.h' file not found

错误: libfishhook.a cannot be found

错误: `React/RCTBridgeModule.h file not found`

9. iOS编译报错duplicate symbol _OBJC_CLASS_$_RCTFrameAnimation

dfile:

图片描述
图片描述
参考:

10. ios启动报错

The request was denied by service delegate (SBMainWorkspace) for reason: Security ("Entitlement "com.apple.frontboard.debugapplications" required to launch applications for debugging").

解决方案:
删除以下文件夹所有内容:/Users/xx/资源库/Developer/CoreSimulator/Devices/
参考:

转载地址:http://cxdmx.baihongyu.com/

你可能感兴趣的文章
Samba 系列(七):在 Samba AD DC 服务器上创建共享目录并映射到 Windows/Linux 客户...
查看>>
The Joy of Clojure – Clojure philosophy(1)
查看>>
Apache Storm 官方文档 —— 多语言接口协议
查看>>
在 Linux/UNIX 终端下使用 nload 实时监控网络流量和带宽使用
查看>>
小白学数据:一文看懂NoSQL数据库
查看>>
Android开发切换host应用
查看>>
SCALA中的函数式编程
查看>>
阿里云ApsaraDB RDS用户 - OLAP最佳实践
查看>>
swing 进度条
查看>>
从Objective-C到Swift,你必须会的(三)init的顺序
查看>>
UML之状态图
查看>>
Webwork 学习之路(七)文件上传下载
查看>>
Mac使用Apache
查看>>
strut 多文件上传
查看>>
揭秘阿里巴巴智能语音交互技术
查看>>
【转载】MySQL客户端服务器协议
查看>>
【Android】android镜像翻转
查看>>
Java 从Jar文件中动态加载类
查看>>
菜鸟学Linux命令:Chmod命令和数字文件权限
查看>>
设置AFNetworking网络请求的超时时间
查看>>