Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PackageDescription not found in Package.swift #24

Open
geertberkers opened this issue Jan 22, 2020 · 1 comment
Open

PackageDescription not found in Package.swift #24

geertberkers opened this issue Jan 22, 2020 · 1 comment

Comments

@geertberkers
Copy link

I am trying to opening and build the project. But I'm unable to get it building.
Swift Toolchain version: swift-android-5.0-8

Screenshot 2020-01-22 12 29 06

And in https://github.com/readdle/swift-android-architecture I get the following errors:

> Task :app:swiftBuildArm64Debug FAILED
Swift PM flags: --configuration debug -Xswiftc -DDEBUG
/Users/geert/Projects/SwiftAndroid/swift-android-architecture/todoapp/app/src/main/swift: error: manifest parse error(s):
/Users/geert/Projects/SwiftAndroid/swift-android-architecture/todoapp/app/src/main/swift/Package.swift:55:15: error: 'init(name:pkgConfig:providers:products:dependencies:targets:swiftLanguageVersions:cLanguageStandard:cxxLanguageStandard:)' is unavailable
let package = Package(
              ^~~~~~~
PackageDescription.Package:27:12: note: 'init(name:pkgConfig:providers:products:dependencies:targets:swiftLanguageVersions:cLanguageStandard:cxxLanguageStandard:)' was introduced in PackageDescription 4.2
    public init(name: String, pkgConfig: String? = nil, providers: [PackageDescription.SystemPackageProvider]? = nil, products: [PackageDescription.Product] = [], dependencies: [PackageDescription.Package.Dependency] = [], targets: [PackageDescription.Target] = [], swiftLanguageVersions: [PackageDescription.SwiftVersion]? = nil, cLanguageStandard: PackageDescription.CLanguageStandard? = nil, cxxLanguageStandard: PackageDescription.CXXLanguageStandard? = nil)
           ^
/Users/geert/Projects/SwiftAndroid/swift-android-architecture/todoapp/app/src/main/swift/Package.swift:65:10: error: 'target(name:dependencies:path:exclude:sources:publicHeadersPath:)' is unavailable
        .target(name: packageName, dependencies: ["java_swift", "JavaCoder"])
         ^~~~~~
PackageDescription.Target:34:24: note: 'target(name:dependencies:path:exclude:sources:publicHeadersPath:)' was introduced in PackageDescription 4
    public static func target(name: String, dependencies: [PackageDescription.Target.Dependency] = [], path: String? = nil, exclude: [String] = [], sources: [String]? = nil, publicHeadersPath: String? = nil) -> PackageDescription.Target
                       ^
/Users/geert/Projects/SwiftAndroid/swift-android-architecture/todoapp/app/src/main/swift/Package.swift:41:10: error: 'target(name:dependencies:path:exclude:sources:publicHeadersPath:)' is unavailable
        .target(
         ^~~~~~
PackageDescription.Target:34:24: note: 'target(name:dependencies:path:exclude:sources:publicHeadersPath:)' was introduced in PackageDescription 4
    public static func target(name: String, dependencies: [PackageDescription.Target.Dependency] = [], path: String? = nil, exclude: [String] = [], sources: [String]? = nil, publicHeadersPath: String? = nil) -> PackageDescription.Target
                       ^

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:swiftBuildArm64Debug'.
> Process 'command '/Users/geert/android/swift-android-current/build-tools/1.9.6-swift5/swift-build'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 2s
@andriydruk
Copy link
Member

andriydruk commented Feb 28, 2020

Hi, please check that you have proper version swift from step 2/
https://github.com/readdle/swift-android-toolchain

Call swift --version in your terminal app

Apple Swift version 5.0.1 (swiftlang-1001.0.82.4 clang-1001.0.46.5)
Target: x86_64-apple-darwin19.0.0

You can check the proper setup in our CI script
#23

  - name: Install Swift toolchain 5.0.3 
 run: wget https://swift.org/builds/swift-5.0.3-release/xcode/swift-5.0.3-RELEASE/swift-5.0.3-RELEASE-osx.pkg;
   sudo installer -pkg swift-5.0.3-RELEASE-osx.pkg -target /

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants