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

Migrate to Androidx #758

Open
pm-nchain opened this issue Jan 15, 2024 · 1 comment
Open

Migrate to Androidx #758

pm-nchain opened this issue Jan 15, 2024 · 1 comment

Comments

@pm-nchain
Copy link

pm-nchain commented Jan 15, 2024

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

@pm-nchain
Copy link
Author

Also pay attention to the line This behavior will not be allowed in Android Gradle plugin 8.0.. Latest Android gradle plugin requires gradle 8.4: https://developer.android.com/build/releases/gradle-plugin#updating-gradle

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

No branches or pull requests

1 participant