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

feat(android): AndroidX support #11409

Closed
wants to merge 7 commits into from
Closed

Conversation

hansemannn
Copy link
Collaborator

@hansemannn hansemannn commented Dec 22, 2019

JIRA: https://jira.appcelerator.org/browse/TIMOB-26472

A few notes:

  • I migrated the old shift-mode hack to use the labelVisibilityMode instead (fixes TIMOB-26905 btw)
  • I used the default 1.0.0 versions of AndroidX for now, but we could eventually move to 1.1.x directly
  • There is a implementation "com.android.support:appcompat-v7:${project.ext.tiSupportLibVersion}" left over which I wasn't sure how to handle so far.
  • I've updated the sample app as well to use ES6+ and a more modern tab-group (BottomNavigationWindow based)

The sample app works fine!

@build build added this to the 9.0.0 milestone Dec 22, 2019
@build build requested a review from a team December 22, 2019 11:14
@build
Copy link
Contributor

build commented Dec 22, 2019

Fails
🚫

🔬 There are library changes, but no changes to the unit tests. That's OK as long as you're refactoring existing code, but will require an admin to merge this PR. Please see README.md#unit-tests for docs on unit testing.

Messages
📖 👍 Hey!, You deleted more code than you added. That's awesome!
📖 🎉 Another contribution from our awesome community member, hansemannn! Thanks again for helping us make Titanium SDK better. 👍
📖 ✊ The commits in this PR match our conventions! Feel free to Rebase and Merge this PR when ready.
📖

✅ All tests are passing
Nice one! All 4484 tests are passing.
(There are 456 skipped tests not included in that total)

Generated by 🚫 dangerJS against b067a77

@build build requested a review from a team December 22, 2019 13:07
@build build added the docs label Dec 22, 2019
@hansemannn
Copy link
Collaborator Author

@sgtcoolguy Updated

@sgtcoolguy
Copy link
Contributor

@hansemannn Something definitely went wrong here. The mocha test suite fails to build. My guess is that there's a mixture of the androidx support in the SDk and legacy android support libraries in the playservices/maps modules.

[2020-01-02T18:41:44.666Z] [ERROR] : �� �[GRADLE] FAILURE: Build failed with an exception.
[2020-01-02T18:41:44.666Z] [ERROR] : �� �[GRADLE]
[2020-01-02T18:41:44.666Z] [ERROR] : �� �[GRADLE] * What went wrong:
[2020-01-02T18:41:44.666Z] [ERROR] : �� �[GRADLE] Execution failed for task ':app:checkDebugDuplicateClasses'.
[2020-01-02T18:41:44.666Z] [ERROR] : �� �[GRADLE] > 1 exception was raised by workers:
[2020-01-02T18:41:44.666Z] [ERROR] : �� �[GRADLE]   java.lang.RuntimeException: java.lang.RuntimeException: Duplicate class android.support.v4.app.INotificationSideChannel found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:27.1.1)
[2020-01-02T18:41:44.667Z] [ERROR] : �� �[GRADLE]   Duplicate class android.support.v4.app.INotificationSideChannel$Stub found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:27.1.1)
[2020-01-02T18:41:44.667Z] [ERROR] : �� �[GRADLE]   Duplicate class android.support.v4.app.INotificationSideChannel$Stub$Proxy found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:27.1.1)
[2020-01-02T18:41:44.667Z] [ERROR] : �� �[GRADLE]   Duplicate class android.support.v4.os.IResultReceiver found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:27.1.1)
[2020-01-02T18:41:44.667Z] [ERROR] : �� �[GRADLE]   Duplicate class android.support.v4.os.IResultReceiver$Stub found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:27.1.1)
[2020-01-02T18:41:44.667Z] [ERROR] : �� �[GRADLE]   Duplicate class android.support.v4.os.IResultReceiver$Stub$Proxy found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:27.1.1)
[2020-01-02T18:41:44.667Z] [ERROR] : �� �[GRADLE]   Duplicate class android.support.v4.os.ResultReceiver found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:27.1.1)
[2020-01-02T18:41:44.667Z] [ERROR] : �� �[GRADLE]   Duplicate class android.support.v4.os.ResultReceiver$1 found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:27.1.1)
[2020-01-02T18:41:44.667Z] [ERROR] : �� �[GRADLE]   Duplicate class android.support.v4.os.ResultReceiver$MyResultReceiver found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:27.1.1)
[2020-01-02T18:41:44.667Z] [ERROR] : �� �[GRADLE]   Duplicate class android.support.v4.os.ResultReceiver$MyRunnable found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:27.1.1)
[2020-01-02T18:41:44.667Z] [ERROR] : �� �[GRADLE]   
[2020-01-02T18:41:44.667Z] [ERROR] : �� �[GRADLE]   Go to the documentation to learn how to <a href="d.android.com/r/tools/classpath-sync-errors">Fix dependency resolution errors</a>.
[2020-01-02T18:41:44.667Z] [ERROR] : �� �[GRADLE] 
[2020-01-02T18:41:44.667Z] [ERROR] : �� �[GRADLE]
[2020-01-02T18:41:44.667Z] [ERROR] : �� �[GRADLE] * Try:
[2020-01-02T18:41:44.667Z] [ERROR] : �� �[GRADLE] 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.

@hansemannn
Copy link
Collaborator Author

Oh, do we compile the sample app with ti.playservices? It definitely needs to be recompiled (with a build.gradle) in order to work with Android X. Same goes for all modules that use ti.playservices, e.g. ti.map.

Is there a chance to build with a new (prerelease) version of these? Then I can update them to gradle and try again.

@hansemannn
Copy link
Collaborator Author

@jquick-axway is taking over the further adjustments as discussed with him.

@jquick-axway
Copy link
Contributor

@hansemannn, I'm closing this PR in favor of PR #11428

Notes:

  • I cherry-picked most of your AndroidX migration changes. (Thanks for that!)
  • I updated all libraries to the newest versions and added versions constants for key libraries that I think will be used by modules.
  • I removed labelVisibilityMode for the moment since the existing code makes assumptions about the TabGroup's bottom bar height. (Let's do this in a separate PR.)
  • I've added the ability to extend the gradle.properties file like you suggested, but implemented it in a different way.

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

Successfully merging this pull request may close these issues.

None yet

4 participants