菜鸟教程小白 发表于 2022-12-11 17:26:17

ios - 你如何调试 React Native iOS 中的链接错误?


                                            <p><p>例如 RCTImageLoader 未定义:</p>

<p> <a href="/image/WuZGM.png" rel="noreferrer noopener nofollow"><img src="/image/WuZGM.png" alt="enter image description here"/></a> </p>

<p>它是 RN 中图像库的一部分:</p>

<p> <a href="/image/5KYaf.png" rel="noreferrer noopener nofollow"><img src="/image/5KYaf.png" alt="enter image description here"/></a> </p>

<p>我的 <code>Podfile</code> 中有这个:</p>

<p>在我的 Podfile 中有这一行:<code>pod 'React', :subspecs => ['Core', 'RCTImage', 'RCTNetwork', 'RCTLinkingIOS', 'RCTText', 'RCTWebSocket'], :path => '../node_modules/react-native'</code></p>

<p>这是我的库:
<a href="/image/SAQMH.png" rel="noreferrer noopener nofollow"><img src="/image/SAQMH.png" alt="enter image description here"/></a> </p>

<p>我试过了:</p>

<ul>
<li>项目 -> 清理</li>
<li>再次运行 <code>pod install</code></li>
<li>删除 <code>Podfile.lock</code> && <code>pod install</code></li>
<li>新鲜的 git 克隆,<code>npm install && cd ios && pod install</code></li>
</ul></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>您也可以尝试手动添加头文件,例如 <code>../node_modules/react-native/Libraries/Image/RCTImageLoader.h</code>。 </p>

<p>但在我的情况下,这并没有帮助。解决方案是打开 <code>MyProject.xcworkspace</code> 而不是 <code>MyProject.xcproject</code></p></p>
                                   
                                                <p style="font-size: 20px;">关于ios - 你如何调试 React Native iOS 中的链接错误?,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/39310473/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/39310473/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - 你如何调试 React Native iOS 中的链接错误?