ios build error on codenameone with braintree payments - ios

Here is a part of logs from cn1 build server
Executing: /usr/local/bin/pod install Analyzing dependencies
[!] Unable to satisfy the following requirements:
- `BraintreeDropIn` required by `Podfile`
Specs satisfying the `BraintreeDropIn` dependency were found, but they required a higher minimum deployment target.
[!] `<PBXFrameworksBuildPhase UUID=`0F634E9E18E9ABBC002F3D1D`>` attempted to initialize an object with an unknown UUID. `0F634EA418E9ABBC002F3D1D` for attribute: `files`. This can be the result of a merge and the unknown UUID is being discarded.
[!] `<PBXResourcesBuildPhase UUID=`0F634E9F18E9ABBC002F3D1D`>` attempted to initialize an object with an unknown UUID. `0F634EAD18E9ABBC002F3D1D` for attribute: `files`. This can be the result of a merge and the unknown UUID is being discarded.
Failed to exec cocoapods. Trying to update master repo...
Executing: /usr/local/bin/pod repo update Updating spec repo `dwild`
$ /usr/bin/git -C /Users/administrator/.cocoapods/repos/dwild fetch origin --progress
$ /usr/bin/git -C /Users/administrator/.cocoapods/repos/dwild rev-parse --abbrev-ref HEAD
master
$ /usr/bin/git -C /Users/administrator/.cocoapods/repos/dwild reset --hard origin/master
HEAD is now at f0a287f Try even bigger version
Updating spec repo `dwild-1`
$ /usr/bin/git -C /Users/administrator/.cocoapods/repos/dwild-1 fetch origin --progress
$ /usr/bin/git -C /Users/administrator/.cocoapods/repos/dwild-1 rev-parse --abbrev-ref HEAD
master
$ /usr/bin/git -C /Users/administrator/.cocoapods/repos/dwild-1 reset --hard origin/master
HEAD is now at f0a287f Try even bigger version
Updating spec repo `googlemaps`
$ /usr/bin/git -C /Users/administrator/.cocoapods/repos/googlemaps fetch origin --progress
$ /usr/bin/git -C /Users/administrator/.cocoapods/repos/googlemaps rev-parse --abbrev-ref HEAD
master
$ /usr/bin/git -C /Users/administrator/.cocoapods/repos/googlemaps reset --hard origin/master
HEAD is now at 97abfa7 backgroundColors fix (#163)
Updating spec repo `littlemonkeyltd`
$ /usr/bin/git -C /Users/administrator/.cocoapods/repos/littlemonkeyltd fetch origin --progress
$ /usr/bin/git -C /Users/administrator/.cocoapods/repos/littlemonkeyltd rev-parse --abbrev-ref HEAD
master
$ /usr/bin/git -C /Users/administrator/.cocoapods/repos/littlemonkeyltd reset --hard origin/master
HEAD is now at e7db135 update podspec
Updating spec repo `master`
$ /usr/bin/git -C /Users/administrator/.cocoapods/repos/master fetch origin --progress
remote: Counting objects: 495, done.
than I setup build hint ios.deployment_target to 8.0 and I got error just little bit different from the previous one:
Executing: /usr/local/bin/pod init Executing: /usr/local/bin/pod install Analyzing dependencies
[!] CocoaPods could not find compatible versions for pod "BraintreeDropIn":
In Podfile:
BraintreeDropIn
Specs satisfying the `BraintreeDropIn` dependency were found, but they required a higher minimum deployment target.
Failed to exec cocoapods. Trying to update master repo...
Executing: /usr/local/bin/pod repo update Updating spec repo `dwild`
$ /usr/bin/git -C /Users/administrator/.cocoapods/repos/dwild fetch origin --progress
$ /usr/bin/git -C /Users/administrator/.cocoapods/repos/dwild rev-parse --abbrev-ref HEAD
master
$ /usr/bin/git -C /Users/administrator/.cocoapods/repos/dwild reset --hard origin/master
HEAD is now at f0a287f Try even bigger version
Updating spec repo `dwild-1`
$ /usr/bin/git -C /Users/administrator/.cocoapods/repos/dwild-1 fetch origin --progress
$ /usr/bin/git -C /Users/administrator/.cocoapods/repos/dwild-1 rev-parse --abbrev-ref HEAD
master
$ /usr/bin/git -C /Users/administrator/.cocoapods/repos/dwild-1 reset --hard origin/master
HEAD is now at f0a287f Try even bigger version
Updating spec repo `master`
$ /usr/bin/git -C /Users/administrator/.cocoapods/repos/master fetch origin --progress
remote: Counting objects: 758
remote: Counting objects: 1972, done.
so right now i don't really know where the problem could be. It does not look like increasing deployment target could help because I run build for target 10.0 and I got same error.

This is a regression in the current braintree integration due to changes in the cocoapod from braintree. I've had it on my fix list but I've been a bit busy so I'll try to do that over the weekend and post an update here when I'm done.
There are two potential fixes:
Currently the pod doesn't specify a version which is why this broke. Braintree released an update and everything stopped working. I can just specify a slightly older version and it will start working again.
We can update to use the new xcode 9.2 support - I think that's the way forward but it's new and I have stability concerns
I'll probably go with the first approach for now.

Related

Ruby + Alpine + Docker: git cannot be found when it's installed?

I have a Rails App using Ruby 3 that I deploy using Docker. In my Gemfile I am installing the gem sunspot_rails via github, as the latest official release does not work with Ruby 3:
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
gem 'sunspot_rails', github: 'sunspot/sunspot', glob: 'sunspot_rails/*.gemspec'
In my Production Dockerfile I have a stage which installs the required Gems:
#####################################
# Backend Dependencies
#####################################
FROM ruby:3.0.2-alpine3.14 AS vendor
RUN apk add --no-cache \
sqlite-dev postgresql-dev \
git build-base
# Install backend packages
COPY Gemfile Gemfile.lock ./
RUN bundle config set --local deployment "true" && \
bundle config set --local without "development,test" && \
bundle install
On my local machine, this works fine.
However, when I try to build the image in my CI/CD Pipeline (using drone), I get an error implying that git could not be found:
Fetching https://github.com/sunspot/sunspot.git
Retrying `git clone https://github.com/sunspot/sunspot.git /vendor/bundle/ruby/3.0.0/cache/bundler/git/sunspot-cb781ed3afb1e1091992c51d2c44d880bb461de8 --bare --no-hardlinks --quiet` at / due to error (2/4): Errno::ENOENT No such file or directory - git
Retrying `git clone https://github.com/sunspot/sunspot.git /vendor/bundle/ruby/3.0.0/cache/bundler/git/sunspot-cb781ed3afb1e1091992c51d2c44d880bb461de8 --bare --no-hardlinks --quiet` at / due to error (3/4): Errno::ENOENT No such file or directory - git
Retrying `git clone https://github.com/sunspot/sunspot.git /vendor/bundle/ruby/3.0.0/cache/bundler/git/sunspot-cb781ed3afb1e1091992c51d2c44d880bb461de8 --bare --no-hardlinks --quiet` at / due to error (4/4): Errno::ENOENT No such file or directory - git
According to the logs, git was successfully installed the step before.
I bumped into the same issue with Ruby 3.0.2 and Alpine 3.14 image. Still waiting for CI upgrade, but I locally it works with latest Docker. Alpine requires at least Docker 20.10.0. Check if CI runs recent Docker, kernel or something else like Gitlab runner.
Upgrade to a newer or different version of docker. 22.06.0-beta.0 was the next newer one for me.
In my specific case, I was trying to build a ruby:2.7.5-alpine based docker image on CircleCI. I was getting the same error, Errno::ENOENT No such file or directory - git when git was clearly installed in the Dockerfile step immediately before bundle install. It was working locally.
The docker build command is run inside of a container on CircleCI. I had chosen the latest stable docker image version docker:20.10.17-git for the container.
After reading Ivan's answer to this question, I tried a newer docker version. The only newer image listed on Docker's official images was docker:22.06.0-beta.0-git. Switching to this new image immediately fixed my problem.

original brew update Error needs to run git fetch --unshallow, but got another git fatal

$ brew update
Error: homebrew-core is a shallow clone. To `brew update` first run:
git -C "/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core" fetch --unshallow
I tried to run above command: git ... --unshallow
but I got another error:
fatal: dumb http transport does not support shallow capabilities
$ brew -v
Homebrew 2.6.0-104-g24f7898
Homebrew/homebrew-core (git revision b1ef15; last commit 2020-12-05)
Homebrew/homebrew-cask (git revision 443e7; last commit 2020-08-27)
Anyone can help?
I dug a little after trying to deal with the git repo, but the simplest thing that fixed it for me was untapping and then retapping the casks repo
brew untap homebrew/cask
brew tap homebrew/cask
that put everything back in order.
I haven't RTFM'd lately, but I'm guessing this has something to do with how casks seem to be moving into the main homebrew repo (or at least that's how it seems as a naive user).
I tried to run:
$ git -C "/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core" fetch
then:
$ git -C "/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core" fetch --unshallow
brew update seems OK now.
In my case I was getting this
$ brew update
ERROR: Repository not found.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Error: Fetching /usr/local/Homebrew/Library/Taps/myf/homebrew-formulas failed!
Notice the myf/homebrew-formulas in the last line.
This is one of my old repos not accessible anymore.
I got it solved with
$ brew untap myf/homebrew-formulas
Untapping myf/formulas...
Untapped 5 formulae (37 files, 63KB).
Other commands I tried
$ brew upgrade
$ brew update-reset
$ brew doctor

How can I downgrade Homebrew to an older version?

Currently I have the latest version 2.2.17, I want to downgrade to version 2.2.12.
Brew does not have a downgrade option, just an upgrade. Is the process to uninstall brew and re-install it again?
If you used the normal installation way via the install script:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
Then take a look at the brew install script (it has its own repo).
It downloads the actual Homebrew repo to /usr/local/Homebrew.
...
HOMEBREW_PREFIX="/usr/local"
HOMEBREW_REPOSITORY="/usr/local/Homebrew"
...
BREW_REPO="https://github.com/Homebrew/brew"
...
ohai "Downloading and installing Homebrew..."
(
cd "${HOMEBREW_REPOSITORY}" >/dev/null || return
# "git remote add" will fail if the remote is defined in the global config
execute "git" "config" "remote.origin.url" "${BREW_REPO}"
execute "git" "config" "remote.origin.fetch" "+refs/heads/*:refs/remotes/origin/*"
...
execute "ln" "-sf" "${HOMEBREW_REPOSITORY}/bin/brew" "${HOMEBREW_PREFIX}/bin/brew"
...
}
...
==> This script will install:
/usr/local/bin/brew
/usr/local/share/doc/homebrew
/usr/local/share/man/man1/brew.1
/usr/local/share/zsh/site-functions/_brew
/usr/local/etc/bash_completion.d/brew
/usr/local/Homebrew
...
The script installs the latest copy of the Homebrew repo. So the answer to "Is the process to uninstall brew and re-install it again?" would be a "NO". Instead, install it first normally, and then after, go over to /usr/local/Homebrew and checkout the version you want.
~$ cd /usr/local/Homebrew
Homebrew$ brew --version
Homebrew 2.3.0
Homebrew/homebrew-core (git revision d41d92; last commit 2020-05-29)
Homebrew$ git fetch --tags
Homebrew$ git checkout 2.2.12
Note: switching to '2.2.12'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:
git switch -c <new-branch-name>
Or undo this operation with:
git switch -
Turn off this advice by setting config variable advice.detachedHead to false
HEAD is now at 2ae26808a Merge pull request #7301 from Bo98/cmake-sdkroot
Homebrew$ brew --version
Homebrew 2.2.12
Homebrew$ cd /usr/local/bin
bin$ ./brew --version
Homebrew 2.2.12
Homebrew/homebrew-core (git revision d41d92; last commit 2020-05-29)
I recommend doing a brew doctor after just to make sure everything's still OK.
Then, unfortunately, Homebrew always auto-updates itself every time you install something. So it will always update the repo at /usr/local/Homebrew up again to the latest version. You can disable that by exporting HOMEBREW_NO_AUTO_UPDATE as mentioned here https://github.com/Homebrew/brew/issues/1670.
~$ export HOMEBREW_NO_AUTO_UPDATE=1
~$ brew install python#3.8
You'll need to create an alias or auto-export that env var to your bash_profile (or whatever is the equivalent for the terminal you use), so that it takes effect every time you use brew.

Elastic Beanstalk AWS Rails Bundle Install Failure

I'm trying to deploy my rails app using AWS and Elastic Beanstalk. My deployment worked but the health is at a 'red' status - error 11 (bundle install failed).
I tried:
$ gem update bundler
$ bundle package --all
Still the same error.
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
# ruby "2.4.1"
+ '[' -d /var/app/ondeck/vendor/cache ']'
+ bundle install
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and
installing your bundle as root will break this application for all non-root
users on this machine.
Warning: the running version of Bundler (1.16.0) is older than the version that created the lockfile (1.16.1). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.
Fetching gem metadata from https://rubygems.org/.........
Fetching https://github.com/mshibuya/remotipart.git
sh: git: command not found
Retrying `git clone 'https://github.com/mshibuya/remotipart.git' "/opt/rubies/ruby-2.4.3/lib/ruby/gems/2.4.0/cache/bundler/git/remotipart-f9606ede17c5ca255592b042ebded6ea195ac779" --bare --no-hardlinks --quiet` due to error (2/4): Bundler::Source::Git::GitCommandError Git error: command `git clone 'https://github.com/mshibuya/remotipart.git' "/opt/rubies/ruby-2.4.3/lib/ruby/gems/2.4.0/cache/bundler/git/remotipart-f9606ede17c5ca255592b042ebded6ea195ac779" --bare --no-hardlinks --quiet` in directory /var/app/ondeck has failed.sh: git: command not found
Retrying `git clone 'https://github.com/mshibuya/remotipart.git' "/opt/rubies/ruby-2.4.3/lib/ruby/gems/2.4.0/cache/bundler/git/remotipart-f9606ede17c5ca255592b042ebded6ea195ac779" --bare --no-hardlinks --quiet` due to error (3/4): Bundler::Source::Git::GitCommandError Git error: command `git clone 'https://github.com/mshibuya/remotipart.git' "/opt/rubies/ruby-2.4.3/lib/ruby/gems/2.4.0/cache/bundler/git/remotipart-f9606ede17c5ca255592b042ebded6ea195ac779" --bare --no-hardlinks --quiet` in directory /var/app/ondeck has failed.sh: git: command not found
Retrying `git clone 'https://github.com/mshibuya/remotipart.git' "/opt/rubies/ruby-2.4.3/lib/ruby/gems/2.4.0/cache/bundler/git/remotipart-f9606ede17c5ca255592b042ebded6ea195ac779" --bare --no-hardlinks --quiet` due to error (4/4): Bundler::Source::Git::GitCommandError Git error: command `git clone 'https://github.com/mshibuya/remotipart.git' "/opt/rubies/ruby-2.4.3/lib/ruby/gems/2.4.0/cache/bundler/git/remotipart-f9606ede17c5ca255592b042ebded6ea195ac779" --bare --no-hardlinks --quiet` in directory /var/app/ondeck has failed.sh: git: command not found
Git error: command `git clone 'https://github.com/mshibuya/remotipart.git'
"/opt/rubies/ruby-2.4.3/lib/ruby/gems/2.4.0/cache/bundler/git/remotipart-f9606ede17c5ca255592b042ebded6ea195ac779"
--bare --no-hardlinks --quiet` in directory /var/app/ondeck has failed.
You need to install git.
You can create a file .ebextensions/git.config in your rails app:
packages:
yum:
git: []
Then try to deploy again
By default, the Load Balancer target group uses "/" for the health check. Make sure your rails app responses to that endpoint with 200 status or you can update the health check path to a relevant one.

Pod from github not working

I forked CBZSplashView and I'd like to use it in my own project.
To be sure that the problem doesn't come from me, I create a Xcode project from scratch.
My project Podfile contains one line :
pod 'CBZSplashView', :git=> 'git#github.com:rvirin/CBZSplashView.git', :branch => 'remy'
When I run pod install or pod update I've got the original version of the pod - not my fork.
What I'm doing wrong?
The :git parameter overrides the source of the podspec.
I tried to modify the podspec to indicate that the source files are now on my repository, but didn't work either.
Log of pod update --verbose:
-> Pre-downloading: `CBZSplashView` from `git#github.com:rvirin/CBZSplashView.git`, tag `1.0.1`
> GitHub download
$ /usr/bin/git config core.bare
true
$ /usr/bin/git config core.bare
true
> Updating cache git repo (/Users/rvi/Library/Caches/CocoaPods/GitHub/8520768890e6fa2ea91b3d9e8bb9f2afbb31ab60)
$ /usr/bin/git remote update
Fetching origin
> Cloning to Pods folder
$ /usr/bin/git clone /Users/rvi/Library/Caches/CocoaPods/GitHub/8520768890e6fa2ea91b3d9e8bb9f2afbb31ab60 /Users/rvi/Devs/Lima/iOS/Lima/Pods/CBZSplashView
Cloning into '/Users/rvi/Devs/Lima/iOS/Lima/Pods/CBZSplashView'...
done.
$ /usr/bin/git fetch origin tags/1.0.1 2>&1
From /Users/rvi/Library/Caches/CocoaPods/GitHub/8520768890e6fa2ea91b3d9e8bb9f2afbb31ab60
* tag 1.0.1 -> FETCH_HEAD
$ /usr/bin/git reset --hard FETCH_HEAD
HEAD is now at 56d4dc7 change branch
$ /usr/bin/git checkout -b activated-pod-commit 2>&1
Switched to a new branch 'activated-pod-commit'
Any help is appreciate :)
$ pod --version
0.33.1
You can use following code to install Github repository to use as CocoaPods and paste this in your Podfile :
pod 'CBZSplashView', :git => 'https://github.com/rvi/CBZSplashView.git', :branch => 'master'

Resources