Can't run Flutter app on simulator after upgrading XCode to 14.3 because of missing libarclite_iphonesimulator.a file

huangapple go评论76阅读模式
英文:

Can't run Flutter app on simulator after upgrading XCode to 14.3 because of missing libarclite_iphonesimulator.a file

问题

我正在使用VSCode来开发我的Flutter应用,但在升级XCode到最新版本(14.3)后,无法在模拟器(iOS 15,iPhone 11)上运行Flutter应用。以下是错误消息:


错误(Xcode):链接器命令失败,退出代码为1(使用-v查看调用)

无法为模拟器构建应用程序。```

<details>
<summary>英文:</summary>

I&#39;m using VSCode to develop my Flutter app, and I can&#39;t run my Flutter app on simulator (iOS 15, IPhone11) after I upgraded XCode to latest verison (14.3). Here is the error message:

Error (Xcode): File not found: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/libarclite_iphonesimulator.a

Error (Xcode): Linker command failed with exit code 1 (use -v to see invocation)

Could not build the application for the simulator.


</details>


# 答案1
**得分**: 21

安装了 14.3 后,我不得不修改我的 ios/Podfile 以再次运行我的项目:

问题是,iOS 的部署目标必须为 11.0 或更高版本,以适配 iOS 16.4。

查看:https://developer.apple.com/forums/thread/725300

更新:如 @danielrosero 所提到的,您需要在编辑 iOS/Podfile 后再次运行 pod install


<details>
<summary>英文:</summary>

After installing 14.3 I had to modify my `ios/Podfile` to get my project running again:

post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
end

installer.generated_projects.each do |project|
project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'
end
end
end
end


The issue is that, the deployment targets for iOS must be 11.0 or higher for iOS 16.4.

See: https://developer.apple.com/forums/thread/725300

UPDATE: As mentioned by @danielrosero, you need to run `pod install` again, after editing `iOS/Podfile`.

</details>



# 答案2
**得分**: 10

I have updated the Pods libraries Minimum Deployments 11.0

Make sure all the library Minimum Deployments Versions should be above 11.0, Then it worked for me.

[![enter image description here][1]][1]

[1]: https://i.stack.imgur.com/ilkic.png

OR

Add the below code in the end of the Podfile and do pod install.

&lt;!-- begin snippet: js hide: false console: true babel: false --&gt;

&lt;!-- language: lang-html --&gt;

post_install do |installer|
  installer.generated_projects.each do |project|
    project.targets.each do |target|
        target.build_configurations.each do |config|
            config.build_settings[&#39;IPHONEOS_DEPLOYMENT_TARGET&#39;] = &#39;11.0&#39;
         end
    end
  end
end

&lt;!-- end snippet --&gt;

<details>
<summary>英文:</summary>

I have updated the Pods libraries Minimum Deployments 11.0

Make sure all the library Minimum Deployments Versions should be above 11.0, Then it worked for me.


[![enter image description here][1]][1]


  [1]: https://i.stack.imgur.com/ilkic.png


OR

Add the below code in the end of the Podfile and do pod install.

&lt;!-- begin snippet: js hide: false console: true babel: false --&gt;

&lt;!-- language: lang-html --&gt;

    post_install do |installer|
      installer.generated_projects.each do |project|
        project.targets.each do |target|
            target.build_configurations.each do |config|
                config.build_settings[&#39;IPHONEOS_DEPLOYMENT_TARGET&#39;] = &#39;11.0&#39;
             end
        end
      end
    end


&lt;!-- end snippet --&gt;



</details>



# 答案3
**得分**: 2

Sure, here are the translated instructions:

**步骤 1**

跟踪由库引起的问题。如果您看一下屏幕截图,我在FMDB Pod上遇到了一个错误:

**步骤 2**

我们需要更改受影响的Pod文件上的iOS版本,因为新的Xcode不支持iOS 11.0以下版本。

**步骤 3**
额外步骤:在更新Pod后,您可能会遇到构建分发错误。为避免此问题,请执行以下操作。

更改目标Pod的分发设置。

重新在Xcode上构建您的应用程序。

如果这对您有帮助,请点赞我的回答。

<details>
<summary>英文:</summary>

Make sure you have update the pod files after that follow the steps that are mentioned below:


**Step 1**

Track the issue cased by library.If you look at the screenshot I got an error for FMDB Pod:  

[![enter image description here][1]][1]


**Step 2**

we need to change the iOS version on effected pod file because new xCode not support below iOS 11.0
[![enter image description here][2]][2]


Step 3
Extra Step you may also face a build distribution error after updating pods. Do this to avoid that issue.

Change Distribution setting on Target Pod.

 [![enter image description here][3]][3]

Rebuild your app again on Xcode.


upvote my answer if it&#39;s helpful

  [1]: https://i.stack.imgur.com/NasUb.png
  [2]: https://i.stack.imgur.com/s0qfT.png
  [3]: https://i.stack.imgur.com/ib8ph.png

</details>



huangapple
  • 本文由 发表于 2023年4月1日 00:30:26
  • 转载请务必保留本文链接:https://go.coder-hub.com/75900795.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定