Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Travis builds are failing again #720

Closed
barbeau opened this issue Nov 23, 2016 · 17 comments
Closed

Travis builds are failing again #720

barbeau opened this issue Nov 23, 2016 · 17 comments
Labels
Milestone

Comments

@barbeau
Copy link
Member

barbeau commented Nov 23, 2016

Summary:

Seems like we should have a perpetual issue for this - example of failed build:
https://travis-ci.org/OneBusAway/onebusaway-android/builds/178311476

This is related to Google renaming the ABIs again - see my past SO post:
http://stackoverflow.com/questions/28751111/invalid-abi-armeabi-v7a-for-the-selected-target-with-google-apis-21

I believe based on my answer http://stackoverflow.com/a/28751112/937715, we need to update things as specified in the "EDIT Sept 12th, 2016" section. This has worked for these two projects:

@barbeau barbeau added this to the v2.1.x milestone Nov 23, 2016
barbeau added a commit that referenced this issue Nov 23, 2016
- Add separate ANDOID_TAG ABI tag variable
- Duplicate tools to get the new `repository-11.xml` and to install Android SDK tools 25.1.x
- Change system image names to match new Android SDK
- Change emulator start command to use new ABI tag variable to specify Google APIs

See travis-ci/travis-ci#6122 (comment) for details.

See also googlemaps/android-maps-utils#299.
@barbeau
Copy link
Member Author

barbeau commented Nov 28, 2016

Looks like there isn't an ARM ABI for API 25 (Android 7.1.1) yet:

image

@barbeau
Copy link
Member Author

barbeau commented Nov 29, 2016

Looks like ABIs for API Level 24 Google APIs are also missing - output of android list target:

----------
id: 26 or "Google Inc.:Google APIs:24"
     Name: Google APIs
     Type: Add-On
     Vendor: Google Inc.
     Revision: 1
     Description: Android + Google APIs
     Based on Android 7.0 (API level 24)
     Libraries:
      * com.android.future.usb.accessory (usb.jar)
          API for USB Accessories
      * com.google.android.media.effects (effects.jar)
          Collection of video effects
      * com.google.android.maps (maps.jar)
          API for Google Maps
     Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, W
XGA720, WXGA800, WXGA800-7in
 Tag/ABIs : no ABIs.  // <-- This should include the ABIs such as `google_apis/armeabi-v7a`, etc.

the-dagger pushed a commit to fossasia/open-event-droidgen that referenced this issue Dec 5, 2016
The error was because the google recently renamed the ABIs as mentioned in the following issue
OneBusAway/onebusaway-android#720
I have made the following changes
1. Upgraded AndroidTarget and AndroidToolBuild to 24.
2. No manual test being run hence emulator not required (removed emulator). Which has reduced the build time drastically.
3. Removed connectedCheck test because without an emulator there is no point of running the test.
4. Added assembleRelease to check if unsigned APK is being generated or not.
@barbeau
Copy link
Member Author

barbeau commented Dec 12, 2016

So the API Level 22 emulator should work because the ABIs exist, especially when using the travis_wait command:
https://docs.travis-ci.com/user/common-build-problems/#Build-times-out-because-no-output-was-received

However, with this build:
https://travis-ci.org/OneBusAway/onebusaway-android/builds/183263286

...I'm now seeing this error:

02:55:13 E/SplitApkInstaller: Failed to finalize session : INSTALL_FAILED_DEXOPT: Package couldn't be installed in /data/app/com.joulespersecond.seattlebusbot-1: scanPackageLI
Unable to install /home/travis/build/OneBusAway/onebusaway-android/onebusaway-android/build/outputs/apk/onebusaway-android-oba-google-debug-v2.1.5.apk
com.android.ddmlib.InstallException: Failed to finalize session : INSTALL_FAILED_DEXOPT: Package couldn't be installed in /data/app/com.joulespersecond.seattlebusbot-1: scanPackageLI
	at com.android.ddmlib.SplitApkInstaller.install(SplitApkInstaller.java:85)
	at com.android.ddmlib.Device.installPackages(Device.java:904)
	at com.android.builder.testing.ConnectedDevice.installPackages(ConnectedDevice.java:137)
	at com.android.builder.internal.testing.SimpleTestCallable.call(SimpleTestCallable.java:126)
	at com.android.builder.internal.testing.SimpleTestCallable.call(SimpleTestCallable.java:49)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
com.android.builder.testing.ConnectedDevice > runTests[test(AVD) - 5.1.1] FAILED 
	com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException: Failed to finalize session : INSTALL_FAILED_DEXOPT: Package couldn't be installed in /data/app/com.joulespersecond.seattlebusbot-1: scanPackageLI
		at com.android.builder.testing.ConnectedDevice.installPackages(ConnectedDevice.java:147)
null
com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException: Failed to finalize session : INSTALL_FAILED_DEXOPT: Package couldn't be installed in /data/app/com.joulespersecond.seattlebusbot-1: scanPackageLI
	at com.android.builder.testing.ConnectedDevice.installPackages(ConnectedDevice.java:147)
	at com.android.builder.internal.testing.SimpleTestCallable.call(SimpleTestCallable.java:126)
	at com.android.builder.internal.testing.SimpleTestCallable.call(SimpleTestCallable.java:49)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Caused by: com.android.ddmlib.InstallException: Failed to finalize session : INSTALL_FAILED_DEXOPT: Package couldn't be installed in /data/app/com.joulespersecond.seattlebusbot-1: scanPackageLI
	at com.android.ddmlib.SplitApkInstaller.install(SplitApkInstaller.java:85)
	at com.android.ddmlib.Device.installPackages(Device.java:904)
	at com.android.builder.testing.ConnectedDevice.installPackages(ConnectedDevice.java:137)
	... 8 more
:onebusaway-android:connectedObaGoogleDebugAndroidTest FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':onebusaway-android:connectedObaGoogleDebugAndroidTest'.

barbeau added a commit that referenced this issue Dec 13, 2016
- Add separate ANDOID_TAG ABI tag variable
- Duplicate tools to get the new `repository-11.xml` and to install Android SDK tools 25.1.x
- Change system image names to match new Android SDK
- Change emulator start command to use new ABI tag variable to specify Google APIs

See travis-ci/travis-ci#6122 (comment) for details.

See also googlemaps/android-maps-utils#299.
barbeau added a commit that referenced this issue Dec 13, 2016
- Add separate ANDOID_TAG ABI tag variable
- Duplicate tools to get the new `repository-11.xml` and to install Android SDK tools 25.1.x
- Change system image names to match new Android SDK
- Change emulator start command to use new ABI tag variable to specify Google APIs
- Switch to 64-bit emulator image
- Remove extra API level emulator image

See travis-ci/travis-ci#6122 (comment) for details.

See also googlemaps/android-maps-utils#299.
@barbeau
Copy link
Member Author

barbeau commented Jan 23, 2017

Given that Google still doesn't seem to have resolved the issues with API level 23-25 emulators that prevent them from running on Travis, I'm pushing a temporary workaround to the master branch in 03e262d that builds the projects on Travis, but does not run the unit tests. Builds don't require the emulator, only the unit tests, so this at least gives us the ability to see if builds themselves succeed.

@barbeau
Copy link
Member Author

barbeau commented Mar 3, 2017

I opened this issue for failing emulator builds on android-map-utils, and I believe it's the best summary of the current problem with the emulators/SDK:
googlemaps/android-maps-utils#371

barbeau added a commit to acrown-msft/onebusaway-android that referenced this issue Mar 3, 2017
@albodelu
Copy link

Hello @barbeau, i'm @ardock, I answered you here, I would like to know your opinion, I still need to improve it but seems Google fixed it.

The relevant part is to use -engine classic (QEMU-1), I'll investigate QEMU-2 issue another day.

@barbeau
Copy link
Member Author

barbeau commented Apr 18, 2017

@albodelu Thanks for the info! I'll see if I can test this on my projects soon...

@barbeau barbeau modified the milestones: v2.2.x, v2.3.x Dec 21, 2017
nackko pushed a commit to nackko/findmybikes that referenced this issue Dec 30, 2017
-check wether there are default scripts ran by Travis
Apparently images for emulators are not available for all API levels.
Foolowing this
OneBusAway/onebusaway-android#720 (comment)
checking on my local install, it seems API level 25 should be good like that.
nackko pushed a commit to nackko/findmybikes that referenced this issue Dec 30, 2017
-check wether there are default scripts ran by Travis
Down the Travis rabbit hole
https://travis-ci.org/albodelu/Dexter/jobs/220847350/config
from
OneBusAway/onebusaway-android#720 (comment)
nackko pushed a commit to nackko/findmybikes that referenced this issue Dec 30, 2017
-check wether there are default scripts ran by Travis
Down the Travis rabbit hole
https://travis-ci.org/albodelu/Dexter/jobs/220847350/config
from
OneBusAway/onebusaway-android#720 (comment)
typo
acrown-msft added a commit to acrown-msft/onebusaway-android that referenced this issue Jan 4, 2018
* Adding social functionality

Running OBA style checker

* Navigation Drawer expand/collapse chevron recolored and expanded clickable area to include entire row

* Lowered min sdk version to 9 and moved check for social functionality to Utils

* Updated build config name for Embedded Social api key and added field to agency x & y build flavors

* Updated Navigation drawer fragment to get shared preferences from the application class

* Remove extra margin from top and bottom of navigation drawer

* Updated navigation drawer fragment to include only relevant social items

* Removed unused navigation drawer items from Home Activity

* Undo changes removing margins from navdrawer

* Fixed bug where Action Bar did not appear in ArrivalsListActivity

* Moved non-UI strings to DoNotTranslate

* Updated comment bubble to be material design icon

* Removing unncessary Embedded Social search configurations

* Updating SDK version to fix google auth

* Fixed a bug where 'University Area Transit Center' would briefly show when loading a social fragment

* Use OBA theme color in SDK progress bars

* Fixed bug where Pins navdrawer item would appear below the social overflow when the plan trip item was displayed

* Updating Embedded Social server url to point to production instance

* Updated Google authentication endpoint and removed unnecessary string resource

* Fixed bug when opening discussion from ArrivalsListActivity

* Update What's New for embedded social

* Bump version to prepare for release

* Jump several versionCodes over current master to allow for additional production releases which alpha is still deployed.

* Fix unit test compilation issue

* Updated embedded social library package name in proguard rules

* Change to RealtimeService: Intent for BroadcastReceiver in Android 7.0 should only have primitive types in Bundle (ie no get/set Serializable).

Fix duplicate calls to RealtimeService

* Ensure correct itinerary is selected when app is backgrounded and resumed.

* Fix OneBusAway#747 - Only show trip plan report button if we get a server response

* Also change dialog message to "check Internet connection"

* Fix OneBusAway#671 - Add trip plan start/end markers

* Improve trip plan notification text

* Make it clearer what is happening when notifiying user that a better itinerary was found, or that their trip had a significant schedule deviation change since when they first planned the trip

* Updating ES version for google play store

* Bump versionCode

We burned versionCode 80 - as after we uploaded and submitted the APK Google rejected it with the following vulnerability message:

------
onReceivedSslError

Detected in APK 80
Your app is using an unsafe implementation of WebViewClient.onReceivedSslError handler. Please see this Google Help Center article for details, including the deadline for fixing the vulnerability.
Vulnerable classes:
•	com.microsoft.live.AuthorizationRequest$OAuthDialog$AuthorizationWebViewClient
------

And we can't upload another APK with versionCode 80, so we'll bump to 81.

* Bump plugins for Android Studio 2.3

* Temporary workaround for OneBusAway#720 - don't run unit tests on Travis

* Added configuartions which hide social search options and the topic gallery view

* Update SDK version and add configurations required for push notifications

* Removing unnecessary interface and simply overwriting the SDK's color attribute

* Updating colors to overwrite SDK values and removing unnecessary objects previously used for coloring the UI

* Added analytics to track interactions with the social UI elements

* Updating social analytics names and values

* Updating SDK version and reverting version information

* Fix OneBusAway#770 - Get release password via dialog when Gradle runs as daemon

* If gradle is not running as a daemon, get key/keystore password via command line input
* Update README for current release process

* Bump version number to prepare for release

* Fix OneBusAway#697 - Allow users to opt out of "Location not enabled" dialog

* Update to OneBusAway#697 - Allow users to opt out of "Location not enabled" dialog

* Include Amazon build variant - somehow this didn't get committed with 98135b6

* Updating SDK version to exclude ms auth library

* Bump version number to prepare for release

* Updating config to exclude user profile tabs which showcase user created topics

* Removing margins from navigation drawer list. OBA UI is unaffected but the navigation drawer in social activities loses the extra whitespace

* Apply multidex removal to embedded-social branch

* Enable Facebook auth

* Update Embedded Social SDK version

* Enabling Microsoft auth

* Bump version for next release

* Update What's New

* Remove dexOptions from build.gradle

* Fixing DB update to avoid failure cases and log attempts to add duplicate columns

* Removing unnecessary imports from ObaProvider

* Removing unnecessary import from HomeActivity

* Update SDK version and proguard rules to avoid any DEX issues

* Removing dependency on ES activities

* Updating SDK version to use comment feed fragment

* Updating config to remove user relations since users cannot post topics

* Updating Nevigation Drawer fragment behavior when resuming a paused activity or navigating via the back button

* Update behavior plan trip activity's software back button to handle ES activities

* Move social options menu to the OBA settings page

* Pull newest version of ES SDK

* Remove navigation drawer from the ES Options activity

* Allow HomeActivity to remain on the back stack when the Help nav drawer option is invoked from an ES activity

* Correct nav drawer highlight when a user selects the help option while in an ES activity

* Fixed bug where Embedded Social funtion is called without checking if social is enabled

* Fix issue where OBA failed to build if EmbeddedSocialApiKey was missing

* Added comments to functions handling the ES API key and fixed a method name in EmbeddedSocialUtils

* Use PrimaryThemeDark to color the status bar in ES activities

* Bump version to prepare for release

* Updating SDK version to fix spacing in the action bar

* Update SDK version for updated Google auth flow

* Include layout for navdrawer separator rather than copy it

* Update copyright on files authored by Microsoft

* Add copyright to files touched by Microsoft

* Updating contributors file

* Update the social button to properly handle the fragment back stack and move ES specific logic to EmbeddedSocialUtils

* Update copyright

* Fix copyright header

* Fix copyright header

* Fix copyright header

* Update AndroidManifest.xml

* Remove extra whitespace

* Fix copyright header

* Fix copyright header

* Fix copyright header

* Fix copyright header

* Fix copyright header

* Fix copyright header

* Fix copyright headers

* Update strings for toasts when signing in or out and when viewing teh settings page.  Hide social settings if ES is not enabled

* Update toast text for creating user

* Update SDK version

* Fix bugs related to Navigation drawer

* Factor the callback logic for social activities into a named class

* Display the pin feed as a fragment rather than as an activity

* Display the popular and recent activity feeds as fragments rather than activities

* Replace the NavDrawer with an Up arrow in the SignIn activity

* Reorder and refactor references to the Popular Feed fragment
barbeau added a commit that referenced this issue Jun 21, 2018
* Based on #720 (comment), and solution at https://github.com/albodelu/android-maps-utils/blob/8ab3efe962cfe59da6db748c176108d7e142e4e7/.travis.yml.

Change gradlew command to match previous

Don't fail builds for Lint errors
@barbeau
Copy link
Member Author

barbeau commented Jun 21, 2018

@albodelu I'm just now coming back to setting up Android unit tests on Travis again - is the info in the above links still the most recent configuration you're aware of, or do you have a more recent version that still works as of today?

@barbeau
Copy link
Member Author

barbeau commented Aug 8, 2018

@albodelu @ardock Friendly ping on this - have you been able to get the emulator running on Travis recently for unit tests? I'm stumped...

@barbeau
Copy link
Member Author

barbeau commented Oct 12, 2018

Possible progress reported here on getting emulator tests running:
googlemaps/android-maps-utils#371 (comment)

@barbeau
Copy link
Member Author

barbeau commented Feb 17, 2019

It looks like Butterknife now runs emulator-based tests on Travis:
https://travis-ci.org/JakeWharton/butterknife

Here's the Travis config - maybe this will work for us:
https://github.com/JakeWharton/butterknife/blob/master/.travis.yml

@barbeau
Copy link
Member Author

barbeau commented Apr 20, 2019

This is working on GPSTest:
barbeau/gpstest#278

@barbeau
Copy link
Member Author

barbeau commented Jun 11, 2019

@barbeau
Copy link
Member Author

barbeau commented Jul 11, 2019

Now all builds (even not emulator based) are failing due to a license issue - from https://travis-ci.org/OneBusAway/onebusaway-android/builds/557364172:

> Configure project :onebusaway-android
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
File /home/travis/.android/repositories.cfg could not be loaded.
Checking the license for package Android SDK Platform 29 in /usr/local/android-sdk/licenses
Warning: License for package Android SDK Platform 29 not accepted.
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':onebusaway-android'.
> Failed to install the following Android SDK packages as some licences have not been accepted.
     platforms;android-29 Android SDK Platform 29
  To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager.
  Alternatively, to transfer the license agreements from one workstation to another, see http://d.android.com/r/studio-ui/export-licenses.html
  
  Using Android SDK: /usr/local/android-sdk
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 52s
The command "./gradlew assembleObaGoogleDebug assembleObaAmazonDebug assembleYrtGoogleDebug -PdisablePreDex" exited with 1.

@barbeau barbeau modified the milestones: v2.5, v2.6 Jul 11, 2019
@barbeau
Copy link
Member Author

barbeau commented Jul 12, 2019

Based on this Travis build comment, it looks like newer build tools broke Travis:
https://travis-ci.org/ankidroid/Anki-Android/builds/516486599

Here's the Travis config that apparently now works:
https://github.com/ankidroid/Anki-Android/blob/master/.travis.yml

@barbeau
Copy link
Member Author

barbeau commented Jul 12, 2019

With the latest changes based on the above config the emulator does start now and tests run 🎉!

However, the navigation tests are taking too long and the builds time out at 50 minutes. I'm going to set up just compiling the project in #997, and then work on adding the emulator-based testing again.

Here's the statement to run the integration tests on the emulator:

- ./gradlew test check connectedObaGoogleDebugAndroidTest -x lint --stacktrace

Hopefully we can just disable the NavigationTest tests on CI and have the rest of the tests run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants