stree command not working after macOS update to Sierra - macos-sierra

My issues is related to:
Updated MacOs to Sierra (10.12.6)
When I type stree command to open sourcetree I get the following error
stree
objc[11289]: Objective-C garbage collection is no longer supported.

Issue is related to an old source-tree binary not getting updated for some reason. The following steps helped resolve the issue for me.
$ rm /usr/local/bin/stree
$ cp /Applications/SourceTree.app/Contents/Resources/stree /usr/local/bin/stree
$ stree # success

Related

Flutter simply showing 'sysctl -n hw.optional.arm64' returned unexpected output: ''

Not sure which details are relevant so I'll include as many as possible.
Had to upgrade flutter today and instead of working when I typed in 'flutter upgrade' into android studios terminal/Iterm2/terminal zsh I was met with the following response.
'sysctl -n hw.optional.arm64' returned unexpected output: ''
When I search for this issue the only thing i can find is this post which states that sysctl can't be found. The path does appear to be in my .zshrc but still not working. I can't use which or where sysctl as it just says 'sysctl not found'
When I try to upgrade flutter through brew (brew install --cask flutter) it downloads fine but on installing it throws the following error:
==> Purging files for version 3.3.5 of Cask flutter
Error: It seems there is already a Binary at '/opt/homebrew/bin/dart'.
I can't continue working as I need the new flutter version and it seems the web doesn't have much to show for this particular error.
I can't flutter --version, flutter doctor or anything of the sort as I just get the same message.
I'm using:
MacOS monterey 12.6 macbook air.
Android studios
Iterm2
Ohmyzsh
When I open android studios it shows me the following:
"Flutter device daemon #1 exited (exit code 1), stderr: 'sysctl -n hw.optional.arm64' returned unexpected output: '' in a pop up window.
Pubspec has been edited > get dependencies > Upgrade depenedencies: Both of which have the same error as in the title.
The current configured flutter SDK is not known to be fully supported. Please update your SDK and restart intelliJ which I think is what I've been trying to do.
This is an answer I hope will be helpful for others who have the same issue.
Other answers suggested a fix by just updating the path document (.zshrc) but this is what helped me as that did not and my paths were up to date.
Sadly, it's as simple as manually deleting all my flutter SDK files locally. Downloading them again (this time the latest one) and unzipping it into the same place. Didn't even have to update the path).
Worked a charm, issues appear to be all gone except that the dialogue in android studios is still saying that there are dependencies that need getting and upgrading (but doesn't go away even when I've run it).
I solved it by removing the old flutter SDK, downloading the latest version, and setting it up again.
it works perfectly for me!

Unable to open Code-insiders undefined symbol SHA256

I am currently unable to open code-insiders (latest build) The interface loads and then immediately closes, however there are code-insider processes left behind still running in back ground that I have to kill directly. The error in the log is: /usr/share/code-insiders/code-insiders --unity-launch --enable-crashpad: symbol lookup error: /usr/share/code-insiders/resources/app/node_modules.asar.unpacked/vscode-encrypt/build/Release/vscode-encrypt-native.node: undefined symbol: SHA256_Init I have seen similar posts that point to the libcrypt and libssh libraries and I have tried re-installing both with no change. I have also purged code and reinstalled the latest build. This still occurs if I try and launch with extensions disabled.
Any suggestions on where to search next would be appreciated.
SHA256_Init crash problem is due to the vscode-encrypt-native ELF is not linked against lcrypto so the symbols cannot be resolved properly.
You can do a quick fix:
$ find /usr/lib/ -type f -name "libcrypto.so.*"
/usr/lib/x86_64-linux-gnu/libcrypto.so.1.1
$ sudo apt instal patchelf
$ sudo patchelf --add-needed libcrypto.so.1.1 /usr/share/code-insiders/resources/app/node_modules.asar.unpacked/vscode-encrypt/build/Release/vscode-encrypt-native.node
Ref: https://github.com/microsoft/vscode/issues/142656#issuecomment-1034173634

Carthage update fail with exit code 1 when upgrade MacOs and Xcode

After upgrade your OS and/or your Xcode.
When you run
$ carthage update --platform iOS --no-use-binaries
you would get an output like:
Fetching FooLibrary
A shell task (/usr/bin/env git fetch --prune --quiet https://github.com/foodeveloper/FooLibrary.git refs/tags/:refs/tags/ +refs/heads/:refs/heads/ (launched in /Users/yourUser/Library/Caches/foo.package/dependencies/FooLibrary)) failed with exit code 1
This issue happen with Carthage 0.33.0 and Xcode 11.
To solve this issue:
First: Open your new Xcode and select the last CLI to make sure that you are using the last CLI.
Command Line Tool - Error - xcrun: error: unable to find utility "xcodebuild", not a developer tool or in PATH
Second: Please You could fix it by deleting the cache of Carthage:
rm -rf ~/Library/Caches/org.carthage.CarthageKit
source: https://github.com/ashleymills/Reachability.swift/issues/340

"${PODS_ROOT}/SwiftLint/swiftlint" causes "Command PhaseScriptExecution failed with a nonzero exit code" with Xcode 10

Updating from Xcode 10.0 beta 2 to Xcode 10.0 beta 3 I now get this error at build time for an iOS project:
sourcekit: [1:connection-event-handler:10499: 0.0000] Connection interruptsourcekit: [1:updateSemanticEditorDelay:10499: 0.0007] disabling semantic editor for 10 secondssourcekit: [1:pingService:10499: 0.0007] pinging servicesourcekitten: connection to SourceKitService restored!
Connection interrupted
Never call this for file that sourcekitd fails.: file File+Cache.swift, line 127
/Users/Coeur/Library/Developer/Xcode/DerivedData/My-App-eloayqptodupvfhbyegtkncnhcpu/Build/Intermediates.noindex/My-App.build/UAT-iphonesimulator/My-App-Debug.build/Script-379156A71D62F5C100574D04.sh: line 2: 34382 Abort trap: 6 "${PODS_ROOT}/SwiftLint/swiftlint"
Command PhaseScriptExecution failed with a nonzero exit code
Swift 4.1
CocoaPods 1.5.3
SwiftLint 0.26.0
Its because of Keychain Access.
Open Keychain Access
Right Click Login Tab
Lock Keychain Login
Right Click Login Tab again
Unlock Keychain Login
and problem solved :)
It seems to be an issue with the SwiftLint 0.26.0 script when using Xcode 10.0 beta 3 or newer.
Cause
It seems related to SwiftLint #2276, itself related to SourceKitten 0.21.0, fixed in SourceKitten 0.21.1 and SwiftLint Master.
Solution
Update to SwiftLint 0.27.0 or newer:
pod 'SwiftLint', '~> 0.27'
(and run pod update SwiftLint)
Some Framework or SDK require Code Signing.
I done code signing and resolved the problem for me.
The pod that I was using was not updated for Xcode 10, so the solution that worked for me was to remove Cocoapods from my project and then installed again (the project was created on Xcode 9).
To remove it, the easiest way is:
$ sudo gem install cocoapods-deintegrate cocoapods-clean
$ pod deintegrate
$ pod clean
After that, install the pods again.
I just restarted my Macbook and it worked.
For me adding arm64 architecture in "Build Setting -> valid architectures" resolved the issue.
I had an authentication process (outside of Xcode) running in the background which seemed to be causing this issue for me. I had the keychain dialog up asking for my password. Solution was to restart the machine.
Solution worked for me
I deleted all pod generated files and folders as listed below
Podfile.lock
Pods folder
ProjectName.xcworkspace
Again install pod for this project.
Now open .xcworkspace. Build and run...
It may cause the iOS 13 version. My error is to look at below
Assignment/Pods-Assignment-frameworks.sh: eval: line 131: unexpected EOF while looking for matching `''
Command PhaseScriptExecution failed with a nonzero exit code
Pods -> Targets Support Files -> Pods-AppName -> Pods-AppName-frameworks.sh.
Just commented particular line 131
# eval "$code_sign_cmd"
then clean and run
For me it was an issue with swiftlint. This happens when ever there are serious errors, for example forced unwrapping that swift lint validates.
The actual SwiftLint errors are not shown. Instead this “Command PhaseScriptExecution failed with a nonzero exit code” error is shown. After a bit struggle, I figured out that if your project's directory name or any its hierarchy folders have an apostrophe 's , then actual swiftlint errors or warnings are not shown even after including the runscript for it.
So I just had to rename my folders.
For example:
User -> Dave's Projects -> Git -> ProjectName
should be changed to
User -> Daves Projects -> Git -> ProjectName
This will show you errors or warnings. You can then fix the errors and hopefully the concerned error will also be fixed.
This issue resolves for me when I wait and let the project complete indexing before I do anything!
Restarting Xcode 10.1 fixed it for me; arose while updating Cocoapods ('RxSwift').
If the directory where your project is has blank spaces that problem occurs
To solve that problem add double quotes(""). For example:
"$(SRCROOT)/my framework/path"
In my case, Apple development certificate got expires.
To verify open Keychain -> My certificates -> check developer certificate is valid or not, If certificate is not valid then follow the below steps.
Open your apple developer account and create a new development certificate
Download and add it in your keychain.
Go to profiles and open your existing development profile and add the newly created certificate.
Download the fresh profile and install it.
Hope this helps you too.
I had this issue on my ionic4 app after I have used cocoapods. My issue was that in Targets->Build Phases->Embed Pods Frameworks, I had a wrong path to Pods-MyApp-frameworks.sh script correcting that path solved the issue for me.
Its because most of the time $PODS_ROOT variable doesn't set after installing pods
For me, there seems to be an issue with the swiftlint script. It was initially this, Which was what was in the doc as of the time of installation
else
echo "warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint"
fi
I resolve the issue by modifying it to
if swiftlint
then
echo "swiftlint installed"
else
echo "warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint"
fi
Not sure, this may be due to my XCode version(10.3)
I resolve the issue by rewrite the .sh file.
Xcode 10 with Swift 3.
1.rename problem.sh file and command+A then command+C.
2.vi *problem*.sh and command+V.
3.:wq! to save the new file.
Then everything will be ok.
If not ok, chmod a+x *problem*.sh and try again.
Only the following helped me.
Delete Podfile.lock
run pod install
Optional - update SwiftLint version
I had a new Macbook and got this error when trying to archive. I forgot to install cocopods in the new machine, so I did, then restarted the computer and restarted Xcode and it worked.
If you're getting
dyld: Library not loaded: /usr/local/opt/readline/lib/libreadline.7.dylib
and a red
Command PhaseScriptExecution failed with a nonzero exit code
You should install the specific version of libreadline that you need
brew install readline
brew list --versions readline
brew switch readline 0.0.0

How to install Swift package via package manager?

I am currently following the document from swift.org to play around with the new Swift Package Manager.
I cloned the demo project from Github and run the following command from terminal.
git clone https://github.com/apple/example-package-dealer.git
cd example-package-dealer
swift build
.build/debug/Dealer
While I run swift build, error arise.
<unknown>:0: error: no such file or directory: 'build'
Any idea?
I stuck for an hour. Sadly, it's just an epic fail that downloading the wrong swift package. If you want to use swift build, MAKE SURE you download the development version.
You did not add the newly installed swift to your PATH. The instructions for doing that are here.
On OS X:
export PATH=/Library/Developer/Toolchains/swift-latest.xctoolchain/usr/bin:"${PATH}"
On Linux:
export PATH=/path/to/Swift/usr/bin:"${PATH}"
Then to test it works:
swift build --version
I think it is a problem with the latest snapshot:
Ubuntu 14.04 Swift 2.2 Snapshot of January 11 contains swift-build in usr/bin
Ubuntu 14.04 Swift 2.2 Snapshot of January 25 doesn't contain swift-build in usr/bin
Besides, the January 25 release also seems to miss other files (libFoundation.so and libXCTest.so in usr/lib/swift/linux for instances).
Either there has been a structure change....or, simply, the latest snapshot had a problem ;)
While they fix the snapshot, simply take the older (January 11th) snapshot, and you should be fine.
I was facing the same issue and in my case, I recently updated my Xcode to 8.2.1 and swift 3.0 comes with it.
I was getting this log.
Ranvijay-Mac-mini:PerfectTemplate ranaranvijaysingh$ swift build
error: unable to invoke subcommand: /Library/Developer/CommandLineTools/usr/bin/swift-build (No such file or directory)
The path it was taking was incorrect. It was suppose to be:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
To change the path, run this command.
export PATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin:$PATH
And DONE.
Run : swift build again on your project and if you get this error.
xcrun: error: unable to lookup item 'PlatformPath' from command line tools installation
xcrun: error: unable to lookup item 'PlatformPath' in SDK '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk'
error: Invalid platform path
then you need to change the SDK path as well.
In my case, I had two .sdk at path
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/
MacOSX.sdk MacOSX10.12.sdk
To know what is your SDK path, run this command.
xcrun --sdk macosx --show-sdk-path
My case i got this.
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
To change it run this command.
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
and NOW DONE.
Try running swift build now.