Markdown
仅自己可见
保存
Preview

iOS - 奇葩警告及报错

linking against a dylib which is not safe for use in application extensions

因为app extension限制了某些API的使用, ( App Extensions不能使用的一些API ) ,因此在自定义自己的framework后,这个framework可能包含了某些在App Extensions里不能使用的API,因此为了安全起见才会给出这个警告。

选中自定义framework的target,然后选中Build Settings,(记住选择All,而不是Basic),在过滤框中输入"require only",将Require Only App-Extension-Safe API的值改成YES,(默认为NO),然后Command + K clean一下工程,警告久消除了。

warning: Auto Layout Localization: Leading constraint is missing, which may cause overlapping with other views.

需要多加一条约束左或右间距约束。

'CC_MD5' was deprecated in iOS 13.0: This function is cryptographically broken and should not be used in security contexts. Clients should migrate to SHA256 (or stronger).

就这样吧

'statusBarFrame' was deprecated in iOS 13.0: Use the statusBarManager property of the window scene instead.

swift
let height = view?.window?.windowScene?.statusBarManager?.statusBarFrame.height ?? 0

Multiple commands produce './Info.plist':

1) Target 'Notes' (project 'Notes') has copy command from './Info.plist' 2) Target 'Notes' (project 'Notes') has process command with output './Info.plist'

在 target -> Build phase > Copy Bundle Resource 中找到info.plist,移除

The specified item could not be found in the keychain.

Ensure you are in the "Certificates" section and you select "Apple Worldwide Developer Relations Certification Authority" before requesting a certificate.

Command CompileSwift failed with a nonzero exit code

1.在项目中搜索关键词CommonCrypto。
2.如果有Pod依赖这个头文件,在podfile中移除掉这个Pod库,重新执行pod install。
3.clean and build项目。
4.重新添加刚才移除掉的Pod库到podfile文件。然后pod install项目。
5.clean and build项目,就好了。

The resource could not be loaded because the App Transport Security policy requires the use of a secure connection

Info.plist
xml
<key>NSAppTransportSecurity</key>
<dict>
  <key>NSAllowsArbitraryLoads</key>
  <true/>
</dict>

AppName's architectures (arm64) include none that iPhone 11 Pro can execute (Intel 64-bit)

删除项目中 Build Settings -> User-Defined -> VALID_ARCHS 这一项即可

Markdown
仅自己可见
保存