我最近更新到 Xcode 15 Beta 7,在我的设备(iOS 17 beta 7)上运行应用程序时遇到此错误。它表示现有磁盘映像传输已在进行中。
等待重新连接到我的 iPhone 13 Pro
先前的准备错误:无法在此设备上安装开发人员磁盘映像。安装映像时出错:0xe8000124(kAMDMobileImageMounterExistingTransferInProgress:现有磁盘映像传输已在进行中。)
模拟器:带有 IOS 17 的 iPhone 15 Xcode:版本 15.0 (15A240d)
刚刚创建的项目的简单示例:
import SwiftUI
struct ContentView: View {
@State private var searchText = ""
var body: some View {
NavigationStack {
Text("Searching for \(searchText)")
.navigationTitle("Searchable Example")
}
.searchable(text: $searchText)
}
}
#Preview {
ContentView()
}
Run Code Online (Sandbox Code Playgroud)
当开始点击任何文本时抛出:
错误:此应用程序或其使用的库已将无效的数值(NaN 或非数字)传递给 CoreGraphics API,并且该值将被忽略。请解决这个问题。
单击并取消启动后,每次单击都会显示以下错误:
-[RTIInputSystemClient remoteTextInputSessionWithID:performInputOperation:] 执行输入操作需要有效的sessionID
有人知道如何修复吗?
我在苹果论坛https://developer.apple.com/forums/thread/731700上找到了一个帖子,但一如既往地没有来自开发人员的单一答案。
我\xe2\x80\x98d 喜欢将我的用户默认值存储在一个类中。使用旧的 Swift 数据流,可以在类中使用它。现在,使用新系统(Xcode 15,Beta 2),它不再\xe2\x80\x99 工作了。有什么办法可以使用吗?也许有一个解决方法?
\n这是以前的工作方式:
\nimport SwiftUI\n\nclass UserInfo: ObservableObject {\n\n@AppStorage("username") var username: String = ""\n\n}\nRun Code Online (Sandbox Code Playgroud)\n现在我想使用新系统:
\nimport SwiftUI\n\n@Observable class UserInfo {\n\n@AppStorage("username") var username: String = ""\n\n}\nRun Code Online (Sandbox Code Playgroud)\n不幸的是,它不起作用。
\n我将 Xcode 更新到 15.0 并运行应用程序。当在 iOS 17 上运行应用程序时,我的应用程序崩溃并出现以下错误:
\n\n\n-[UINavigationBar layoutSubviews] 中的断言失败,UINavigationBar.m:3\xc2\xa0849 'NSInternalInconsistencyException',原因:'请求可见导航栏的布局
\n
它仅发生在带有 Xcode 15.0 的 iOS 17 上。对于 Xcode 14.3 和 iOS 17 - 没有。对于 Xcode 15 和 iOS 16.4 - 没有。
\n\n*** 由于未捕获的异常“NSInternalInconsistencyException”而终止应用程序,原因:“请求可见导航栏的布局,<UINavigationBar:0x15bd34ee0;帧=(0 47;428 44);自动调整大小=W;色调颜色 = UIExtendedGrayColorSpace 0 1; Layer = <CALayer: 0x2813b9f40>> delegate=0x15c049e00 standardAppearance=0x2837b03c0 rollEdgeAppearance=0x2837b02a0 compactAppearance=0x2837b0540 compactScrollEdgeAppearance=0x2837b0240,当顶部项目属于不同的导航栏时。topItem = <UINavigationItem: 0x15bf26070> titleView=0x160f04840 style=navigator backBarButtonItem=0x15bf5f4d0 rightBarButtonItems=0x281c93f90,导航栏 = <UINavigationBar: 0x15bd05d60; 帧=(0 47;428 44);自动调整大小=W;色调颜色 = UIExtendedGrayColorSpace 0 1; 层 = <CALayer: 0x2813be380>> delegate=0x15c056800 standardAppearance=0x2837fd5c0 rollEdgeAppearance=0x2837fd7a0 …
这只是今天在 Xcode 15 中开始的。我还没有添加任何新的日志或打印语句,但是当我在 iPhone 14 Pro 上构建并运行时,我点击应用程序中的视图,控制台正在打印:
1 条日志/路标消息由于实时模式录制中的高速率而丢失。为了保证所有日志的传送,请在可执行文件的环境中将 IDELogRedirectionPolicy 设置为 oslogToStdio。
无数次。当我在 iPhone 13 mini 上构建并运行完全相同的代码时,它不起作用?
Xcode 15 Beta 8 中的 #Preview 宏的使用方式是否发生了变化?该代码曾经工作正常,但现在不再编译,因为== PREVIEW UPDATE ERROR: CompileDylibError: Failed to build WatchRecoveryWidget.swift Compiling failed: cannot convert value of type 'WatchRecoveryScoreTimeLineEntry' to closure result type 'any View'
#Preview(as: WidgetFamily.accessoryRectangular) {
WatchRecoveryScoreWidget()
} timeline: {
WatchRecoveryScoreTimeLineEntry(date: Date(), recoveryScore: 75, subscriptionIsActive: true)
}
Run Code Online (Sandbox Code Playgroud) 我想创建一个类来定期处理一些数据。我没有使用过CoreData。在 SwiftUI 视图之外,如何获取模型容器和上下文以便检索和添加对象?WWDC 视频中显示的代码let context = self.newSwiftContext(from: Trip.self)并不是不言自明的。
我已经安装了新版本的 Xcode 15.0。此后我无法运行我的 flutter 应用程序。它向我显示以下错误:
Error (Xcode): DT_TOOLCHAIN_DIR cannot be used to evaluate LIBRARY_SEARCH_PATHS, use TOOLCHAIN_DIR instead
Run Code Online (Sandbox Code Playgroud) `错误(Xcode):在 Runner 内循环;构建可能会产生不可靠的结果。\n循环详细信息:\n\xe2\x86\x92 目标“Runner”:ExtractAppIntentsMetadata\n\xe2\x97\x8b 目标“Runner”具有来自“/Users/datnguyen/WorkSpaces/project_template/”的复制命令flutter_getx_template/build/ios/Debug-develop-iphonesimulator/ImageNotification.appex' 到 '/Users/datnguyen/WorkSpaces/project_template/flutter_getx_template/build/ios/Debug-develop-iphonesimulator/Runner.app/PlugIns/ImageNotification.appex'\ n\xe2\x97\x8b 该命令取决于目标“Runner”中的命令:脚本阶段 \xe2\x80\x9cThin Binary\xe2\x80\x9d\n\xe2\x97\x8b 目标“Runner”具有带输出的处理命令'/Users/datnguyen/WorkSpaces/project_template/flutter_getx_template/build/ios/Debug-develop-iphonesimulator/Runner.app/Info.plist'\n\xe2\x97\x8b 目标“Runner”具有来自“/Users/”的复制命令datnguyen/WorkSpaces/project_template/flutter_getx_template/build/ios/Debug-develop-iphonesimulator/ImageNotification.appex' 到 '/Users/datnguyen/WorkSpaces/project_template/flutter_getx_template/build/ios/Debug-develop-iphonesimulator/Runner.app/PlugIns /ImageNotification.appex'
\n原始依赖循环跟踪:
\n目标:->
\n节点:->
\n命令:->
\n节点:/Users/datnguyen/Library/Developer/Xcode/DerivedData/Runner-bhtoumdqsgiaregnjytyoapucbjm/Build/Intermediates.noindex/Runner.build/Debug-develop-iphonesimulator/Runner.build/Objects-normal/arm64/ExtractedAppShortcutsMetadata.stringsdata ->
\n命令: P0:target-Runner-18c1723432283e0cc55f10a6dcfd9e0288a783a885d8b0b3beb2e9f90bde3f49-:调试-develop:ExtractAppIntentsMetadata ->
\n节点:->
\n命令: P0:::Gate target-Runner-18c1723432283e0cc55f10a6dcfd9e0288a783a885d8b0b3beb2e9f90bde3f49--fused-phase7--cp--embed-pods-frameworks ->
\n节点:/Users/datnguyen/Library/Developer/Xcode/DerivedData/Runner-bhtoumdqsgiaregnjytyoapucbjm/Build/Intermediates.noindex/Runner.build/Debug-develop-iphonesimulator/Runner.build/InputFileList-1739A84D50484D6E4E41EDFB-Pods-Runner-frameworks-Debug -develop-input-files-744cbbea3dded29901e6b34dae91a16a-resolved.xcfilelist ->
\n命令: P2:target-Runner-18c1723432283e0cc55f10a6dcfd9e0288a783a885d8b0b3beb2e9f90bde3f49-:调试-develop:WriteAuxiliaryFile /Users/datnguyen/Library/Developer/Xcode/DerivedData/Runner-bhtoumdqsgiaregnjytyoap ucbjm/Build/Intermediates.noindex/Runner.build/Debug-develop-iphonesimulator/Runner .build/InputFileList-1739A84D50484D6E4E41EDFB-Pods-Runner-frameworks-Debug-develop-input-files-744cbbea3dded29901e6b34dae91a16a-resolved.xcfilelist ->
\n节点:->
\n命令: P0:::Gate target-Runner-18c1723432283e0cc55f10a6dcfd9e0288a783a885d8b0b3beb2e9f90bde3f49--fused-phase6-copy-files ->
\n节点: <复制/Users/datnguyen/WorkSpaces/project_template/flutter_getx_template/build/ios/Debug-develop-iphonesimulator/Runner.app/PlugIns/ImageNotification.appex> ->
\n循环点 ->
\n命令: P0:target-Runner-18c1723432283e0cc55f10a6dcfd9e0288a783a885d8b0b3beb2e9f90bde3f49-:调试-develop:复制/Users/datnguyen/WorkSpaces/project_template/flutter_getx_template/build/ios/Debug-develop-iphonesimulator/Runner.app/PlugIn s/ImageNotification.appex /Users/datnguyen /WorkSpaces/project_template/flutter_getx_template/build/ios/Debug-develop-iphonesimulator/ImageNotification.appex ->
\n节点:->
\n命令: P0:::Gate target-Runner-18c1723432283e0cc55f10a6dcfd9e0288a783a885d8b0b3beb2e9f90bde3f49--fused-phase5-thin-binary ->
\n节点:->
\n …