iOS Mac Catalyst坑点

现有项目适配Mac Catalyst

  • Building for Mac Catalyst is not supported by the legacy build system.
  • No such module ' swift 相关的一些库'
  • OpenGLES is deprecated and is not available when building for Mac Catalyst.
  • Pods/WechatOpenSDK/OpenSDK1.8.7.1/libWeChatSDK.a(WechatAuthSDK.o), building for Mac Catalyst, but linking in object file built for iOS Simulator,...for architecture x86_64
  • Mac Catalyst上线问题

一个古老的iOS项目适配 Mac Catalyst 鬼知道有多少坑,下面是我亲手埋的一些坑,希望对大家有所帮助。

iOS Mac Catalyst坑点_第1张图片

Building for Mac Catalyst is not supported by the legacy build system.

iOS Mac Catalyst坑点_第2张图片
解决方法:file -> Workspace settings
iOS Mac Catalyst坑点_第3张图片

No such module ’ swift 相关的一些库’

小编项目是用swift开发的,项目中遇到所有的swift相关库都找不到了。类似下图:
iOS Mac Catalyst坑点_第4张图片

iOS Mac Catalyst坑点_第5张图片

解决方法:
iOS Mac Catalyst坑点_第6张图片
如果上边还不行将pods也加入。
iOS Mac Catalyst坑点_第7张图片

OpenGLES is deprecated and is not available when building for Mac Catalyst.

iOS Mac Catalyst坑点_第8张图片

1、搜索OpenGLES。如果项目中用到了,解决方法如下:

2、如果一些三方SDK中使用到OpenGLES。需要手动导入一下相关SDK。
iOS Mac Catalyst坑点_第9张图片
以BaiduMap为例 在TesT_Bridging_Header中修改如下:

#ifndef TesT_Bridging_Header_h
#define TesT_Bridging_Header_h

#if !TARGET_OS_MACCATALYST
#import 
#endif

#endif

Pods/WechatOpenSDK/OpenSDK1.8.7.1/libWeChatSDK.a(WechatAuthSDK.o), building for Mac Catalyst, but linking in object file built for iOS Simulator,…for architecture x86_64

手动导入libWeiboSDK
在这里插入图片描述

#ifndef TesT_Bridging_Header_h
#define TesT_Bridging_Header_h

#if !TARGET_OS_MACCATALYST
#import "WXApi.h"
#endif

#endif

在使用到WXApi的地方进行判断

#if !targetEnvironment(macCatalyst)
extension AppDelegate : WXApiDelegate {
}
#endif

如果手动导入之后还会报Pods/WechatOpenSDK/OpenSDK1.8.7.1/libWeChatSDK.a(WechatAuthSDK.o), building for Mac Catalyst, but linking in object file built for iOS Simulator,…for architecture x86_64
iOS Mac Catalyst坑点_第10张图片
删除
iOS Mac Catalyst坑点_第11张图片

Mac Catalyst上线问题

ERROR ITMS-90242: "The product archive is invalid. The Info.plist must contain a LSApplicationCategoryType key, whose value is the UTI for a valid category. For more details, see "Submitting your Mac apps to the App Store"."

在Info.plist添加
LSApplicationCategoryType
public.app-category.business

你可能感兴趣的:(swift,ios,ios,swift)