我目前正在测试使用 Xamarin iOS 开发的 iOS 应用程序的兼容性。但是,我在 MacBook 上使用 Xcode 15 beta 和 Visual Studio 2022(版本 17.6)时都遇到问题。
具体来说,我面临着与两个 IDE 的配对问题,因为没有可用于调试的 iOS 模拟器,而且我无法打开故事板等问题。
我想知道 Xcode 15 beta 和 Visual Studio 2022(版本 17.6)是否与 Xamarin iOS 开发兼容,或者我是否需要等待 Visual Studio for Mac 的未来版本。任何有关解决这些兼容性问题的见解或指导将不胜感激。
谢谢你!
我刚刚更新到 XCODE 15 和 Macos SONOMA。我收到了有关周期的问题:
\nCycle inside MyApp; building could produce unreliable results.\nCycle details:\n\xe2\x86\x92 Target \'MyApp\': ExtractAppIntentsMetadata\n\xe2\x97\x8b Target \'MyApp\': CodeSign /Users/me/Library/Developer/Xcode/DerivedData/ProjectA-frqscjhianktlvbxgbzostesljpn/Build/Products/Debug-iphoneos/MyApp.app/Frameworks/3rdPartyFramework.framework\n\xe2\x97\x8b Target \'MyApp\' has copy command from \'/Users/me/Desktop/Checkouts/MyApp/theApp/MyApp/ios/3rdPartyFramework.framework\' to \'/Users/me/Library/Developer/Xcode/DerivedData/ProjectA-frqscjhianktlvbxgbzostesljpn/Build/Products/Debug-iphoneos/MyApp.app/Frameworks/3rdPartyFramework.framework\'\n\xe2\x97\x8b Target \'MyApp\' has copy command from \'/Users/me/Library/Developer/Xcode/DerivedData/ProjectA-frqscjhianktlvbxgbzostesljpn/Build/Products/Debug-iphoneos/CallExtension.appex\' to \'/Users/me/Library/Developer/Xcode/DerivedData/ProjectA-frqscjhianktlvbxgbzostesljpn/Build/Products/Debug-iphoneos/MyApp.app/PlugIns/CallExtension.appex\'\n\xe2\x97\x8b That command depends on command in Target \'MyApp\': script phase \xe2\x80\x9cAdd Git/CI Build Info\xe2\x80\x9d\n\xe2\x97\x8b Target \'MyApp\' has process command with output \'/Users/me/Library/Developer/Xcode/DerivedData/ProjectA-frqscjhianktlvbxgbzostesljpn/Build/Products/Debug-iphoneos/MyApp.app/Info.plist\'\n\xe2\x97\x8b Target \'MyApp\' has copy command from \'/Users/me/Desktop/Checkouts/MyApp/theApp/MyApp/ios/3rdPartyFramework.framework\' to \'/Users/me/Library/Developer/Xcode/DerivedData/ProjectA-frqscjhianktlvbxgbzostesljpn/Build/Products/Debug-iphoneos/MyApp.app/Frameworks/3rdPartyFramework.framework\'\n\n\nRaw dependency cycle trace:\n\ntarget: ->\n\nnode: <all> ->\n\ncommand: <all> ->\n\nnode: …Run Code Online (Sandbox Code Playgroud) 我找不到使用新宏在多个设备上预览视图SwiftUI的方法。它正在使用并在画布上显示并排预览,每个预览都使用正确的目标设备,但情况并非如此,这是我的代码:XCode 15#PreviewXCode 14XCode 15
struct ContentView: View {
var body: some View {
Text("Hello, world!")
}
}
#Preview {
ContentView()
.previewOnDevices()
}
//#Preview {
// ContentView()
// .previewOnDevices()
//}
extension View {
func previewOnDevices() -> some View {
ForEach(DeviceName.all, id: \.self) { devicesName in
previewDevice(PreviewDevice(rawValue: devicesName))
.previewDisplayName(devicesName)
}
}
}
enum DeviceName: String, CaseIterable {
//xcrun simctl list devicetypes
case iPhoneSE = "iPhone SE (3rd generation)"
case iPhone13Mini = "iPhone 13 mini"
static var …Run Code Online (Sandbox Code Playgroud) 我在通过 Cisco Anyconnect 连接的公司代理后面工作。当我未连接到 VPN 时,XCode 15 确实可以识别通过电缆连接的物理 iPhone。当我切换到 VPN 时,XCode 就失去了连接。当我进入公司网络时,XCode 似乎仅尝试通过 Wifi 进行连接。这很奇怪,因为查找器通过电缆识别设备,即使没有 VPN 连接,它也能正常工作。
在“管理运行目的地”下,我发现我的 iPhone 出现以下消息:
Internal logic error: Connection was invalidated
Domain: com.apple.CoreDevice.ControlChannelConnectionError
Code: 1
User Info: {
DVTErrorCreationDateKey = "2023-09-28 08:17:11 +0000";
"com.apple.dt.DVTCoreDevice.operationName" = enablePersonalizedDDI;
}
--
Transport error
Domain: com.apple.CoreDevice.ControlChannelConnectionError
Code: 0
--
The connection was interrupted.
Domain: com.apple.Mercury.error
Code: 1000
User Info: {
XPCConnectionDescription = "<RemoteXPCPeerConnection 0x600002c8eda0> { <remote connection: 0x6000033b7200> { type = rsd, state = not-connected, remote service name = …Run Code Online (Sandbox Code Playgroud) 在我的应用程序中,我使用stephencelis/SQLite.swift
更新到 Xcode 15 并发布我的应用程序后,无需进行任何更改。超过 4000 名用户中有 2 名用户报告称他们无法在数据库中进行输入。数据库数据输入代码尚未更改,并且在所有测试设备和 iOS 系列以及其余用户上运行良好,但到目前为止有 2 位用户更新到了仅颜色更改的新应用程序版本;没有实际的代码更改无法添加到数据库,我无法调试原因。
唯一的区别是我使用 Xcode 15 来发布应用程序,并在运行代码时注意到一个新警告:
objc[3422]: Class _TtC6SQLite6Backup is implemented in both /System/Library/PrivateFrameworks/LinkServices.framework/LinkServices (0x1f1147048) and /private/var/containers/Bundle/Application/XX-XX-XX/App.app/Frameworks/SQLite.framework/SQLite (0x1063a1c70). One of the two will be used. Which one is undefined.
objc[3422]: Class _TtC6SQLite10Connection is implemented in both /System/Library/PrivateFrameworks/LinkServices.framework/LinkServices (0x1f03485f8) and /private/var/containers/Bundle/Application/XX-XX-XX/App.app/Frameworks/SQLite.framework/SQLite (0x1063a2228). One of the two will be used. Which one is undefined.
objc[3422]: Class _TtC6SQLite13DateFunctions is implemented in both /System/Library/PrivateFrameworks/LinkServices.framework/LinkServices (0x1f1146fb0) and /private/var/containers/Bundle/Application/XX-XX-XX/App.app/Frameworks/SQLite.framework/SQLite (0x1063a23d8). One of the two …Run Code Online (Sandbox Code Playgroud) 自从升级到 Xcode 15.0 以来,我一直无法将模拟器设置为运行目的地。它们不会显示为菜单中的选项(无论是在工具栏的下拉列表中,还是在菜单中Product > Destination)。然而,它们确实出现在Devices and Simulators窗口中。它们也可以自行愉快地打开(从 中打开时Xcode > Open Developer Tool > Simulator),但项目仍然不会将它们识别为可能的运行目的地。
我尝试过做很多改变,但没有成功:
\nProduct > Destination > Destination ArchitecturesXcode 将连接并运行我的手机(运行 iOS 17.01 的 iPhone 14 Pro)上的应用程序。有趣的是,SwiftUI 的画布显示“正在加载 iOS 17.0...”,但它从未真正加载(尽管它会在我的手机上预览)。我认为这表明我的 iOS 17 下载存在问题,但模拟器似乎启动得很好。许多尝试的修复都是受到这个类似问题的答案的启发的答案的启发。
\n运行xcrun simctl list会产生一长串模拟器:
== Device Types ==\niPhone …Run Code Online (Sandbox Code Playgroud) Xcode 15 现在以颜色显示日志消息。例如,警告似乎以黄色显示,而标准消息则以白色显示。
我是否需要在我的 iOS 应用程序中包含 Swift Log 才能以彩色输出消息,或者是否有内置方法可以做到这一点?
我正在尝试向新 Xcode 15 字符串目录(又名 xcstrings)中的字符串添加换行符。我什么也没想,就在\n想要换行的地方添加了平常的内容。
但在我的 SwiftUI 视图中,我可以看到实际转义的内容\n,并且文本不会换行。因此,文本“lorem ipsum\ndolor”将作为“lorem ipsum\ndolor”呈现给用户。
如何在不使用目录中的多个独立字符串的情况下创建带有有意换行符的文本?
在我使用公共 Xcode 15.0 的旧代码库中,我无法使用新的#Preview宏预览任何 UIKit 视图
import SwiftUI
#Preview {
let uiView = UIView()
return uiView
}
Run Code Online (Sandbox Code Playgroud)
画布无法加载预览并进行故障诊断
Compiling failed: return expression of type 'UIView' does not conform to 'View'
当我使用 Xcode 14 时,我没有遇到任何警告。然而,更新到 Xcode 15 后,我突然开始收到来自第三方库的 200 多个警告。有谁知道这样做的原因或如何解决这些警告而不必等待库更新?这些警告似乎与库中 Objective-C 的使用有关。
类似这样的警告:
Mixed ObjC ABI, /Users/wanghong/Developer/alpaca/Pods/AppsFlyerFramework/iOS/AppsFlyerLib.framework/Versions/A/AppsFlyerLib[x86_64][26](AppsFlyerAES128Crypto.o) compiled with category class properties
xcode15 ×10
xcode ×7
ios ×5
swift ×3
ios17 ×2
frameworks ×1
localization ×1
logging ×1
macos ×1
macos-sonoma ×1
sqlite ×1
swift-macro ×1
swiftui ×1
uikit ×1
xamarin ×1
xamarin.ios ×1
xcstrings ×1