Skip to content
This repository has been archived by the owner on Apr 17, 2021. It is now read-only.

Move support libraries to androidx #1398

Closed
mcomella opened this issue Oct 26, 2018 · 8 comments
Closed

Move support libraries to androidx #1398

mcomella opened this issue Oct 26, 2018 · 8 comments
Assignees
Labels
P1 High impact and/or high frequency size M 3 pts = 2-3 days = 12 - 18 hours
Milestone

Comments

@mcomella
Copy link
Contributor

Why/User Benefit/User Problem

Like #991, we have to stay up to date with the latest android conventions. Staying up to date ensures we can add new android features for users easily. This migration is part of that. I don't know if there's a date that we have to do this by but I'd assume it's by next fall, for SDK 29. That being said, components and other libraries that migrate may force us to adopt this so we should do it sooner.

What / Requirements

Acceptance Criteria (how do I know when I’m done?)

  • QA acceptance that there are no regressions
    • Focus on dependency integrations (b/c jetifier rewrites)
@psymoon
Copy link
Contributor

psymoon commented Nov 1, 2018

Required for #1391

See: http://robolectric.org/migrating/

@pocmo
Copy link
Contributor

pocmo commented Jan 31, 2019

FYI: I copied this issue to our large AndroidX migration meta:
mozilla-mobile/android-components#1903

TL;DR: We need downstream app projects to migrate first before we can migrate up the dependency tree.

Is this something we could contribute? Is there a good time in your release schedule where such a migration would fit (and get the required QA attention)?

@mcomella
Copy link
Contributor Author

mcomella commented Feb 1, 2019

@pocmo It looks like this issue has not been triaged yet. If we were to tackle this, we'd prioritize it in triage next Wednesday: can we get back to you then?

Is this something we could contribute?

Yeah! I don't see why not. Let us know if you decide to take this route.

...good luck! 😝

Is there a good time in your release schedule where such a migration would fit (and get the required QA attention)?

I can't speak for the team and as the FFES dev, I'm missing context, but we are just finishing with the regression whack-a-mole from our refactor so I'd think this could be something to land once the refactor is stable (after maybe 1 or 2 releases?). Last week's release is was backed out – it's now in staged rollout – and we're working on the following release currently.

@pocmo
Copy link
Contributor

pocmo commented Feb 1, 2019

@pocmo It looks like this issue has not been triaged yet. If we were to tackle this, we'd prioritize it in triage next Wednesday: can we get back to you then?

Sure! :)

@mcomella
Copy link
Contributor Author

mcomella commented Feb 5, 2019

FYI: it looks like the gradle configuration for the androidX testing libraries is different: https://developer.android.com/training/testing/set-up-project We should reconfigure our test set-up when we upgrade. Also, we should pin our versions to the versions from the release notes: https://developer.android.com/jetpack/androidx/releases/archive/test

@athomasmoz athomasmoz added P1 High impact and/or high frequency size M 3 pts = 2-3 days = 12 - 18 hours labels Feb 6, 2019
@severinrudie severinrudie self-assigned this Feb 25, 2019
@severinrudie
Copy link
Contributor

severinrudie commented Feb 26, 2019

Some notes as I'm making these changes.

- The Google provided migration script is incomplete (android.support.v4.media.session.PlaybackStateCompat is not updated, should move to android.media.session.PlaybackState)
- We are already on support lib v28.0.0, which helps make this move easier
- Our Gradle plugin needs to be updated to at least 3.2.0
- Jetifier (updates dependencies that rely on support libs to use AndroidX equivelents) is not working for some dependencies. Not sure why yet

@severinrudie
Copy link
Contributor

severinrudie commented Feb 26, 2019

Still no idea why, but the following dependencies:

org.mozilla.components:browser-session:$moz_components_version
org.mozilla.components:browser-search:$moz_components_version
org.mozilla.components:concept-engine:$moz_components_version
org.mozilla.components:service-telemetry:$moz_components_version
org.mozilla.components:feature-session:$moz_components_version
org.mozilla.components:service-fretboard:$moz_components_version
org.mozilla.components:browser-engine-system:$moz_components_version

all fail unless they declare exclude group: 'com.android.support'. The resulting error when syncing is:

Manifest merger failed : Attribute application@appComponentFactory value=(androidx.core.app.CoreComponentFactory) from [androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86
is also present at [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91 value=(android.support.v4.app.CoreComponentFactory).
Suggestion: add 'tools:replace="android:appComponentFactory"' to element at AndroidManifest.xml:22:5-122:19 to override.

severinrudie added a commit to severinrudie/firefox-tv that referenced this issue Feb 27, 2019
…tion

Updated Gradle plugin to the most recent stable version (from 3.1.2 to 3.3.1).  This updates Gradle from 4.4 to 4.10.1.  Release notes don't show anything to be concerned about, and the app seems to build fine.
severinrudie added a commit to severinrudie/firefox-tv that referenced this issue Feb 27, 2019
…ersion

This version was mismatched, which caused Jetifier to not work. We spoke about updating this plugin in the future to prevent similar problems, but in the meantime I've added a comment
severinrudie added a commit to severinrudie/firefox-tv that referenced this issue Feb 27, 2019
…up done. DOES NOT BUILD

Cleanup done in following commits
severinrudie added a commit to severinrudie/firefox-tv that referenced this issue Feb 27, 2019
severinrudie added a commit to severinrudie/firefox-tv that referenced this issue Feb 27, 2019
MediaSession and PlaybackState were not updated by the official script
severinrudie added a commit to severinrudie/firefox-tv that referenced this issue Feb 27, 2019
This method included contained a reference that no longer existed. As the method was unused, it was deleted rather than updated.
severinrudie added a commit to severinrudie/firefox-tv that referenced this issue Feb 27, 2019
severinrudie added a commit to severinrudie/firefox-tv that referenced this issue Feb 27, 2019
MediaSession and PlaybackState were not updated by the official script
severinrudie added a commit to severinrudie/firefox-tv that referenced this issue Feb 27, 2019
This method included contained a reference that no longer existed. As the method was unused, it was deleted rather than updated.
severinrudie added a commit to severinrudie/firefox-tv that referenced this issue Feb 27, 2019
severinrudie added a commit to severinrudie/firefox-tv that referenced this issue Feb 27, 2019
These references were resolved by Intellij, but failed to resolve at build time. Replaced these with an alternate method of gaining Application context
severinrudie added a commit to severinrudie/firefox-tv that referenced this issue Feb 27, 2019
…uilds

        // This Fastlane dependency causes our builds to fail due to having two different
        // versions of UiAutomator. Fastlane is not on the most recent version of
        // com.android.support.test.uiautomator, which presumably prevents Jetifier from
        // fixing this
severinrudie added a commit to severinrudie/firefox-tv that referenced this issue Feb 27, 2019
Exclusions can cause weird runtime issues caused by different parts of the app using different versions of libraries, so this is a Good Thing
severinrudie added a commit to severinrudie/firefox-tv that referenced this issue Mar 6, 2019
severinrudie added a commit to severinrudie/firefox-tv that referenced this issue Mar 6, 2019
severinrudie added a commit to severinrudie/firefox-tv that referenced this issue Mar 6, 2019
…uttonEvent

The newest version of the overridden method is now marked @nonnull
severinrudie added a commit that referenced this issue Mar 6, 2019
Updated Gradle plugin to the most recent stable version (from 3.1.2 to 3.3.1).  This updates Gradle from 4.4 to 4.10.1.  Release notes don't show anything to be concerned about, and the app seems to build fine.
severinrudie added a commit that referenced this issue Mar 6, 2019
This version was mismatched, which caused Jetifier to not work. We spoke about updating this plugin in the future to prevent similar problems, but in the meantime I've added a comment
severinrudie added a commit that referenced this issue Mar 6, 2019
…NOT BUILD

Cleanup done in following commits
severinrudie added a commit that referenced this issue Mar 6, 2019
MediaSession and PlaybackState were not updated by the official script
severinrudie added a commit that referenced this issue Mar 6, 2019
This method included contained a reference that no longer existed. As the method was unused, it was deleted rather than updated.
severinrudie added a commit that referenced this issue Mar 6, 2019
References to ApplicationProvider were recognized in Intellij, but unrecognized at build time until this was redeclared as an androidTestImplementation.

¯\_(ツ)_/¯
severinrudie added a commit that referenced this issue Mar 6, 2019
        // This Fastlane dependency causes our builds to fail due to having two different
        // versions of UiAutomator. Fastlane is not on the most recent version of
        // com.android.support.test.uiautomator, which presumably prevents Jetifier from
        // fixing this
severinrudie added a commit that referenced this issue Mar 6, 2019
Exclusions can cause weird runtime issues caused by different parts of the app using different versions of libraries, so this is a Good Thing
severinrudie added a commit that referenced this issue Mar 6, 2019
severinrudie added a commit that referenced this issue Mar 6, 2019
This dependency is not compatible with AndroidX. androidx.fragment.app.testing should eventually take its place, seems unstable at this time (we were unable to get it to work).

Only two tests were using the removed dependency, and neither was of high importance, so they were removed.
severinrudie added a commit that referenced this issue Mar 6, 2019
severinrudie added a commit that referenced this issue Mar 6, 2019
These conditions are handled in main/AndroidManifest
severinrudie added a commit that referenced this issue Mar 6, 2019
The decision was made to suppress this warning until it became a problem in #848. The lint error reappeared during the AndroidX migration, while no other changes were made to the file
severinrudie added a commit that referenced this issue Mar 6, 2019
The newest version of the overridden method is now marked @nonnull
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P1 High impact and/or high frequency size M 3 pts = 2-3 days = 12 - 18 hours
Projects
None yet
Development

No branches or pull requests

6 participants