Reputation: 137
I was able to commit the changes to my Heroku repo but when I push it it shows the following errors:
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Swift app detected
remote: -----> Using Swift 5.3 (from .swift-version file)
remote: -----> Using built-in clang (Swift 5.3)
remote: -----> Installing swiftenv
remote: -----> Installing Swift 5.3
remote: We don't have build instructions for 5.3.
remote: ! Push rejected, failed to compile Swift app.
remote:
remote: ! Push failed
I used the following commands:
$ git add .
$ git commit -am "make it better"
$ git push heroku master
I also changed the buildpack to vapor/vapor
:
heroku buildpacks:set vapor/vapor
Why is this error happening, and how can I fix it?
I have even changed the swift version by following commands
echo "5.1.3" > .swift-version
git add .
git commit -m "Done"
and pushed it but it to Heroku shows the following error
package at '/tmp/build_8e6b47bc' is using Swift tools version 5.2.0 but the installed version is 5.1.0
Upvotes: 1
Views: 475
Reputation: 137071
Swift 5.3 doesn't appear to have been released yet, and the only Vapor buildpacks that I can find don't yet support it.
I think you're using this buildpack that uses Swift version 5.1.3
in its current documentation. Try reducing your Swift version to that (by editing your .swift-version
file and committing) and redeploying.
Edit: Your new error indicates a Swift Tools version mismatch. I don't program in Swift, but it looks like this is defined by a line in your Package.swift
file and that it is related to your Swift version:
The very first line of a package manifest indicates the Swift tools version required. This specifies the minimum version of Swift that the package supports. The Package description API may also change between Swift versions, so this line ensures Swift will know how to parse your manifest.
Try changing
// swift-tools-version:5.2
to
// swift-tools-version:5.1
then commit and redeploy.
I also recommend making sure that you are using the same version of Swift locally for development as you're targeting on the server.
Upvotes: 4