Skip to content

Migrate to Androidx #758

Closed
Closed
@pm-nchain

Description

@pm-nchain

Request

Please migrate library to Androidx. Not doing so, causes a lot of unnecessary friction.

Problem

When using androidx in the project, I wasn't able to make library work, because it's not migrated to androix. You get following build error in this case:

Your project has set `android.useAndroidX=true`, but configuration `:app:developDebugRuntimeClasspath` still contains legacy support libraries, which may cause runtime issues.
This behavior will not be allowed in Android Gradle plugin 8.0.
Please use only AndroidX dependencies or set `android.enableJetifier=true` in the `gradle.properties` file to migrate your project to AndroidX (see https://developer.android.com/jetpack/androidx/migrate for more info).
The following legacy support libraries are detected:
:app:developDebugRuntimeClasspath -> project :app -> com.shopify.mobilebuysdk:buy3:16.2.0 -> com.android.support:support-annotations:28.0.0

When enabling the jettifier flag I get another error:

Duplicate class com.shopify.graphql.support.AbstractResponse found in modules buy3-16.2.0-runtime (com.shopify.mobilebuysdk:buy3:16.2.0) and support-0.2.1 (com.shopify.graphql.support:support:0.2.1)
Duplicate class com.shopify.graphql.support.Arguments found in modules buy3-16.2.0-runtime (com.shopify.mobilebuysdk:buy3:16.2.0) and support-0.2.1 (com.shopify.graphql.support:support:0.2.1)
Duplicate class com.shopify.graphql.support.Error found in modules buy3-16.2.0-runtime (com.shopify.mobilebuysdk:buy3:16.2.0) and support-0.2.1 (com.shopify.graphql.support:support:0.2.1)
Duplicate class com.shopify.graphql.support.ID found in modules buy3-16.2.0-runtime (com.shopify.mobilebuysdk:buy3:16.2.0) and support-0.2.1 (com.shopify.graphql.support:support:0.2.1)
Duplicate class com.shopify.graphql.support.Input found in modules buy3-16.2.0-runtime (com.shopify.mobilebuysdk:buy3:16.2.0) and support-0.2.1 (com.shopify.graphql.support:support:0.2.1)
Duplicate class com.shopify.graphql.support.InvalidGraphQLException found in modules buy3-16.2.0-runtime (com.shopify.mobilebuysdk:buy3:16.2.0) and support-0.2.1 (com.shopify.graphql.support:support:0.2.1)
Duplicate class com.shopify.graphql.support.Node found in modules buy3-16.2.0-runtime (com.shopify.mobilebuysdk:buy3:16.2.0) and support-0.2.1 (com.shopify.graphql.support:support:0.2.1)
Duplicate class com.shopify.graphql.support.Nullable found in modules buy3-16.2.0-runtime (com.shopify.mobilebuysdk:buy3:16.2.0) and support-0.2.1 (com.shopify.graphql.support:support:0.2.1)
Duplicate class com.shopify.graphql.support.Query found in modules buy3-16.2.0-runtime (com.shopify.mobilebuysdk:buy3:16.2.0) and support-0.2.1 (com.shopify.graphql.support:support:0.2.1)
Duplicate class com.shopify.graphql.support.SchemaViolationError found in modules buy3-16.2.0-runtime (com.shopify.mobilebuysdk:buy3:16.2.0) and support-0.2.1 (com.shopify.graphql.support:support:0.2.1)
Duplicate class com.shopify.graphql.support.TopLevelResponse found in modules buy3-16.2.0-runtime (com.shopify.mobilebuysdk:buy3:16.2.0) and support-0.2.1 (com.shopify.graphql.support:support:0.2.1)

I also tried to then exclude one of the dependencies, but then I got runtime exception for missing class, but after that I gave up trying to use the sdk.

dependencies {
    implementation(libs.shopify.buy) {
        exclude(group = "com.shopify.graphql.support", module = "support")
    }
}

Info

Shopify version: 16.2.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions