Running Swift on Heroku: error while loading shared libraries - heroku

I'm trying to deploy a Swift application to Heroku. I'm using Swift 5.0.2 and Heroku Stack 18. This application was previously working with Swift 3.0 and Heroku Stack 16.
I'm not sure what this error is even exactly telling me so I don't quite know where to start to fix it up. I'm using a fork of the Heroku build pack since it didn't even support their own Stack 18. https://github.com/onuniverse/heroku-buildpack-swift
2019-07-19T00:25:55.906961+00:00 heroku[web.1]: State changed from crashed to starting
2019-07-19T00:25:57.109052+00:00 heroku[web.1]: Starting process with command `Unibot --bind 0.0.0.0:58139`
2019-07-19T00:25:58.829639+00:00 heroku[web.1]: State changed from starting to crashed
2019-07-19T00:25:58.761232+00:00 app[web.1]: Unibot: error while loading shared libraries: libicui18nswift.so.61: cannot open shared object file: No such file or directory

Unibot: error while loading shared libraries: libicui18nswift.so.61:
cannot open shared object file: No such file or directory
The last line of the log suggests that the buildpack you used does not copy all the shared libraries from the Swift toolchain correctly, either because it's looking for predefined library names, or does not take symlinks into account – which were introduced with Swift 5.0.
I would recommend trying again with the vapor/vapor buildpack (available as source here), which supports Swift 5.0.2 and the heroku-18 stack out of the box.
Despite its name, it does not contain anything Vapor-specific and works with any Swift project.

Related

Runtime errors trying to run a macOS AudioKit app

I'm having a lot of trouble getting a macOS audiokit project to run properly.
I've cloned the repo and opened one of the example projects - examples/macOS/HelloWorld. It builds fine, with no errors, but then when I try to run it I get this error:
dyld: Library not loaded: #rpath/AudioKitUI.framework/Versions/A/AudioKitUI
which is reasonable since the readme says that the UI Framework has to listed in the embedded binaries list. So I update my project to include AudioKitUI.framework in the embedded binaries list, rebuild and run, then I get a bunch of errors like this:
Class <AudiokitUI classes> is implemented in both <.../Build/Products/Debug/HelloWorld.app/Contents/Frameworks/AudioKitUI.framework/Versions/A/AudioKitUI> and <.../Build/Products/Debug/HelloWorld.app/Contents/MacOS/HelloWorld>
I'm using:
xcode 10.0
macOS v10.13.6
I've just installed xcode for this project, and I haven't changed any of the defaults.

Xamarin.Mac Could not link assemblies. Reason: Object reference not set to an instance of an object

I have a Xamarin.Mac application that I can't get to build after upgrading Xamarin.Mac. The project builds on Xamarin.Mac 2.8.2.22, but after upgrading to 3.0.0.393 (also tried 2.10.0.99) I get this error during the '_CompileToNative' step of the build:
Error MM2001: Could not link assemblies. Reason: Object reference not set to an instance of an object (MM2001) (MyApp)
In the build output I can see the LinkMode is set to None and I've also tried using the -nolink argument, but still getting this link assemblies error. My understand is that there shouldn't be any linking on Xamarin.Mac, so why is it even attempting the linking?
The project uses .NET Framework v4.5 with the Unified API and Xcode is at 8.2.1.
You aren't necessarily crashing inside any linking step, mmp is the packager tool which creates your native launcher application and your bundle.
MMP should never crash like that, full stop. That is a bug that needs to be fixed.
Please go into your project configuration and add
-v -v -v -v -v
to your additional mmp arguments, do another build, and file a bug (preferably with a project reproducing the error) here.

GoogleCast.framework v2.10 error

I got this error when trying to update with the latest framework v2.10:
Frameworks/GoogleCast.framework: unsealed contents present in the root directory of an embedded framework
Command /usr/bin/codesign failed with exit code 1
Any suggestions?
Edit:
This is iOS platform using latest version of Xcode v7.1. The project uses Objective-C. I just downloaded the 2.10 zip file from Google site and replaced a single GoogleCast.framework (from my current working project with older version of cast framework) file after unzipped.
I noticed 2.1 also came with "CastFrameworkAssets.xcassets" package. The error I got will occur with or without including CastFrameworkAssets.xcassets in my project.
I think this may be a bug in the SDK. There is a GoogleCastResources.bundle in the root of the framework, rather than the Resources folder. Try moving that out of the framework root and into your app directly.

Cloning a git repo in Xcode means unit test do not run

I have worked on machine A on an Xcode project, which is linked to a bitbucket git repo. All up-to-date and committed, unit tests run fine.
Now I want to work on it on machine B. I fire up Xcode, clone the repository, and all the files are there in my project. I press cmd-U to run the unit tests, and they 'pass' in lightning speed, or rather, they do not run at all. This is the error message I get:
objc[6434]: GC: forcing GC OFF because OBJC_DISABLE_GC is set
2013-06-11 10:20:05.935 otest[6434:303] The test bundle at /Users/oliver/Library/Developer/Xcode/DerivedData/TextToolsSystem-celmxjqlddjrjvblrklrnvdpytux/Build/Products/Debug/TextToolsSystemTests.octest could not be loaded because a link error occurred. It is likely that dyld cannot locate a framework framework or library that the the test bundle was linked against, possibly because the framework or library had an incorrect install path at link time.
2013-06-11 10:20:05.942 otest[6436:203] *** NSTask: Task create for path '
TextToolsSystemTests' failed: 22, "Invalid argument". Terminating temporary process.
The project does not use any additional frameworks or libraries, and works fine on machine A. A listing of the mentioned directory yields
total 192
-rwxr-xr-x 1 oliver staff 96604 11 Jun 10:20 TextToolsSystemTests
and that file is a Mach-O 64-bit bundle x86_64.
Machine A: MBP, OS X 10.8.2, Xcode 4.6.2
Machine B: MBA, OS X 10.7.5, Xcode 4.6.2
Building the project gives no error (it hasn't got an executable yet that could be run)
Are there any settings that I need to adjust to make it work which the cloning did not carry over?
OK, after some digging I found the solution:
I used otool -L to list the required libraries that the target was referencing (thanks to this question for reference).
Then I manually added in all the libraries/frameworks, even though they're CoreFoundation etc, which would normally not be required. However, it also included libobjc.A.dylib.
Now I was getting a different error, dyld: lazy symbol binding failed: Symbol not found: _objc_setProperty_atomic, which was expected in that library.
I then searched for that error message, and it lead me to this question, which had no accepted answer, but in a comment stated The problem for me was that I had a framework included with deployment target 6.0. After having recompiled it with deployment target 5.0, resulting in all projects and sub-projects being built with deployment target 5.0, everything worked.
I checked the OS X deployment target, and it was set to 10.8–but machine B only runs 10.7! So I changed the target to 10.7, and then it worked.
So, to summarise: the issue was that the deployment target was set to an OS revision which was higher than that of the current machine. Duh!

Shared Library on Mac OSX and QT

Does anyone know how to get rid of this problem? I am using a Mac for developing for Maemo 5.
Killing remote process(es)...
Starting remote process...
Remote process started.
/opt/Blue/bin/Blue: error while loading shared libraries: libQtConnectivity.so.1: cannot open shared object file: No such file or directory
Finished running remote process. Exit code was 127.
I have followed the instructions here:
http://www.developer.nokia.com/Community/Wiki/Latest_Qt_and_Qt_mobility_evaluation_on_Maemo
I think I just need to make sure my mac links to that file, how to do that?
Building the package is fine but I get the error when I try to deploy it on my N900 phone. The error appears in the QTCreator output.

Resources