React-Native无法在构建时找到主项目文件

时间:2017-04-07 21:10:05

标签: javascript objective-c npm react-native cocoapods

最近在Cactapods中实现了一个React Native项目。现在RN在成功构建后抛出此错误....

enter image description here

在构建期间Xcode没有错误......但是Xcode给了我这些警告

enter image description here

对应的RCTUIManager.mhttps://pastebin.com/F7shCt8M

Xcode日志:

2017-04-07 14:06:59.714 [info][tid:main][RCTBatchedBridge.m:72] Initializing <RCTBatchedBridge: 0x6000001a5400> (parent: <RCTBridge: 0x6080000c50f0>, executor: RCTJSCExecutor)
2017-04-07 14:07:00.409 [error][tid:com.facebook.react.JavaScript] Native module cannot be null.
2017-04-07 14:07:00.414 [fatal][tid:com.facebook.react.ExceptionsManagerQueue] Unhandled JS Exception: Native module cannot be null.
2017-04-07 14:07:00.430 [error][tid:com.facebook.react.JavaScript] Requiring module "215", which threw an exception.
2017-04-07 14:07:00.435 [warn][tid:com.facebook.react.JavaScript] Unable to symbolicate stack trace: Native module cannot be null.
2017-04-07 14:07:00.436 [warn][tid:com.facebook.react.JavaScript] Unable to symbolicate stack trace: undefined is not a constructor (evaluating 'new XMLHttpRequest()')
2017-04-07 14:07:00.441 [fatal][tid:com.facebook.react.ExceptionsManagerQueue] Unhandled JS Exception: Requiring module "215", which threw an exception.
2017-04-07 14:07:00.533 [info][tid:main][RCTRootView.m:275] Running application zelosApp ({
    initialProps =     {
    };
    rootTag = 1;
})
2017-04-07 14:07:00.535 [error][tid:com.facebook.react.JavaScript] Module AppRegistry is not a registered callable module (calling runApplication)
2017-04-07 14:07:00.538 [warn][tid:com.facebook.react.JavaScript] Unable to symbolicate stack trace: undefined is not a constructor (evaluating 'new XMLHttpRequest()')
2017-04-07 14:07:00.539 [fatal][tid:com.facebook.react.ExceptionsManagerQueue] Unhandled JS Exception: Module AppRegistry is not a registered callable module (calling runApplication)

Podfilehttps://pastebin.com/CAqehNMZ

index.ios.jshttps://pastebin.com/j5nbaRaf

enter image description here

不确定这里有什么问题......有什么想法吗?

1 个答案:

答案 0 :(得分:1)

总结评论:与React相关的警告与React而不是您的项目无关。

该错误可能表示您尚未将本机库链接到项目。这应该使用react-native link完成。

最新react-native-maps组件(v0.14)的已知问题会导致react-native link之后的编译中断。有关解决方案,请参阅https://github.com/airbnb/react-native-maps/issues/1193

open AirMaps project inside Libraries folder
remove reference of RCTConvert+MapKit.h/m
add reference to RCTConvert+AirMap.h/m (from node_modules/react-native-maps/lib/ios/AirMaps)