Error when i run sudo rake dtach:install in Rhosync - android

I'm following the rhosync installation guide.
$rhosync app storemanager-server
$cd storemanager-server
$sudo rake dtach:install
I get the following error:
(in /projects/sharath apps/sharatapp/storemanager-server)
rake aborted!
no such file to load -- rhosync/tasks
/projects/sharath apps/sharatapp/storemanager-server/Rakefile:5:in `require'
(See full trace by running task with --trace)
i dont know where i am going wrong
i tried writing
export RUBYOPT=rubygems
in .profile
but still it not working
when i run gem env commend
this is the following output
RubyGems Environment:
- RUBYGEMS VERSION: 1.3.7
- RUBY VERSION: 1.8.7 (2010-08-16 patchlevel 302) [i686-linux]
- INSTALLATION DIRECTORY: /var/lib/gems/1.8
- RUBY EXECUTABLE: /usr/bin/ruby1.8
- EXECUTABLE DIRECTORY: /var/lib/gems/1.8/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86-linux
- GEM PATHS:
- /var/lib/gems/1.8
- /home/sharath/.gem/ruby/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/

I install dtach as
sudo apt-get install dtach (Ubuntu)
and sloved the problem

Related

Gitlab CI Pipeline fails because of ruby issue (Ruby installed)

I'm trying to setup CI on Gitlab. I've got a problem. Looks like runner is working well but each time I try to run pipeline it fails with following error :
Running with gitlab-runner 14.4.0 (4b9e985a)
on local-runner g_SbFiLZ
Resolving secrets
00:00
Preparing the "shell" executor
00:00
Using Shell executor...
Preparing environment
00:00
Running on GU33...
Getting source from Git repository
00:02
Fetching changes with git depth set to 50...
Reinitialized existing Git repository in C:/Users/xxx/GitLab-Runner/builds/g_SbFiLZ/0/xxx/xxx/.git/
Checking out f4fb6ec9 as main...
git-lfs/2.11.0 (GitHub; windows amd64; go 1.14.2; git 48b28d97)
Skipping Git submodules setup
Executing "step_script" stage of the job script
00:01
$ gem install bundler
gem : The term 'gem' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the s
pelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\WINDOWS\TEMP\build_script461193448\script.ps1:225 char:1
+ gem install bundler
+ ~~~
+ CategoryInfo : ObjectNotFound: (gem:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Cleaning up project directory and file based variables
00:00
ERROR: Job failed: exit status 1
I have Ruby installed and setup correctly. I can run gem commands locally. Runner is also set locally so I really dont understand the issue. Here's my gitlab-ci.yml :
stages:
- prepare
- build
- test
- ui-test
variables:
LC_ALL: "en_US.UTF-8"
LANG: "en_US.UTF-8"
.setup_bundler: &setup_bundler |
gem install bundler
bundle config
bundle install
.setup: &setup
- *setup_bundler
prepare_project:
stage: prepare
script:
*setup
cache:
key:
files:
- Gemfile.lock
paths:
- vendor
artifacts:
name: "Bundle_${CI_BUILD_NAME}_${CI_COMMIT_REF_NAME}_${CI_BUILD_ID}"
expire_in: 1 day
paths:
- vendor
when: always
when: on_success
tags:
- android
build:
stage: build
script:
- bundle exec fastlane build
dependencies:
- prepare_project
tags:
- android
test:
stage: test
script:
- bundle exec fastlane tests
dependencies:
- prepare_project
tags:
- android
ui-test:
stage: ui-test
script:
- bundle exec fastlane ui_tests
dependencies:
- prepare_project
tags:
- android
Any ideas, pelase ?
It's likely that when you're running gem to debug, you're running it with a different user than gitlab-runner, which is the default gitlab-runner user. Check the PATH setup of your gitlab-runner user, and ensure that gem is on the path.

When uploading apk with the Run wzieba/Firebase-Distribution-Github-Action#v1.3.2 I get the following error

I am trying to upload an apk to firebase using github action.
I have commented out the code analysis and tests to make the action run faster so as to try and resolve the issue. I have also tried to upload an app bundle, I get the same response.
Here is the github action configuration.
name: Deploy app bundle to firebase
on:
push:
branches:
- dev
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout#v2
- uses: actions/setup-java#v1
with:
java-version: '12.x'
- uses: subosito/flutter-action#v1 # Setup flutter environment
with:
flutter-version: '2.5.0'
- run: flutter pub get
- run: flutter pub run build_runner build --delete-conflicting-outputs
- name: Create env file
run: |
cat << EOF > .env
STAGING_API_BASE_URL="${{ secrets.STAGING_API_BASE_URL }}"
PROD_API_BASE_URL="${{ secrets.PROD_API_BASE_URL }}"
BASE_PATH="${{ secrets.BASE_PATH }}"
EOF
# - run: flutter format --set-exit-if-changed # - run: flutter format --set-exit-if-changed .
#- run: flutter analyze # Analyze the project's Dart code. This causes job to exit
#- name: Run flutter analyze
# run: |
# chmod +x ./flutter_analyze.sh
# ./flutter_analyze.sh
#- run: flutter test # Run Flutter unit tests for the current project.
- name: Build Gradle
run: flutter build apk --debug
- uses: actions/checkout#v2 #This uploads artifacts from your workflow
with:
name: debug-apk
path: build/app/outputs/flutter-apk/app-debug.apk
- run: ls build/app/outputs/flutter-apk
- name: Upload artifact to Firebase App Distribution
uses: wzieba/Firebase-Distribution-Github-Action#v1.3.2
with:
appId: ${{secrets.FIREBASE_APP_ID}}
token: ${{secrets.FIREBASE_TOKEN}}
groups: testers
file: build/app/outputs/flutter-apk/app-debug.apk
When I run the workflow I get the following error:
You can use this script to find your built apk path:
run: |
echo "Find build artifacts"
apkPath=$(find app -name "*.apk" | head -1)
echo "Found apk at $apkPath"
if [[ -z ${apkPath} ]]
then
echo "No apks were found, skip publishing to App Distribution"
else
echo "Publishing $apkPath to App Center"
#publish your apk by using $apkPath
fi
it scans all agent files and finds apk file.
use
wzieba/Firebase-Distribution-Github-Action#v1.3.3
I had made a mistake on this line
- uses: actions/upload-artifact #This uploads artifacts from your workflow
The comment is correct but the action is wrong.
I should have used actions/upload-artifact https://github.com/wzieba/Firebase-Distribution-Github-Action/issues/51

Ansible-playbook for Installing Android SDK

How to install Android SDK with ansible-playbook?
I need to configure Jenkins installation playbook and let Ansible configure Jenkins to integrate with Android
So, I have Vagrantfile:
# -*- mode: ruby -*-
# vi: set ft=ruby :
IP = "192.168.33.55"
VM_NAME = "jenkins"
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "geerlingguy/ubuntu1604" #target OS: Ubuntu 16.04
config.ssh.insert_key = false
config.vm.synced_folder ".", "/vagrant", disabled: true
config.ssh.forward_agent = true
config.vm.provider :virtualbox do |v|
v.name = VM_NAME
v.memory = 1024
v.cpus = 2
v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
v.customize ["modifyvm", :id, "--ioapic", "on"]
end
config.vm.hostname = VM_NAME
config.vm.network :private_network, ip: IP
config.vm.network "forwarded_port", guest: 80, host: 8080
# Set the name of the VM. See: http://stackoverflow.com/a/17864388/100134
config.vm.define :jenkins do |jenkins|
end
# Ansible provisioner.
config.vm.provision "ansible" do |ansible|
ansible.playbook = "jenkins/playbook.yml"
ansible.inventory_path = "jenkins/inventory"
ansible.sudo = true
end
end
And Jenkins installation playbook:
---
- name: Install Jenkins
hosts: jenkins
gather_facts: yes
vars_files:
- vars/main.yml
pre_tasks:
- name: Install Python for Ansible
raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal)
# changed_when: False
# - setup: # aka gather_facts
become: yes
become_user: root
remote_user: vagrant
vars:
- update_apt_cache: yes
roles:
- base
- geerlingguy.jenkins
- android-sdk
android-sdk role contains file main.yml with tasks:
---
- name: Download Android SDK
action: get_url url=https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip dest=/tmp/android.tgz
- name: Make opt dir for user
action: file path=/opt/adt/ state=directory mode=0777
- name: Unpack Android SDK
action: unarchive copy=no src=/tmp/android.tgz dest=/opt/adt/ creates=/opt/adt//android-sdk-linux
- name: Chown files
action: file path=/opt/adt/android-sdk-linux recurse=yes state=directory
- name: Install Android SDK
action: shell creates=/opt/adt/android-sdk-linux/tools echo y | /opt/adt/android-sdk-linux/tools/android
- name: Configure Android SDK paths
action: lineinfile dest=/home/vagrant/.bashrc line="{{ item }}"
with_items:
- 'export ANDROID_HOME=/opt/adt/android-sdk-linux'
- 'export ANDROID_TOOLS=$ANDROID_HOME/tools/'
- 'export ANDROID_PLATFORM_TOOLS=$ANDROID_HOME/platform-tools/'
- 'export PATH=$PATH:$ANDROID_TOOLS:$ANDROID_PLATFORM_TOOLS'
So, I run my Vargrantfile:
vagrant up
Roles base and geerlingguy.jenkins works, Jenkins VM successfully up. I can open Jenkins page in my browser.
But then android-sdk role starts work, and I see following:
< TASK [android-sdk : Download Android SDK] >
changed: [jenkins]
< TASK [android-sdk : Make opt dir for user] >
changed: [jenkins]
< TASK [android-sdk : Unpack Android SDK] >
changed: [jenkins]
< TASK [android-sdk : Chown files] >
changed: [jenkins]
< TASK [android-sdk : Install Android SDK] >
fatal: [jenkins]: FAILED! => {"changed": true, "cmd": "echo y |
/opt/adt/android-sdk-linux/tools/android", "delta":
"0:00:00.004105", "end": "2017-07-28 17:17:24.446018", "failed":
true, "rc": 127, "start": "2017-07-28 17:17:24.441913", "stderr":
"/bin/sh: 1: /opt/adt/android-sdk-linux/tools/android: not found",
"stderr_lines": ["/bin/sh: 1: /opt/adt/android-sdk-linux/tools/android: not found"],
"stdout": "", "stdout_lines": []}
jenkins : ok=41 changed=2 unreachable=0
failed=1
Ansible failed to complete successfully. Any error output should
be visible above. Please fix these errors and try again.
But I can see that sdk-tools-linux-3859397.zip contains "tools" directory with "android" shell script inside
My system: Linux Mint 18.2 Sonya, VirtualBox 5.0.40_Ubuntur115130, Ansible 2.3.1.0 and Vagrant 1.9.7.
The 2 main issues are that the unarchive task won't create the /opt/adt/android-sdk-linux directory and that I don't think your command to install the SDK is correct.
As a side note you don't need to use the action module for each task. You can simply replace it with the module inside of the action.
- name: Make opt dir for user
action: file path=/opt/adt/ state=directory mode=0777
Would become
- name: Make opt dir for user
file:
path: /opt/adt/
state: directory
mode: 0777
So to solve your main issues, you first need to create your destination directory before you unpack the android sdk.
- name: Create Android SDK directory
file:
path: /opt/adt/android-sdk-linux
state: directory
- name: Unpack Android SDK
unarchive:
copy: no
src: /tmp/android.tgz
dest: /opt/adt/android-sdk-linux
creates: /opt/adt/android-sdk-linux/tools
I pulled the command to install the SDK of https://gist.github.com/rikyperdana/61b1a5008b757da35a745185bfed7374.
- name: Install Android SDK
shell: yes | ./android update sdk
args:
chdir: /opt/adt/android-sdk-linux/tools

CircleCI build getting "Could not find com.google.android.gms:play-services-identity:11.0.1"

I'm trying to build an Android app on CircleCI using this circle.yml file
machine:
java:
version: oraclejdk8
environment:
# Java options
JAVA_OPTS: "-Xms512m -Xmx2048m"
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
dependencies:
pre:
# Download and install latest(26.0.2) sdk-tools revision
- wget https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip
- mkdir sdk
- unzip -d sdk sdk-tools-linux-3859397.zip
# Accepts SDK licenses
- mkdir "$ANDROID_HOME/licenses" || true
- echo -e "\n8933bad161af4178b1185d1a37fbf41ea5269c55" > "$ANDROID_HOME/licenses/android-sdk-license"
- echo -e "\n84831b9409646a918e30573bab4c9c91346d8abd" > "$ANDROID_HOME/licenses/android-sdk-preview-license"
# Install Android SDKs and additional repositories
- echo y | sdk/tools/bin/sdkmanager --channel=2 "build-tools;25.0.3" "platform-tools" "tools"
- echo y | sdk/tools/bin/sdkmanager --channel=2 "extras;google;m2repository" "extras;android;m2repository" "extras;google;google_play_services"
test:
override:
# Generate a debug-apk
- ./gradlew assembleAppseeOffDebug -PdisablePreDex
# Copy the generated apk files to Circle-CI Artifacts
- cp -r app/build/outputs/apk/ $CIRCLE_ARTIFACTS
# Copy the test results to Circle-CI Artifacts
- cp -r app/build/outputs/androidTest-results/* $CIRCLE_TEST_REPORTS
The problem is that during the gradle build phase, I got this error
Could not find com.google.firebase:firebase-messaging:11.0.1.
Searched in the following locations:
file:/usr/local/android-sdk-linux/extras/m2repository/com/google/firebase/firebase-messaging/11.0.1/firebase-messaging-11.0.1.pom
file:/usr/local/android-sdk-linux/extras/m2repository/com/google/firebase/firebase-messaging/11.0.1/firebase-messaging-11.0.1.jar
file:/usr/local/android-sdk-linux/extras/google/m2repository/com/google/firebase/firebase-messaging/11.0.1/firebase-messaging-11.0.1.pom
file:/usr/local/android-sdk-linux/extras/google/m2repository/com/google/firebase/firebase-messaging/11.0.1/firebase-messaging-11.0.1.jar
file:/usr/local/android-sdk-linux/extras/android/m2repository/com/google/firebase/firebase-messaging/11.0.1/firebase-messaging-11.0.1.pom
file:/usr/local/android-sdk-linux/extras/android/m2repository/com/google/firebase/firebase-messaging/11.0.1/firebase-messaging-11.0.1.jar
http://dl.bintray.com/populov/maven/com/google/firebase/firebase-messaging/11.0.1/firebase-messaging-11.0.1.pom
http://dl.bintray.com/populov/maven/com/google/firebase/firebase-messaging/11.0.1/firebase-messaging-11.0.1.jar
https://jcenter.bintray.com/com/google/firebase/firebase-messaging/11.0.1/firebase-messaging-11.0.1.pom
https://jcenter.bintray.com/com/google/firebase/firebase-messaging/11.0.1/firebase-messaging-11.0.1.jar
https://oss.sonatype.org/content/repositories/snapshots/com/google/firebase/firebase-messaging/11.0.1/firebase-messaging-11.0.1.pom
https://oss.sonatype.org/content/repositories/snapshots/com/google/firebase/firebase-messaging/11.0.1/firebase-messaging-11.0.1.jar
https://jitpack.io/com/google/firebase/firebase-messaging/11.0.1/firebase-messaging-11.0.1.pom
https://jitpack.io/com/google/firebase/firebase-messaging/11.0.1/firebase-messaging-11.0.1.jar
https://dl.google.com/dl/android/maven2/com/google/firebase/firebase-messaging/11.0.1/firebase-messaging-11.0.1.pom
https://dl.google.com/dl/android/maven2/com/google/firebase/firebase-messaging/11.0.1/firebase-messaging-11.0.1.jar
https://maven.fabric.io/public/com/google/firebase/firebase-messaging/11.0.1/firebase-messaging-11.0.1.pom
https://maven.fabric.io/public/com/google/firebase/firebase-messaging/11.0.1/firebase-messaging-11.0.1.jar
https://zendesk.artifactoryonline.com/zendesk/repo/com/google/firebase/firebase-messaging/11.0.1/firebase-messaging-11.0.1.pom
https://zendesk.artifactoryonline.com/zendesk/repo/com/google/firebase/firebase-messaging/11.0.1/firebase-messaging-11.0.1.jar
Is there any sdk dependency that I'm not declaring in circle.yml file?
The problem was with the executor (oraclejdk8),that does not had the correct Android SDK and Google repositories installed.
I solved the problem by migrating from CircleCI 1.0 to 2.0 and setting bitriseio/docker-android:latest - which has the correct repositories installed by default - as docker image.
Here's my final config.yml
version: 2
jobs:
build:
working_directory: /opt/working
docker:
- image: bitriseio/docker-android:latest
environment:
# Java options
JAVA_OPTS: "-Xms512m -Xmx2048m"
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
steps:
- checkout
- run:
name: Accepts License
command: echo -e "\n84831b9409646a918e30573bab4c9c91346d8abd" > "$ANDROID_HOME/licenses/android-sdk-preview-license"
- run:
name: Assemble & Test
command: ./gradlew assembleDebug testDebugUnitTest
- store_artifacts:
path: app/build/reports/tests/
destination: tests_reports/
- store_test_results:
path: "app/build/test-results/testDebugUnitTest/"
- store_artifacts:
path: app/build/outputs/apk/
destination: apks/

How to setup CircleCI environment JAVA7_HOME for RetroLambda

I am using retrolambda in my Android application, and using circleci.com as continuous integration for my github repo.
the problem is I have configured my local mac environment for Java_Home and Java7_Home, and everything is okay, but I don't know how to config circleci yml file for this problem.
here is my application repo:
https://github.com/mmirhoseini/weather_app
here is my local configurations on .bash_profile file:
export JAVA_HOME=`/usr/libexec/java_home`
export JAVA7_HOME=`/usr/libexec/java_home -v 1.7`
this is my circleci.yml file:
#
# Build configuration for Circle CI
#
general:
artifacts:
- /home/ubuntu/weather_app/app/build/outputs/apk/
machine:
environment:
ANDROID_HOME: /usr/local/android-sdk-linux
java:
version: openjdk8
dependencies:
override:
- echo y | android update sdk --no-ui --all --filter tools,platform-tools,build-tools-23.0.3,android-23,extra-google-m2repository,extra-google-google_play_services,extra-android-support
- ANDROID_HOME=/usr/local/android-sdk-linux ./gradlew dependencies
test:
override:
- (./gradlew assemble):
timeout: 360
- (./gradlew test):
timeout: 360
and here is the circleci error log:
> Building 10%When running gradle with java 8, you must set the path to the old jdk, either with property retrolambda.oldJdk or environment variable JAVA5_HOME/JAVA6_HOME/JAVA7_HOME
please help...
finally problem solved, I prepared environment by downloading older java version and setting Java6_home and after that build and run my tests.
here is my circleci.yml file:
#
# Build configuration for Circle CI
#
general:
artifacts:
- /home/ubuntu/weather_app/app/build/outputs/apk/
- /usr/lib/jvm/
machine:
environment:
ANDROID_HOME: /usr/local/android-sdk-linux
JAVA6_HOME: /usr/lib/jvm/java-6-openjdk-amd64
java:
version: openjdk8
dependencies:
override:
- echo y | sudo apt-get update
- echo y | sudo apt-get install libpango-1.0-0
- echo y | sudo apt-get install openjdk-6-jre
- echo y | android update sdk --no-ui --all --filter tools,platform-tools,build-tools-23.0.3,android-23,extra-google-m2repository,extra-google-google_play_services,extra-android-support
- ANDROID_HOME=/usr/local/android-sdk-linux ./gradlew dependencies
test:
override:
- (./gradlew assemble):
timeout: 360
- (./gradlew test):
timeout: 360

Categories

Resources