Boilertalk / Web3.swift

A pure swift Ethereum Web3 library
MIT License
639 stars 188 forks source link

Build error unknown package 'Web3' in dependencies of target 'MyProject' #100

Open mudilajaganios opened 3 years ago

mudilajaganios commented 3 years ago

I am getting the subject build error after adding the following dependencies to my target.

dependencies: [ .product(name: "Web3", package: "Web3") // .product(name: "Web3PromiseKit", package: "Web3"), // .product(name: "Web3ContractABI", package: "Web3"), ]),

This is my package.swift file

// swift-tools-version:5.3 // The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package( name: "myapp-sdk-swift", platforms: [ .iOS(.v10), .macOS(.v10_12) ], products: [ // Products define the executables and libraries a package produces, and make them visible to other packages. .library( name: "myapp-sdk-swift", targets: ["myapp-sdk-swift"]), ], dependencies: [ // Dependencies declare other packages that this package depends on. .package(url: "https://github.com/Boilertalk/Web3.swift.git", from: "0.5.0") ], targets: [ // Targets are the basic building blocks of a package. A target can define a module or a test suite. // Targets can depend on other targets in this package, and on products in packages this package depends on. .target( name: "myapp-sdk-swift", dependencies: [ .product(name: "Web3", package: "Web3") // .product(name: "Web3PromiseKit", package: "Web3"), // .product(name: "Web3ContractABI", package: "Web3"), ]), .testTarget( name: "myapp-sdk-swiftTests", dependencies: ["myapp-sdk-swift"]), ], swiftLanguageVersions: [.v5] )

matthewlui commented 2 years ago

This reason is relatively stupid, try not to follow the setup code in readme, instead of putting: .product(name: "Web3", package: "Web3") use .product(name: "Web3", package: "Web3.swift")