8

Xcode12项目适配

 3 years ago
source link: https://xnxy.github.io/xnxy.github.io/2020/09/24/Xcode12%E9%A1%B9%E7%9B%AE%E9%80%82%E9%85%8D/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Xcode12项目适配

2020-09-24

|

2020-09-24

| 整理

Overview

最近更新Xcode12,发现编译有的项目的时候会出现些问题,然后一个个解决所有项目完美编译通过。

最近看有的群里在讨论Xcode12编译项目的一些问题,觉得可以整理一篇自己遇到问题的文章,便于遇到同样问题的朋友查阅。

项目无法在模拟器中运行

将项目运行到模拟器的时候报No architectures to compile for (ONLY_ACTIVE_ARCH=YES, active arch=x86_64, VALID_ARCHS=arm64 armv7)错误。

TARGETS->Build Settings->搜索VALID_ARCHS, 然后添加模拟器的指令集。如果有多个TARGETS时,需要分别添加。

如图所示:

项目运行模拟器适配

Library not found for -lstdc++.6.0.9

果然自己保存在github中的lstdc++库是对的,忘记从哪个版本Xcode去除了lstdc++库,每次更新Xcode的时候都需要重新添加一下。

  • github中下载lstdc++,将其复制到下面的路径下即可。
1
2
3
4
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/

Swift代码中报Constructing an object of class type 'Self' with a metatype value must use a 'required' initializer。错误

1
2
3
required init() {
super.init(
}

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK