xcodebuild archive 失败,出现 SwiftEmitModule normal arm64 Emitting。

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

xcodebuild archive failing with SwiftEmitModule normal arm64 Emitting

问题

我有一个框架,它有其他框架作为依赖关系。我想为设备和模拟器存档框架,以创建 XCFramework。当我运行下面的命令时,存档失败,并显示以下错误。

命令已使用:

xcodebuild archive \
  -scheme XXXX \
  -sdk iphoneos \
  -archivePath "archives/ios_devices.xcarchive" \
  BUILD_LIBRARY_FOR_DISTRIBUTION=YES \
  SKIP_INSTALL=NO

从命令行中失败,并显示以下错误:

存档失败

以下构建命令失败:
SwiftEmitModule normal arm64 Emitting module for XXXX (in target 'XXXX' from project 'XXXX')
(1 failure)

英文:

I have a framework and it has other frameworks as dependency. I wanted to archive the framework for Device, Simulator to create XCFramework. when i run below command archive is failing with below command.

Command Used:

xcodebuild archive \
-scheme XXXX \
-sdk iphoneos \
-archivePath "archives/ios_devices.xcarchive" \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES \
SKIP_INSTALL=NO

Failing with below error from command line.

** ARCHIVE FAILED **

The following build commands failed:
SwiftEmitModule normal arm64 Emitting\ module\ for\ XXXX (in target 'XXXX' from project 'XXXX')
(1 failure)

答案1

得分: 1

I solved this issue. If you are using workspace, you should add this line to your archive building commands.

-workspace SampleFramework.xcworkspace

I saw this solution here

============================================

I want to include Alamofire in my framework, and I want to build it as an xcframework. So when I build it, I encountered the same problem you had.

The things I tried:

  1. Include 'VALID_ARCHS="i386 x86_64"' in the iPhone simulator archive building command.
  2. Include -destination in the archive building command.
  3. Try changing the framework's Mach-O Type to dynamic or static library.
  4. Check the framework's build settings to exclude the arm64 architecture when it's running on a phone.

Unfortunately, none of the things I tried could solve the problem. Did you find any solution? Also, I'm not good at English. Please excuse me for this.

英文:

I solved this issue. If you are using workspace, you should add this line to your archive building commands.

-workspace SampleFramework.xcworkspace \

I saw this solution here

============================================

I want include Alamofire to my framework and I want build it as xcframework. So when I build it, I have the same problem which you got.

The things what i tried :

  1. include 'VALID_ARCHS="i386 x86_64" to the iphone simulator archive building command
  2. include -destination to the archive building command
  3. try the framework's Mach-O Type to dynamic, static library
  4. check the framework's build settings. not to include amr64 architecture when it running as phone.

All I did cannot solve the problem. Did you find any solution? Also I'm not good at English. Please excuse me for this.

huangapple
  • 本文由 发表于 2023年2月14日 01:06:02
  • 转载请务必保留本文链接:https://go.coder-hub.com/75439034.html
匿名

发表评论

匿名网友

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

确定