RadiusNetworks / flybuy-android

FlyBuy SDK for Android
Other
5 stars 0 forks source link

Upgrading from v2.3.1 to v2.10.0 and higher #28

Closed vkarthikeyan closed 2 months ago

vkarthikeyan commented 2 months ago

Upgrading the FlyBuy pickup version from 2.3.1 to 2.10.0 and higher, on building the application getting below error.

Caused by: org.gradle.internal.component.AmbiguousConfigurationSelectionException: The consumer was configured to find a library for use during runtime, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug', attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '8.3.0', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm'. However we cannot choose between the following variants of com.radiusnetworks.flybuy:pickup:2.10.0:
  - defaultReleaseVariantSdkRuntimePublication
  - noTelemetryReleaseVariantSdkRuntimePublication
All of them match the consumer attributes:
  - Variant 'defaultReleaseVariantSdkRuntimePublication' capability com.radiusnetworks.flybuy:pickup:2.10.0 declares a library for use during runtime:
      - Unmatched attributes:
          - Doesn't say anything about com.android.build.api.attributes.AgpVersionAttr (required '8.3.0')
          - Doesn't say anything about com.android.build.api.attributes.BuildTypeAttr (required 'debug')
          - Provides attribute 'com.android.build.api.attributes.ProductFlavor:flybuy' with value 'default' but the consumer didn't ask for it
          - Provides its dependencies declared externally but the consumer didn't ask for it
          - Doesn't say anything about its target Java environment (preferred optimized for Android)
          - Provides its elements with the library elements 'aar' but the consumer didn't ask for it
          - Provides release status but the consumer didn't ask for it
          - Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'androidJvm')
  - Variant 'noTelemetryReleaseVariantSdkRuntimePublication' capability com.radiusnetworks.flybuy:pickup:2.10.0 declares a library for use during runtime:
      - Unmatched attributes:
          - Doesn't say anything about com.android.build.api.attributes.AgpVersionAttr (required '8.3.0')
          - Doesn't say anything about com.android.build.api.attributes.BuildTypeAttr (required 'debug')
          - Provides attribute 'com.android.build.api.attributes.ProductFlavor:flybuy' with value 'noTelemetry' but the consumer didn't ask for it
          - Provides its dependencies declared externally but the consumer didn't ask for it
          - Doesn't say anything about its target Java environment (preferred optimized for Android)
          - Provides its elements with the library elements 'aar' but the consumer didn't ask for it
          - Provides release status but the consumer didn't ask for it
          - Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'androidJvm')

Followed the below document to migrate as the application targetting Android 14 https://www.radiusnetworks.com/developers/flybuy/#/sdk-2.0/android-14

botnerd commented 2 months ago

Did you add the following to your app's gradle in the defaultConfig?

missingDimensionStrategy "flybuy", "default"
vkarthikeyan commented 2 months ago

Yes, tried both missingDimensionStrategy "flybuy", "default" and missingDimensionStrategy "flybuy", "noTelemetry"

botnerd commented 2 months ago

Can you provide details on the version of gradle and AGP you're using as well as your build.gradle file(s)?

vkarthikeyan commented 2 months ago

Gradle version: 8.4 AGP : 8.3.0 App module has 'Development' , 'Staging' , 'Release' productFlavors and 'debug' 'release' as buildTypes

botnerd commented 2 months ago

The version of the SDK is using gradle 8.1. Can you try updating to the latest SDK 2.13.0? There are no other changes needed for that version.

Also, do you have separate library modules for your project? If so, which one(s) are including the SDK?

vkarthikeyan commented 2 months ago

Tried with 2.13.0, still getting the same build failed error. Yes, have a separate library module which have the pickup dependency. It has only "release" buildType.

botnerd commented 2 months ago

You may need to add missingDimensionStrategy "flybuy", "default" to your app as well as the library module.

vkarthikeyan commented 2 months ago

Tried with both missingDimensionStrategy "flybuy", "default" and missingDimensionStrategy "flybuy", "noTelemetry" in both build.gradle . Still getting the same error.

botnerd commented 2 months ago

Please reach out to your customer success manager and ask to setup a debugging session. I (Tim) can hop on a call with you to figure out what is happening since there appears to be something specific to your project setup.

vkarthikeyan commented 2 months ago

Able to reproduce from the sample application after adding flavours and dimens

Screenshot 2024-09-19 at 5 43 33 PM
botnerd commented 2 months ago

The sample app at https://github.com/RadiusNetworks/flybuy-android-example has been updated to 2.13.0. If you continue to have problems, we can setup a debugging session to figure out what is happening.

vkarthikeyan commented 2 months ago

@botnerd we want a debug session for this issue to resolve. Could you please tell the process how to schedule the session?

botnerd commented 2 months ago

Please reach out to your customer success manager to set that up. Alternatively, provide the brand you are with, and I will track it down from this end

vkarthikeyan commented 2 months ago

@botnerd After adding missingDimensionStrategy "flybuy", "default" in all the build.gradle files which are in the dependency tree , it solved.

One more question, do we need to update related to "google play service location" dependency changes made in 2.7.5?

Thank you.

botnerd commented 2 months ago

The SDK currently uses "com.google.android.gms:play-services-location:21.3.0" and "com.google.maps:google-maps-services:2.1.2". Gradle will use the newest version from all of your dependencies (including your own app), and sometimes this can cause issues if your app is expecting an older version. Consider updating if you notice any issues in your app for location or maps.

Also, i'm closing this issue since the gradle issue has been resolved.