标签: xcode13

dyld 崩溃:库未加载:/usr/lib/swift/libswift_Concurrency.dylib 在模拟器上运行

我正在现有应用程序上实现一个非常基本的任务(从远程服务器下载一些文件),以练习新的 Swift Concurrency API。该任务在 iOS 15 上完美完成:我使用任务组并按预期收到图像。由于此应用程序已经存在,我使用 @available 标签来检查设备是否可以执行我的任务(如果是 iOS 15,则执行此操作。否则,向用户显示警报并且不执行任何操作)当我尝试运行此应用程序时,会发生问题在 iOS 13.5 的模拟器上运行应用程序时,我的应用程序在启动时崩溃并出现以下错误:

dyld: Library not loaded: /usr/lib/swift/libswift_Concurrency.dylib
  Referenced from: /Users/username/Library/Developer/CoreSimulator/Devices/B316A0F0-B7EF-4F5E-8A26-F7FF54E8A681/data/Containers/Bundle/Application/6CF3D46E-3F15-4FA3-BD61-9D353541B9DA/MyApp.app/MyApp
  Reason: image not found
dyld: launch, loading dependent libraries
DYLD_SHARED_CACHE_DIR=/Users/username/Library/Developer/CoreSimulator/Caches/dyld/20F71/com.apple.CoreSimulator.SimRuntime.iOS-13-5.17F61
DYLD_ROOT_PATH=/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 13.5.simruntime/Contents/Resources/RuntimeRoot
DYLD_LIBRARY_PATH=/Users/username/Library/Developer/Xcode/DerivedData/MyApp-bawyiebpygwuwxawcoistefwxuyy/Build/Products/Debug-iphonesimulator:/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 13.5.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/introspection
DYLD_INSERT_LIBRARIES=/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 13.5.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libBacktraceRecording.dylib:/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 13.5.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libMainThreadChecker.dylib:/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 13.5.simruntime/Contents/Resources/RuntimeRoot/Developer/Library/PrivateFrameworks/DTDDI
Run Code Online (Sandbox Code Playgroud)

环境:Xcode 13.0 beta 2 (13A5155e) 模拟器 iPhone 8 (iOS 13.5)。Swift 语言版本 5

我能做点什么吗?

编辑:这就是我使用 if available 的方式

@available(iOS 15.0, *)
class SCTestViewController: UIViewController {...}
    
Run Code Online (Sandbox Code Playgroud)

xcode ios swift xcode13

6
推荐指数
2
解决办法
1万
查看次数

无法在 Xcode 13 beta 中使用“文件”>“添加包...”添加 Swift 包

我创建了一个新的 iOS 项目,现在我尝试Alamofire使用 Xcode 添加依赖项(我想它在幕后使用了 Swift Package Manager)。然而,它就是行不通。当我进入https://github.com/Alamofire/Alamofire.git搜索栏时,它什么也没找到。我的 GitHub 帐户已连接,但我想这应该不重要。

xcode swift swift-package-manager xcode13

6
推荐指数
0
解决办法
2174
查看次数

在 macOS BigSur 11.6 上安装时 Xcode 13.0 卡住

从 AppStore 更新 Xcode 时,我遇到了奇怪的行为。

屏幕截图: Xcode 13.0 安装时卡住

我试过了:

  1. 删除 Xcode 然后重新安装。
  2. 释放 Mac 上的存储空间。
  3. 连接到另一个WIFI。
  4. 禁用 VPN。

但没有运气

app-store macos-big-sur xcode13

6
推荐指数
1
解决办法
9185
查看次数

你知道 Xcode 13 中的 Vary for Traits 在哪里吗?

我在 Xcode 13 中找不到 Vary for Traits。提前感谢您的帮助!

xcode13

6
推荐指数
1
解决办法
4755
查看次数

新更新后 Xcode 13 停留在索引上

我已经清除了导出数据文件夹,清理并再次重建项目,但在索引后仍然卡住,无法在模拟器和真实设备上运行该项目。

ios swift xcode13

6
推荐指数
1
解决办法
1896
查看次数

agvtool 新营销版本在 Xcode 13 上不起作用

从 Xcode 13 开始,默认情况下没有Info.plist。相反,公共字段位于 target\xe2\x80\x99s Info 选项卡中,并在项目编辑器中构建设置。一个分开的Info.plist仅当存在其他字段时,才会将

\n

当我运行以下命令在 Jenkins 上设置 MARKETING_VERSION 时

\n
$ xcrun agvtool new-marketing-version 1.0.0\n
Run Code Online (Sandbox Code Playgroud)\n

Info.plist除非密钥存在,否则它不会对文件产生任何影响CFBundleShortVersionString。但是每次我更新目标的“信息”选项卡中的字段时,该Info.plist文件似乎都会再次重新生成并且CFBundleShortVersionString消失。

\n

因此,我想知道在这种情况下是否有关于如何MARKETING_VERSION通过命令行设置或如何使用 agvtool 的建议。任何建议将不胜感激!

\n

xcode agvtool xcode13

6
推荐指数
1
解决办法
2721
查看次数

未找到命令行工具 MacOS Monterey XCode13

I\xc2\xb4m 目前正在尝试使用终端从 mobileiron 退出打包的应用程序。

\n

当我尝试时它说:

\n

"sign_wrapped_app.sh 版本 4.7.0.0\n用法:sign_wrapped_app.sh -i [-b -e -p -s -d -o ] \n此脚本必须在安装了 Xcode 命令行工具的计算机上运行。\njonasromankiewicz@ MacBook-Pro-von-Jonas 包裹 %"

\n

我的 MacBook Pro M1 2020 上安装有 MacOS Monterey\nXcode 13 Beta,并且我从 Apple 开发者主页下载并安装了 CLT。\n我安装了最新版本的 Node、Homebrew、Ionic、Cordova。\n我尝试切换路径。我已尝试重新安装 CLT。\n还尝试了 Rosetta 方式...

\n

什么都没起作用。请帮助:D

\n

谢谢

\n

macos xcode-command-line-tools xcode13

5
推荐指数
1
解决办法
8725
查看次数

SwiftUI 3 MacOs Table单选并双击打开工作表

import SwiftUI

struct ContentView: View {
    
    @State private var items: [ItemModel] = Array(0...100).map { ItemModel(id: $0, title: "item \($0)", age: $0) }
    @State private var selection = Set<ItemModel.ID>()
    @State private var sorting = [KeyPathComparator(\ItemModel.age)]
    
    var body: some View {
        Table(items, selection: $selection, sortOrder: $sorting) {
            TableColumn("id", value: \.id) { Text("\($0.id)") }
            TableColumn("title", value: \.title)
            TableColumn("age", value: \.age) { Text("\($0.age)") }
        }
        .onChange(of: sorting) {
            items.sort(using: $0)
        }
        .font(.caption)
        .frame(width: 960, height: 540)
    }
}

struct ItemModel: Identifiable {
    var id: …
Run Code Online (Sandbox Code Playgroud)

macos xcode swiftui xcode13

5
推荐指数
2
解决办法
4508
查看次数

带有 async/await 的 Swift Playground“无法在范围内找到‘async’”

我正在尝试在 Xcode Playground 上运行这个异步函数:

import Foundation
import PlaygroundSupport

PlaygroundPage.current.needsIndefiniteExecution = true

enum NetworkingError: Error {
    case invalidServerResponse
    case invalidCharacterSet
}

func getJson() async throws -> String {
        let url = URL(string:"https://jsonplaceholder.typicode.com/todos/1")!
        let (data, response) = try await URLSession.shared.data(from: url)
        
        guard let httpResponse = response as? HTTPURLResponse,
              httpResponse.statusCode == 200 else {
                  throw NetworkingError.invalidServerResponse
              }
        
        guard let result = String(data: data, encoding: .utf8) else {
            throw NetworkingError.invalidCharacterSet
        }
        
        return result
}
    
let result = try! await getJson()
print(result)
Run Code Online (Sandbox Code Playgroud)

我收到此错误消息:

error: ForecastPlayground.playground:27:25: …
Run Code Online (Sandbox Code Playgroud)

async-await swift swift-playground swift5 xcode13

5
推荐指数
1
解决办法
3317
查看次数

我无法在 iOS 15 的 WidgetConfiguration 中添加 systemExtraLarge 系列

我想在我的应用程序中添加一个超大的小部件作为 iOS 15 支持的系列。

WidgetConfiguration的简化代码如下:

    var body: some WidgetConfiguration {
        IntentConfiguration(
            kind: "Widget",
            intent: SelectProjectIntent.self,
            provider: Provider()
        ) {
            entry in
            ProgressWidgetEntryView(entry: entry)
        }
        .configurationDisplayName("Title")
        .description("Description")
        .supportedFamilies([.systemSmall, .systemMedium, .systemLarge, .systemExtraLarge])
    }
Run Code Online (Sandbox Code Playgroud)

显然我不能只是简单地添加额外的大,因为出现以下错误: “systemExtraLarge”仅在 iOS 15.0 或更高版本的应用程序扩展中可用

但是,按照 XCode 的建议进行快速简单的可用性检查后,我收到了一个错误和几个警告。这是代码:

    var body: some WidgetConfiguration {
        
        if #available(iOSApplicationExtension 15.0, *) {
            
            IntentConfiguration(
                kind: "Widget",
                intent: SelectProjectIntent.self,
                provider: Provider()
            ) {
                entry in
                ProgressWidgetEntryView(entry: entry)
            }
            .configurationDisplayName("Title")
            .description("Description")
            .supportedFamilies([.systemSmall, .systemMedium, .systemLarge, .systemExtraLarge])
            
        } else {
            
            IntentConfiguration(
                kind: "Widget",
                intent: SelectProjectIntent.self,
                provider: Provider()
            ) …
Run Code Online (Sandbox Code Playgroud)

ios swift widgetkit ipados xcode13

5
推荐指数
1
解决办法
2057
查看次数