我正在开发一个CarPlay音频应用程序,它可以同时使用iOS 14和ios 13。
我为iOS 13使用了Media框架,为iOS 14或更高版本使用了CarPlay框架。https://developer.apple.com/documentation/carplay/supporting_previous_versions_of_ios?language=objc
它在iOS 14上运行良好,但在iOS 13/12上使用
dyld:符号未找到: OBJC_CLASS$_CPNowPlayingAddToLibraryButton
我发现使用以下类会导致应用程序崩溃。
CPNowPlayingAddToLibraryButton
CPNowPlayingRepeatButton
CPNowPlayingShuffleButton
CPNowPlayingImageButton
在运行早期版本的iOS时,仅仅添加其中一个类就会导致崩溃。
CPNowPlayingAddToLibraryButton* addToButton = [CPNowPlayingAddToLibraryButton.alloc initWithHandler:^(CPNowPlayingAddToLibraryButton*)
{
...
}];发布于 2021-10-21 11:08:18
您需要弱链接CarPlay框架。在目标的构建阶段,进入部分,检查是否已经存在CarPlay (如果没有)。然后确保状态设置为可选。

https://stackoverflow.com/questions/69654246
复制相似问题