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

Fresh app can't build with Guardian.Android #117

Open
Bazni opened this issue Sep 24, 2024 · 1 comment
Open

Fresh app can't build with Guardian.Android #117

Bazni opened this issue Sep 24, 2024 · 1 comment

Comments

@Bazni
Copy link

Bazni commented Sep 24, 2024

Description

I create a new app and add Guardian.Android package and the app does not build.
I got this error Failed to resolve: com.squareup.okhttp3:okhttp-bom:4.10.0

I took time to investigate. The package prevents compilation with newer versions of AGP. I saw that okhttp-bom was added to the dependencies in 0.7 but I think it was not added properly.
To my understanding, you have to import a bom package using the platform keyword: implementation platform('com.squareup.okhttp3:okhttp-bom:4.10.0')

Reproduction

Detail the steps taken to reproduce this error, what was expected, and whether this issue can be reproduced consistently or if it is intermittent.

Where applicable, please include:

  • Create a fresh app with Android Studio
  • Add implementation("com.auth0.android:guardian:0.8.0") to the dependencies
  • Sync gradle
Error

Unresolved dependencies

No matching variant of com.squareup.okhttp3:okhttp-bom:4.10.0 was found. 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.AgpVersionAttr' with value '8.5.1', attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' but:

  • Variant 'apiElements':
    • Incompatible because this component declares a platform for use during compile-time and the consumer needed a library for use during runtime
    • Other compatible attributes:
      • Doesn't say anything about com.android.build.api.attributes.AgpVersionAttr (required '8.5.1')
      • Doesn't say anything about com.android.build.api.attributes.BuildTypeAttr (required 'debug')
      • Doesn't say anything about its target Java environment (preferred optimized for Android)
      • Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'androidJvm')
  • Variant 'enforcedApiElements':
    • Incompatible because this component declares an enforced platform for use during compile-time and the consumer needed a library for use during runtime
    • Other compatible attributes:
      • Doesn't say anything about com.android.build.api.attributes.AgpVersionAttr (required '8.5.1')
      • Doesn't say anything about com.android.build.api.attributes.BuildTypeAttr (required 'debug')
      • Doesn't say anything about its target Java environment (preferred optimized for Android)
      • Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'androidJvm')
  • Variant 'enforcedRuntimeElements' declares a component for use during runtime:
    • Incompatible because this component declares an enforced platform and the consumer needed a library
    • Other compatible attributes:
      • Doesn't say anything about com.android.build.api.attributes.AgpVersionAttr (required '8.5.1')
      • Doesn't say anything about com.android.build.api.attributes.BuildTypeAttr (required 'debug')
      • Doesn't say anything about its target Java environment (preferred optimized for Android)
      • Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'androidJvm')
  • Variant 'runtimeElements' declares a component for use during runtime:
    • Incompatible because this component declares a platform and the consumer needed a library
    • Other compatible attributes:
      • Doesn't say anything about com.android.build.api.attributes.AgpVersionAttr (required '8.5.1')
      • Doesn't say anything about com.android.build.api.attributes.BuildTypeAttr (required 'debug')
      • Doesn't say anything about its target Java environment (preferred optimized for Android)
      • Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'androidJvm')

Environment

  • com.auth0.android:guardian:0.8.0
  • Gradle 8.7
  • AGP 8.5.1
  • Android minSdkVersion 28
@andy317fe301f8c7
Copy link

Hello,
Thank you for raising this issue. While I understand that there is an existing change that could potentially fix this specific error, it seems that the greater issue is actually incompatibility with gradle 8.7 . Currently, it appears another package com.auth0.gradle.oss-library.android does not support gradle versions later than 6.9.4 .
Could you please confirm if the build of the SDK works if you are using an older version of 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

2 participants