我在this guide之后的现有项目中设置了React Native.我能够使用以下内容成功呈现我的React Native视图:
>在项目根目录中:(Js_DIR = pwd / Js; cd node_modules / react-native; npm run start – –root $Js_DIR)
>在Xcode中构建并运行项目
但是,一旦模拟器运行,我就无法使用命令r重新加载JavaScript,也无法使用命令控件z来显示开发人员工具.
我没有使用react-native init< Projectname>创建项目.我正在将React Native添加到现有的Swift项目中.我没有使用react-native run-ios,因为它会抛出以下错误:
** BUILD Failed **The following build commands Failed: CompileC /Users/username/Sites/iOS/project-name/build/Build/Intermediates/Pods.build/Local-iphonesimulator/FXBlurVIEw.build/Objects-normal/x86_64/FXBlurVIEw.o FXBlurVIEw/FXBlurVIEw/FXBlurVIEw.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler CompileC /Users/username/Sites/iOS/project-name/build/Build/Intermediates/Pods.build/Local-iphonesimulator/FXBlurVIEw.build/Objects-normal/i386/FXBlurVIEw.o FXBlurVIEw/FXBlurVIEw/FXBlurVIEw.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler CompileC /Users/username/Sites/iOS/project-name/build/Build/Intermediates/Pods.build/Local-iphonesimulator/FXBlurVIEw.build/Objects-normal/x86_64/FXBlurVIEw-dummy.o Target\ Support\ files/FXBlurVIEw/FXBlurVIEw-dummy.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler CompileC /Users/username/Sites/iOS/project-name/build/Build/Intermediates/Pods.build/Local-iphonesimulator/FXBlurVIEw.build/Objects-normal/i386/FXBlurVIEw-dummy.o Target\ Support\ files/FXBlurVIEw/FXBlurVIEw-dummy.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler(4 failures)Installing build/Build/Products/DeBUG-iphonesimulator/Projectname.appAn error was encountered processing the command (domain=NSPOSIXErrorDomain,code=2):Failed to install the requested applicationAn application bundle was not found at the provIDed path.ProvIDe a valID path to the desired application bundle.Print: Entry,":CFBundleIDentifIEr",Does Not Exist/Users/username/Sites/iOS/project-name/node_modules/promise/lib/done.Js:10 throw err; ^Error: Command Failed: /usr/libexec/PListBuddy -c Print:CFBundleIDentifIEr build/Build/Products/DeBUG-iphonesimulator/Projectname.app/Info.pListPrint: Entry,Does Not Exist at checkExecSyncError (child_process.Js:464:13) at Object.execfileSync (child_process.Js:484:13) at _runIOS (runIOS.Js:91:34) at runIOS.Js:24:5 at tryCallTwo (/Users/username/Sites/iOS/project-name/node_modules/promise/lib/core.Js:45:5) at doResolve (/Users/username/Sites/iOS/project-name/node_modules/promise/lib/core.Js:200:13) at new Promise (/Users/username/Sites/iOS/project-name/node_modules/promise/lib/core.Js:66:3) at Array.runIOS (runIOS.Js:23:10) at Object.run (/Users/username/Sites/iOS/project-name/node_modules/react-native/local-cli/cli.Js:86:13) at Object.<anonymous> (/Users/username/.nvm/versions/node/v4.2.4/lib/node_modules/react-native-cli/index.Js:88:7)
我应该寻求什么来重新加载和开发人员工具能力?
解决方法 如果您有自定义配置并且您正在使用Cocoapods,请确保Podfile指定这些配置应该是调试配置.默认情况下,它们被假定为发布配置.将以下行添加到Podfile的顶部(假设您的自定义配置是“Dev”,“Local”和“Staging”):对于1.0之前的Cocoapods使用xcodeproj
:
xcodeproj 'MyProject','Dev' => :deBUG,'Local' => :deBUG,'Staging' => :deBUG
对于Cocoapods 1.0使用project
:
project 'MyProject','Staging' => :deBUG
然后,要更新Pods.xcodeproj文件:
rm -rf Pods/pod install
这将确保为Pods项目的那些配置设置DEBUG = 1预处理器宏.
总结以上是内存溢出为你收集整理的ios – React Native Reload和Dev Tools不起作用全部内容,希望文章能够帮你解决ios – React Native Reload和Dev Tools不起作用所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)