我正在尝试构建一个使用 lld 的项目,但出现以下错误:
invalid linker name in argument '-fuse-ld=lld'
Run Code Online (Sandbox Code Playgroud)
我已经使用“brew install llvm”安装了 llvm,但它仍然无法正常工作。
我尝试在 Apple App Store 上使用 Kotlin Multiplatform 分发 iOS 应用程序时遇到问题:
\n\n\n\n\n错误 ITMS-90171:“无效的捆绑结构 - 不允许二进制文件 \'Smiledu_app.app/Frameworks/shared.framework/shared\'。您的应用程序可以\xe2\x80\x99t 包含独立的可执行文件或库,除了支持的捆绑包的有效 CFBundleExecutable。有关 iOS 应用程序捆绑包结构的信息,请参阅https://developer.apple.com/go/?id=bundle-struct上的捆绑包编程指南。”
\n
我检查它在“构建阶段”->“复制捆绑资源”中不存在
\n\n这是我的 build.gradle.kts
\nimport org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget\n\nplugins {\n    kotlin("multiplatform")\n    kotlin("native.cocoapods")\n    kotlin("plugin.serialization")\n    id("com.android.library")\n    id("kotlin-android-extensions")\n    id("com.squareup.sqldelight")\n}\n\nrepositories {\n    gradlePluginPortal()\n    google()\n    jcenter()\n    mavenCentral()\n    maven {\n        url = uri("https://dl.bintray.com/kotlin/kotlin-eap")\n    }\n}\n\ndependencies {\n    implementation("androidx.lifecycle:lifecycle-livedata-ktx:2.2.0")\n}\n\nconfigurations {\n    create("compileClasspath")\n}\n\nandroid {\n    compileSdkVersion(29)\n    sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")\n    defaultConfig {\n        minSdkVersion(24)\n        targetSdkVersion(29)\n        versionCode = 1\n        versionName = "1.0"\n    }\n    buildTypes {\n        getByName("release") {\n            isMinifyEnabled = false\n        }\n …Run Code Online (Sandbox Code Playgroud) 尝试在 iOS 12 及更低版本上启动 Xamarin.iOS 应用程序时出现以下错误(iOS 13 及更高版本确实可以毫无问题地启动应用程序):
调试输出:
error HE0042: Could not launch the app 'com.companyname.App1' on the device 'iOS 12.2 (16E226) - iPhone 8 Plus': The request to open "com.companyname.App1" failed.
Run Code Online (Sandbox Code Playgroud)
模拟器系统.日志
com.apple.CoreSimulator.SimDevice.B80099F4-F084-4872-A08A-87BD762045BF[2469] (UIKitApplication:com.companyname.App1[0x3536][2491][3415]): removing service since it exited with consistent failure - OS_REASON_EXEC
Run Code Online (Sandbox Code Playgroud)
此错误甚至发生在使用 VS for Mac 或 Rider 新生成的应用程序上。
我尝试过但没有任何结果的事情:
删除模拟器中的所有内容和设置(https://forums.xamarin.com/discussion/65978/debugger-wont-start-app-on-ios-device)
重新安装 CoreSimulator(Xamarin.iOS:Visual Studio 2019 更新后无法运行)
清理项目,删除 bin 和 obj 文件夹并重建项目
有没有人遇到过同样的问题,你是如何解决的?
谢谢!
我正在用来yarn安装包括asset-hash在内的软件包,它依赖于Metrohash。
我运行时经常出现以下错误:
\nyarn install v1.22.10\n[1/4]   Resolving packages...\n[2/4]   Fetching packages...\n[3/4]   Linking dependencies...\n[4/4]   Building fresh packages...\n[-/11] \xe2\xa0\xa0 waiting...\n[10/11] \xe2\xa0\xa0 metrohash\nerror /Users/johndoe/Projects/my-project/node_modules/metrohash: Command failed.\nExit code: 1\nCommand: node-gyp rebuild\nArguments:\nDirectory: /Users/johndoe/Projects/my-project/node_modules/metrohash\nOutput:\ngyp info it worked if it ends with ok\ngyp info using node-gyp@3.8.0\ngyp info using node@15.10.0 | darwin | arm64\ngyp info spawn /usr/bin/python2\ngyp info spawn args [\ngyp info spawn args   \'/Users/johndoe/Projects/my-project/node_modules/node-gyp/gyp/gyp_main.py\',\ngyp info spawn args   \'binding.gyp\',\ngyp info spawn args   \'-f\',\ngyp info spawn args   \'make\',\ngyp info spawn args   \'-I\',\ngyp info …Run Code Online (Sandbox Code Playgroud) 使用故事板时,我们可以通过使用以下方式以编程方式单击按钮或字段
@IBOutlet weak var negativeButton: UIButton!
negativeButton.sendActions(for: .touchUpInside)
Run Code Online (Sandbox Code Playgroud)
如何使用 SwiftUI 重新创建相同的内容?
在我的应用程序中,我有一个可向左或向右拖动的可滑动卡片视图。
当用户向左或向右拖动卡片时,卡片的水平偏移量就会更新。当用户释放拖动时,卡片将移出屏幕(向左或向右,取决于拖动方向),或者如果水平偏移未超过阈值,卡片将返回到初始位置。
它工作得很好,但如果用户在拖动时用另一根手指触摸卡片视图,然后将手指移离屏幕,卡片位置就会冻结,并且它不会移出屏幕或返回到初始位置。我调试了代码,结果发现在这种情况下该DragGesture().onEnded事件不会触发。
我正在寻找有关如何检测这种情况的任何提示。
这是代码:
如果我有类似isTouchingScreen状态的东西,我就能解决这个问题。
编辑:这是一个问题显现出来的最小示例。
import SwiftUI
struct ComponentPlayground: View {
    @State private var isDragging: Bool = false
    @State private var horizontalOffset: CGFloat = .zero
    
    var background: Color {
        if abs(horizontalOffset) > 100 {
            return horizontalOffset < 0 ? Color.red : Color.green
        } else {
            return Color.clear
        }
    }
    
    var body: some View {
        GeometryReader { geometry in
            Color.white
                .cornerRadius(15)
                .shadow(color: Color.gray, radius: 5, x: 2, y: 2)
                .overlay(background.cornerRadius(15))
                .rotationEffect(.degrees(Double(horizontalOffset / 10)), anchor: .bottom) …Run Code Online (Sandbox Code Playgroud) 我的 SwiftUI 预览将一个视图显示为 3 个不同的预览屏幕,它应该是一个具有组合视图的屏幕......
我究竟做错了什么?
谢谢你!
struct SignupSelfie: View {
    @ObservedObject var signupImagesViewModel = SignupNavigationViewModel()
    @State private var isValid = false
        
    var body: some View {
      
        VStack {
           Button("capture") { /* action code here */ }
              .background(
                  NavigationLink("", destination: SignupIdView(), isActive: $isValid)
                )
            }.navigationBarBackButtonHidden(true)
            Spacer()
            Text("capture selfie")
        }
}
struct SignupSelfie_Previews: PreviewProvider {
    static var previews: some View {
        SignupSelfie()
    }
}
Run Code Online (Sandbox Code Playgroud) 为什么使用 SwiftUI 进行发行版构建会失败?
我将 SwiftUI 添加到我的 iOS 10+ 项目中,并使用@available(iOS 13.0, *)前缀在本地构建它,但是当我尝试构建项目以进行分发时,构建失败并出现以下错误:
在范围内找不到类型“UIHostingController”
Text我的项目中的其他 SwifUI 类型( 、View、等)也会出现相同的错误Font。
我可以从 Xcode UI 看到代码覆盖率。我可以导航到文件夹中的.xcresult文件和Coverage.profdata文件DerivedData,但这些文件不是人类可读的。如何从这些文件中提取代码覆盖率?
我想使用 SwiftUI 在 UITextView 中呈现文本。我正在使用 UIViewRepresentable 并在宽度超出滚动视图的边界时遇到问题。我希望是否将文本换行,但它只是在一根长线上继续,并且左侧和右侧不可见:
这是我的代码:
struct ContentView: View {
    
    var messages = ["here is some long text to show the textView is not wrapping it's content"]
    
    var body: some View {
        GeometryReader { geometry in
            VStack(spacing: 0) {
                ScrollView(.vertical) {
                    ScrollViewReader { scrollView in
                        ZStack {
                            LazyVStack {
                                ForEach(messages, id: \.self) { message in
                                    TextView(text: message)
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
struct TextView: UIViewRepresentable {
    
    var text: String
     
    func makeUIView(context: Context) -> UITextView …Run Code Online (Sandbox Code Playgroud) xcode ×10
ios ×6
swiftui ×5
swift ×4
app-store ×1
apple-m1 ×1
kotlin ×1
mono ×1
node-gyp ×1
node.js ×1
storyboard ×1
uitextview ×1
xamarin ×1
xamarin.ios ×1