Skip to content
This repository was archived by the owner on Mar 30, 2022. It is now read-only.
This repository was archived by the owner on Mar 30, 2022. It is now read-only.

Can't run in macOS SwiftUI App #602

Description

@jonkan

I'm encountering a runtime error if I try to use TensorFlow in an SwiftUI App:

dyld: Symbol not found: _$sSo12NSFileHandleC10FoundationE9readToEndAC4DataVSgyKF
  Referenced from: /System/Library/Frameworks/SwiftUI.framework/Versions/A/SwiftUI
  Expected in: /Library/Developer/Toolchains/swift-tensorflow-RELEASE-0.12.xctoolchain/usr/lib/swift/macosx/libswiftFoundation.dylib
 in /System/Library/Frameworks/SwiftUI.framework/Versions/A/SwiftUI

Setup:

  • macOS 11.1
  • Xcode 12.4 and/or Xcode 12.2 Beta 3 (same issue)
  • Swift for TensorFlow 0.12 Release

Steps to reproduce:

  • Create a new project, chosing macOS and App. Leaving Interface and Life Cycle as default, i.e. SwiftUI.
  • Check the "Disable Library Validation"
  • If using Xcode 12.4, apply fix for "LLDB provided no error string" (#532)
  • Create a new file with the following:
import TensorFlow

func test() -> String {
    let x = Tensor<Float>([[1, 2], [3, 4]])
    return String(describing: x + x)
}
  • Run (no need to call the function)

Also, if choosing Command Line Tool instead of App, everything works as expected.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions