Travis-ci command "./gradlew build" exited with 1 - travis-ci

I am unable to build my Android application with Travis-ci. It keeps failing with:
Travis-ci command "./gradlew build" exited with 1.
I have no idea what's causing this, and Travis-ci has no information on how to fix it!
Please advise,
Igor

For anyone who is interested, I used the following android components section in my travis.yml file to solve the problem:
android:
components:
# Update Android SDK Tools
- tools
- build-tools-23.0.1
- android-23
# Support library
- extra-android-support
- extra-android-m2repository
Also, my script section has the following:
script:
- chmod +x ./gradlew
Seems to work now!

hi i also have the same issue but the above solution was not working in my case.But if fix it by giving
before_install:
- chmod +x gradlew
After applying chmode on before_install i have resolved the issue.
Complete .travis.yml
language: android
android:
components:
# Uncomment the lines below if you want to
# use the latest revision of Android SDK Tools
# - platform-tools
# - tools
# The BuildTools version used by your project
- build-tools-25.0.0
# The SDK version used to compile your project
- android-25
# Specify at least one system image,
# if you need to run emulator(s) during your tests
- sys-img-armeabi-v7a-android-22
- sys-img-armeabi-v7a-android-17
before_install:
- chmod +x gradlew
I hope this will help anyone who fail to get the solution from the above answer.

I had to set the jdk in the second line to 8 and it works:
language: android
jdk: oraclejdk8
android:
...

Related

How to Generate Gradlew on to Jenkins?

How to generate gradlew file to Jenkins Android Project? My project is not Android Native. My project is Flutter.
I try to create CD with Jenkins and I got some errors.
this is my pipeline code (JenkinsFile)
stage('Build Release APK') {
sh "ls ./android"
sh "./android/gradlew clean assembleRelease"
}
ls output is,(There is not gradlew file)
ls ./android
app
build.gradle
gradle
gradle.properties
key.properties
settings.gradle
This is an error I got
./android/gradlew clean assembleRelease
/Users/donperera/.jenkins/workspace/demo#tmp/durable-b0592b49/script.sh: line 1: ./android/gradlew: No such file or directory
Is there any way to build apk/aap with Jenkins?
Is it possible to use this plugin? but I already added this one. But not in this my script. https://guides.gradle.org/executing-gradle-builds-on-jenkins/
gradlew or gradlew.bat is an executable of Gradle that can be used to execute gradle commands.
gradlew or gradlew.bat uses gradle/wrapper/gradle-wrapper.jar file for execution.
So there are 3 files in play:
gradlew for mac and linux
gradlew.bat for windows
gradle/wrapper/gradle-wrapper.jar
The thing here is, these files already exists when you create your flutter project. But these files are ignored by .gitignore of the project by default. so these files won't be available in your CI/CD server.
METHOD 1 [RECOMMENDED]
You don't need them to build your project when it is a flutter project. You need flutter SDK to be installed. You can use flutter SDK to build your project. Use following command for release build [you might need to set flutter SDK for your Jenkins server]:
flutter build apk --release
It will run assembleRelease internally and will generate your APK file.
METHOD 2 [NOT RECOMMENDED]
If you want to do it your way then you can add those 3 files to version control by removing their references from .gitignore file and push it to your repository. Then you'll have those file in your Jenkins workspace. You'll have to grant execution permissions to gradlew if you are on mac or linux which can be done by following command.
chmod +x ./gradlew
then you can use following command to build your app:
./gradlew clean assembleRelease
NOTICE: Method 2 is not recommended because when you run flutter commands, it sets some properties to gradle from pubspec.yaml file like version name, version code. So if you made changes to pubspec.yaml file and haven't run flutter command after that, then running gradlew directly won't include those changes. In this case, your apk might built with older version or might not even built as it reads version info from local.properties file which is auto-modified by flutter commands and it is excluded by default from version control. So, you'll also have to add local.properties file by removing its reference from .gitignore file which is very very dirty because it has location reference of android SDK and your server might not have android SDK on that location. Again you need to tackle that. so don't use this method.
You should not do that "on Jenkins". You should do that in your codebase. Execute the wrapper command (gradle wrapper), add wrapper files to Git, commit and push.

Appium) Finishing setting up optional dependencies

First of all, below is required information.
OS: macOS Mojave 10.14.2
Node: 10.13.0
AndroidStudio: 3.1.4
When I run appium doctor, I'am getting two optional dependencies are missing.
1. `opencv4nodejs`
2. `bundletool.jar`
If I try to install opencv4nodejs, but I got warning:
opencv4nodejs#4.14.0 has no binaries
(It seems like auto build failed)
And I have no idea how to add export bundletool.jar as PATH.
I just ran into this myself. Installing opencv4nodejs was pretty easy - for that, I used:
npm -g install opencv4nodejs
There may have been dependencies of 'opencv4nodejs' that I had to install - I can't remember; that may have required me to install 'make' with brew install make
The hard one was the bundletool.jar - here are the steps I followed for that:
Searched for 'bundletool.jar' and found a place to download it from Google - I got 'bundletool-all-0.8.0.jar' from https://github.com/google/bundletool/releases
I renamed this file to just 'bundletool.jar' and placed in my Android SDK folder, under its own sub-folder called 'bundle-tool' - full path: /Users/{USER}/Library/Developer/Android/sdk/bundle-tool
I had to make the bundletool.jar executable with:
chmod +x bundletool.jar
Added the 'bundle-tool' folder to Path with the following addition in my ~/.bashrc file:
PATH="$PATH:$ANDROID_HOME/bundle-tool"
Now running which 'bundletool.jar' is happy and finds it in the 'bundle-tool' folder I created (see step 2)
Running 'appium-doctor' is now satisfied - and doesn't report any missing dependencies.
Hope that helps.
2019-10-31 update:
With MacOS Catalina (specifically 10.15.1) - I ran into a problem with installing opencv4nodejs using the npm command shown above. Opencv4nodejs wants to be built - but using C++ 11 features (from what I read) and has a problem with constexpr on MacOS. So, I first installed OpenCV with Brew - using brew install opencv#4 and then had to set the environment variable to not autobuild OpenCV with export OPENCV4NODEJS_DISABLE_AUTOBUILD=1
Then I was able to install opencv4nodejs with the npm command shown above - and appium-doctor shows that its dependencies are in place.

TravisCI - ERR : Package flute_music_player requires Flutter SDK version ^0.1.2 but the current SDK is 0.0.0-unknown

I am new travis and started working on it with flutter.
I am using flute_music_player plugin for my music player app.
Now app is working/building fine locally on my machine but I cant build it on Travis
Here is what I get
$ ./flutter/bin/flutter test
Running "flutter packages get" in tumultus...
Package flute_music_player requires Flutter SDK version ^0.1.2 but the current SDK is 0.0.0-unknown.
---- Log transcript ----
.
.
.
.
---- End log transcript ----
pub get failed (1)
The command "./flutter/bin/flutter test" exited with 1.
store build cache
nothing changed, not updating cache
Done. Your build exited with 1.
Here is the link to my complete Job log.
And my travis.yml is :
os:
- linux
sudo: false
addons:
apt:
# Flutter depends on /usr/lib/x86_64-linux-gnu/libstdc++.so.6 version GLIBCXX_3.4.18
sources:
- ubuntu-toolchain-r-test # if we don't specify this, the libstdc++6 we get is the wrong version
packages:
- libstdc++6
- fonts-droid
before_script:
- git clone https://github.com/flutter/flutter.git -b alpha --depth 1
- ./flutter/bin/flutter doctor
script:
- ./flutter/bin/flutter test
cache:
directories:
- $HOME/.pub-cache
My complete project can be found on github here
Actually I have copied most of the code from here and I tried to run his project on travis but same error on log.
Is there anywhere I am lacking, please help.
Thanks for any help or suggestions in advance.
Alright the Issue was with plugin version not actually Travis.

Node builder stops working on IBM travis

We have had our node project synced with the IBM version of Travis (https://travis.ibm.com/) for CI but it now refuses to do the build with the following error message, thoughts?
Starting with io.js 3 and Node.js 4, building native extensions requires C++11-compatible compiler, which seems unavailable on this VM. Please read https://docs.travis-ci.com/user/languages/javascript-with-nodejs#Node.js-v4-(or-io.js-v3)-compiler-requirements.
when adding the requirements as listed in the url, I get the following errors
Disallowing sources: ubuntu-toolchain-r-test
the following code solved the issue:
language: node_js
node_js:
- "5.4.1"
env:
- CXX=g++-4.8
addons:
apt:
sources:
- sourceline: 'ppa:ubuntu-toolchain-r/test'
packages:
- g++-4.8

Building WebRtc on iOS

I was successfully able to build WebRTC on MAC following these instructions: http://www.webrtc.org/reference/getting-started
Has anyone successfully built it on iOS? I understand that someone (arik) has successfully built it on iOS: https://groups.google.com/forum/#!msg/discuss-webrtc/VJg-fk2-i_0/dtG200DOzsgJ But the steps are not clear.
Can someone (who built on ios) summarize the steps so that it will be useful for everyone trying it in the future?
I wrote a detailed blog post with all of the instructions on how to build the WebRTC example iOS application, as well as how to run it on the iOS simulator or an actual iOS device. You can take a look here to read the details, it's a pretty lengthy process.
Yes, compiling for iOS was a very painful task... especially getting it work in Xcode.
Here's my attempt to get AppRTC Demo for ios
Clone/Pull: https://github.com/pristineio/webrtc-build-scripts
After getting the repo, then open the xcode project within the ios directory. Set the target to WebRTC Dance, then execute. At this point the scripts will update depot_tools and do all the dirty work (pull, modify, build) so that your target for AppRTCDemo will able to resolve the missing files and execute.
Once that completes, you can change the target to AppRTC Demo with a simulator or a real device, click run and it should execute. There's more detailed information in the guide linked in there and updates in the readme.
If you are wondering what gets ran under the hood, check out the build.sh file in the ios directory of the git repo. The dance function is what's actually getting executed for you when you select WebRTC Dance.
Its not really easy to describe the build process (way too much going on) but the build scripts repo should definitely point you in the right direction and help you get AppRTCDemo on ios 'just work'
There's also a google developers video posted here, where they try and break down the build process so you can build for ios (the youtube title is misleading).
Also, I just added cocoapods support for ios webrtc, add this to your Podfile,
pod "libjingle_peerconnection"
# Add this to the bottom so it won't have issues with active architecture
post_install do |installer_representation|
installer_representation.project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ONLY_ACTIVE_ARCH'] = 'NO'
config.build_settings['VALID_ARCHS'] = ['armv7', 'i386']
end
end
end
Not all the revisions are built, so check out the the cocoadocs for which revisions are available
I have been working in this space for the past few months now - webrtc on iOS is not easy. To help this problem I have added a github repo with a working example of and iOS app using webrtc.
https://github.com/gandg/webrtc-ios
The site references the google code site as well, so it should be a helpful starting point.
Well, it's been a long time to answer this post. But, I hope someone might
get better intuition from it.
I have been dealing with webrtc compilation processes for iOS and Android platforms. This process is really simple if you follow each step efficiently. To compile the library for iOS, follow the below-given commands and make sure you're using the same(only-1) tab of Mac terminal for WebRTC Native Compilation Setup as follows:
Prerequisites
Link Xcode with Command line
Setup depot_tools
Fetch Code for Development
Selection of Branch
Compile Library (iOS Framework)
1. Prerequisites:
First of all, make sure of the following things that you have already installed, if not then use these commands to do that:
- sudo add-apt-repository ppa:openjdk-r/ppa
- sudo apt-get install openjdk-8-jdk
- sudo apt-get install pkg-config
- sudo apt-get update
Please also install python==2.7, if it's not already installed.
2. Link Xcode with Command line:
- sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
- sudo xcode-select --switch /Library/Developer/CommandLineTools
3. Setup the Depot_tools:
- git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
- export PATH="$PATH:${HOME}/depot_tools"
After that, start the following steps one by one. Every step takes its own time based on the machine specs and internet speed, so make sure every step is completed without interruption.
4. Fetch Code:
- mkdir webrtc_ios
- cd webrtc_ios
- fetch --nohooks webrtc_ios
- gclient sync
5. Select Branch-head:
- cd src
- ./build/install-build-deps.sh
- git checkout origin/master
- git branch
6. To compile every time:
Make sure you are in the webrtc_ios/src/ directory, then simply run this command:
- ./tools_webrtc/ios/build_ios_libs.sh
It turns out that you will end up with the compilation and building of WebRtc Framework holding Webrtc Header Files. You can simply drag and drop this framework into your Xcode production environment or simply import it.
As you have set up your compilation environment, now every time you make changes into your native stack, you can simply run this command ./tools_webrtc/ios/build_ios_libs.sh to generate an updated framework.
If you end up with an issue regarding the compilation of webrtc framework. Please follow these steps. Make sure you're in this directory webrtc_ios/src/:
- git checkout origin/master
# To make sure you're using origin/master
- git branch
- gclient revert
- gclient sync
- ./tools_webrtc/ios/build_ios_libs.sh
And hopefully, you will have your issues sorted. I always recommend you guys that You can check out a branch that would be behind the origin/master and doesn't have all dependencies and modules over there which are necessary to build webrtc framework for iOS. So, Please always checkout to branch/head of webrtc native stack
Now, if you tried with these both procedures to build the WebRTC such as:
1- Using Bash Build Tools (./tools_webrtc/ios/build_ios_libs.sh)
2- Using Manual Compilation
Examples
$ # debug build for 64-bit iOS
$ gn gen out/ios_64 --args='target_os="ios" target_cpu="arm64"'
$ # debug build for simulator
$ gn gen out/ios_sim --args='target_os="ios" target_cpu="x64"'
2.1- Compiling (ninja -C out/Debug)
Both procedures will work.
This seems to build some of the modules: https://code.google.com/p/webrtc/issues/detail?id=1421#makechanges

Resources