菜鸟教程小白 发表于 2022-12-13 05:24:52

ios - 架构 i386 的 undefined symbol - 来自 podfile 的所有项目


                                            <p><p>我收到以下关于 Restkit 的错误,但是 reskit 是使用 cocoapods 添加的。我尝试了很多解决方案,但似乎找不到正确的解决方案。有谁知道我做错了什么? </p>

<p>错误信息:</p>

<pre><code>ld: warning: directory not found for option &#39;-L/Users/ME/Documents/proj&#39;
    ld: warning: directory not found for option &#39;-Lcopy/projIOSProjectNew/projIOSWorkspace/projIOSCore/build/Debug-iphoneos&#39;
    ld: warning: directory not found for option &#39;-Ldev&#39;
    ld: warning: directory not found for option &#39;-Lnewest/projIOSProjectNew/projIOSWorkspace/Pods/build/Debug-iphoneos&#39;
    Undefined symbols for architecture i386:
      &#34;_AFNetworkingOperationDidFinishNotification&#34;, referenced from:
          - in libPods-projIOSCore-RestKit.a(RKObjectRequestOperation.o)
      &#34;_AFNetworkingOperationDidStartNotification&#34;, referenced from:
          - in libPods-projIOSCore-RestKit.a(RKObjectRequestOperation.o)
      &#34;_AFNetworkingOperationFailingURLRequestErrorKey&#34;, referenced from:
          - in libPods-projIOSCore-RestKit.a(RKHTTPRequestOperation.o)
      &#34;_AFNetworkingOperationFailingURLResponseErrorKey&#34;, referenced from:
          - in libPods-projIOSCore-RestKit.a(RKHTTPRequestOperation.o)
      &#34;_OBJC_CLASS_$_AFHTTPClient&#34;, referenced from:
          objc-class-ref in libPods-PROJIOSCore-RestKit.a(RKObjectManager.o)
      &#34;_OBJC_CLASS_$_AFHTTPRequestOperation&#34;, referenced from:
          objc-class-ref in libPods-PROJIOSCore-RestKit.a(RKHTTPRequestOperation.o)
          _OBJC_CLASS_$_RKHTTPRequestOperation in libPods-projIOSCore-RestKit.a(RKHTTPRequestOperation.o)
          objc-class-ref in libPods-PROJIOSCore-RestKit.a(RKObjectRequestOperation.o)
      &#34;_OBJC_CLASS_$_AFJSONRequestOperation&#34;, referenced from:
          objc-class-ref in libPods-projIOSCore-RestKit.a(RKObjectManager.o)
      &#34;_OBJC_CLASS_$_AFNetworkActivityIndicatorManager&#34;, referenced from:
          objc-class-ref in libPods-projIOSCore-RestKit.a(RKObjectRequestOperation.o)
</code></pre>

<p>编辑:我还收到以下警告,这是丢失的文件。</p>

<pre><code>d: warning: ld: warning: ld: warning: ignoring file /Users/ME/Library/Developer/Xcode/DerivedData/MYWORKSPACE-bceskqnbpsdarjfijbrjozdfciem/Build/Products/Debug-iphonesimulator/libPods-RewoIOSCore-ISO8601DateFormatterValueTransformer.a, file was built for archive which is not the architecture being linked (i386):
</code></pre>

<p>Podfile 如下所示:</p>

<pre><code>    workspace &#39;projIOSWorkspace.xcworkspace&#39;
xcodeproj &#39;projIOSCore/projIOSCore.xcodeproj&#39;
xcodeproj &#39;projIOS2Project/projIOS2Project.xcodeproj&#39;
xcodeproj &#39;projmobileiosproject/projIOSProject.xcodeproj&#39;


#source &#39;https://github.com/CocoaPods/Specs.git&#39;

target :projIOSCoredo
    platform :ios, &#39;8.0&#39;

    pod &#39;RestKit&#39;, &#39;~&gt; 0.24.0&#39;

    xcodeproj &#39;projIOSCore/projIOSCore.xcodeproj&#39;
end


target :projIOS2Project do
    platform :ios, &#39;8.0&#39;

    pod &#39;RestKit&#39;, &#39;~&gt; 0.24.0&#39;

    # Include optional Testing and Search components
    pod &#39;RestKit/Testing&#39;
    pod &#39;RestKit/Search&#39;
    pod &#39;FMDB&#39;
    pod &#39;ZBarSDK&#39;, &#39;~&gt; 1.3&#39;
    pod &#39;MZFormSheetController&#39;, &#39;~&gt; 2.3&#39;
    pod &#39;CTCheckbox&#39;, &#39;~&gt; 0.0&#39;
    pod &#39;MGSwipeTableCell&#39;, &#39;~&gt; 1.1.1&#39;
    pod &#39;FormatterKit&#39;, &#39;~&gt; 1.7&#39;
    pod &#39;TSMessages&#39;
    pod &#39;DLAlertView&#39;, &#39;~&gt;1.2.4&#39;
    pod &#39;SIAlertView&#39;, &#39;~&gt; 1.3&#39;
    pod &#39;MBProgressHUD&#39;, &#39;~&gt; 0.8&#39;

    xcodeproj &#39;projIOS2Project/projIOS2Project.xcodeproj&#39;
end

target :projIOSProject do
    platform :ios, &#39;8.0&#39;

    pod &#39;RestKit&#39;, &#39;~&gt; 0.24.0&#39;

    # Include optional Testing and Search components
    pod &#39;FMDB&#39;
    pod &#39;ZBarSDK&#39;, &#39;~&gt; 1.3&#39;
    pod &#39;AFPopupView&#39;, &#39;~&gt; 1.0&#39;
    pod &#39;PubNub&#39;, &#39;3.6.1&#39;
    pod &#39;ChameleonFramework&#39;
    pod &#39;SGActionView&#39;, &#39;~&gt; 0.0&#39;
    pod &#39;RXPromise&#39;, &#39;~&gt; 0.13&#39;
    pod &#39;SWTableViewCell&#39;, &#39;~&gt; 0.3.6&#39;
    pod &#39;UIAlertView+Blocks&#39;
    pod &#39;CNPPopupController&#39;

    xcodeproj &#39;projmobileiosproject/projIOSProject.xcodeproj&#39;
end
</code></pre></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>如果事情最终变得一团糟,我会尝试使用以下步骤重新安装您的 CocoaPods 依赖项:</p>

<ul>
<li>检查您的 Podfile 是否正确引用了您应用的目标。 </li>
<li>打开目标的 Build Phases 选项卡并找到“Link Binary with Libraries”。移除 CocoaPods。 </li>
</ul>

<p> <img src="/image/12jdk.png" alt="enter image description here"/> </p>

<ul>
<li>删除 .workspace 文件</li>
<li>删除 Pods/目录</li>
<li>再次运行 <code>pod install</code>。 </li>
</ul></p>
                                   
                                                <p style="font-size: 20px;">关于ios - 架构 i386 的 undefined symbol- 来自 podfile 的所有项目,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/28597642/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/28597642/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - 架构 i386 的 undefined symbol - 来自 podfile 的所有项目