sdk-for-android icon indicating copy to clipboard operation
sdk-for-android copied to clipboard

🐛 Bug Report: Failed to resolve: com.squareup.okhttp3:okhttp-bom:4.10.0

Open JackuXL opened this issue 2 years ago • 24 comments

👟 Reproduction steps

After adding "implementation("io.appwrite:sdk-for-android:4.0.0")" to my build.gradle.kts

👍 Expected behavior

BUILD SUCCESSFUL

👎 Actual Behavior

Failed to resolve: com.squareup.okhttp3:okhttp-bom:4.10.0

🎲 Appwrite version

Appwrite Cloud

💻 Operating system

Linux

🧱 Your Environment

Kotlin SDK

@Suppress("DSL_SCOPE_VIOLATION") // TODO: Remove once KTIJ-19369 is fixed
plugins {
    alias(libs.plugins.androidApplication)
    alias(libs.plugins.kotlinAndroid)
}

android {
    namespace = "space.technet.assistant"
    compileSdk = 34

    defaultConfig {
        applicationId = "space.technet.assistant"
        minSdk = 26
        targetSdk = 34
        versionCode = 1
        versionName = "1.0"

        testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
        vectorDrawables {
            useSupportLibrary = true
        }
    }

    buildTypes {
        release {
            isMinifyEnabled = false
            proguardFiles(
                getDefaultProguardFile("proguard-android-optimize.txt"),
                "proguard-rules.pro"
            )
        }
    }
    compileOptions {
        sourceCompatibility = JavaVersion.VERSION_1_8
        targetCompatibility = JavaVersion.VERSION_1_8
    }
    kotlinOptions {
        jvmTarget = "1.8"
    }
    buildFeatures {
        compose = true
    }
    composeOptions {
        kotlinCompilerExtensionVersion = "1.4.3"
    }
    packaging {
        resources {
            excludes += "/META-INF/{AL2.0,LGPL2.1}"
        }
    }
}

dependencies {
    implementation(libs.core.ktx)
    implementation(libs.lifecycle.runtime.ktx)
    implementation(libs.activity.compose)
    implementation(platform(libs.compose.bom))
    implementation(libs.ui)
    implementation(libs.ui.graphics)
    implementation(libs.ui.tooling.preview)
    implementation(libs.material3)
    implementation(platform(libs.compose.bom))
    implementation(libs.androidx.foundation.android)
    testImplementation(libs.junit)
    androidTestImplementation(libs.androidx.test.ext.junit)
    androidTestImplementation(libs.espresso.core)
    androidTestImplementation(platform(libs.compose.bom))
    androidTestImplementation(libs.ui.test.junit4)
    androidTestImplementation(platform(libs.compose.bom))
    debugImplementation(libs.ui.tooling)
    debugImplementation(libs.ui.test.manifest)
    implementation(libs.androidx.navigation.compose)
    implementation("io.appwrite:sdk-for-android:4.0.0")
    //implementation("com.squareup.okhttp3:okhttp-bom:4.10.0")

}

👀 Have you spent some time to check if this issue has been raised before?

  • [X] I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

JackuXL avatar Sep 23 '23 12:09 JackuXL

Any update on this issue, Have anyone find any solution or workaround for this issue.

balajip-lab avatar Oct 01 '23 05:10 balajip-lab

Any update on this issue, Has anyone found any solution or workaround?

You can go ahead and down your AGP version to 8.1.1. I think it will work fine. @JackuXL

balajip-lab avatar Oct 01 '23 05:10 balajip-lab

does anyoneknow how can i downgrade the AGP version?

theovilardo avatar Oct 29 '23 16:10 theovilardo

Downgrading to lower AGP version will work in this case but I hope this issue gets resolved quickly for newer AGP versions.

AndroidJunior9 avatar Dec 25 '23 15:12 AndroidJunior9

I am facing the same issue, does that mean that we cannot compile with latest versions now? Is it because the appwrite is using the older version of the okhttp3:okhttp-bom:4.10.0 and the updated version according to the official okkhttp library is implementation("com.squareup.okhttp3:okhttp:4.12.0") if we change this does the changes reflect to lot of files or simply upgrading in the sdk would work?

abdul-rehman-2050 avatar Dec 30 '23 15:12 abdul-rehman-2050

same issue... anyone could fix it?

R1NEJ0 avatar Dec 30 '23 22:12 R1NEJ0

Thank you for reporting the issue, we are looking into it and will resolve this soon.

lohanidamodar avatar Dec 31 '23 01:12 lohanidamodar

same issue with AGP version 8.2.1 i had to downgrade it to 8.1.4

Jovaini1 avatar Jan 12 '24 20:01 Jovaini1

same issue in AGP version 8.2.0 any fixes for this except downgrading to 8.1.1 or 8.1.4?

RaunakSeth avatar Jan 13 '24 10:01 RaunakSeth

any news here?

serveravt avatar Jan 18 '24 11:01 serveravt

PR is not merged

abdul-rehman-2050 avatar Jan 18 '24 15:01 abdul-rehman-2050

any news here?

Not yet. PR was merged on SDK-Generator.

R1NEJ0 avatar Jan 18 '24 17:01 R1NEJ0

and now? :)

serveravt avatar Jan 24 '24 13:01 serveravt

anyone here? :) ping

serveravt avatar Jan 30 '24 16:01 serveravt

@christyjacob4 can we finally merge/build it?

serveravt avatar Jan 30 '24 16:01 serveravt

😄 it's 2:30 AM in India, and I'm downgrading my AGP version, after investing half an hour on this

nikhil-here avatar Jan 30 '24 21:01 nikhil-here

Issue could be avoided with excluding okhttp from appwrite library. But you have to add okhttp bom yourself.

implementation(libs.appwrite) {
   exclude(group = "com.squareup.okhttp3", module = "okhttp-bom")
}
implementation(platform(libs.okhttp.bom))

RinatTalibullin avatar Feb 05 '24 12:02 RinatTalibullin

implementation(libs.appwrite) {
   exclude

Hi! Can you explain how to exclude... I'm trying but got an error on "libs"....,

I'm quite new developing on Android.

Thanks in advance

R1NEJ0 avatar Feb 16 '24 15:02 R1NEJ0

implementation(libs.appwrite) {
   exclude

Hi! Can you explain how to exclude... I'm trying but got an error on "libs"....,

I'm quite new developing on Android.

Thanks in advance

Just add these { exclude(group = "com.squareup.okhttp3", module = "okhttp-bom") } after appwrite dependency declaration in your build.gradle. You also have to add okhttp to your dependencies.

Mine declaration uses version catalog, thats why it starts with "libs"

RinatTalibullin avatar Feb 19 '24 07:02 RinatTalibullin

any update ?

amanverma-765 avatar Mar 16 '24 17:03 amanverma-765

@lohanidamodar 5.0.0 doesn't seem to have fixed this.

hugofpsilva avatar Mar 19 '24 01:03 hugofpsilva

any update?

cz9dev avatar Mar 20 '24 14:03 cz9dev

@lohanidamodar 5.0.0 doesn't seem to have fixed this.

Can you share the issue you get with 5.0.0? The latest version is using AGP 8.2.2 and okhttp 4.12.0

abnegate avatar Mar 24 '24 23:03 abnegate

Not sure if relevant, but I'm using AGP 8.3.1 and Groovy.

Using implementation('io.appwrite:sdk-for-android:5.0.0') gives the following warning: Failed to resolve: com.squareup.okhttp3:okhttp-bom:4.12.0

Warning details:

  - Variant 'apiElements' capability com.squareup.okhttp3:okhttp-bom:4.12.0 declares a component for use during compile-time:
      - 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.3.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')

hugofpsilva avatar Mar 25 '24 09:03 hugofpsilva

I am facing the same issue and I need to use Appwrite urgently. Can any @Moderator please help??

Chandra-Sekhar-Bala avatar Apr 22 '24 08:04 Chandra-Sekhar-Bala

I think you might have to just downgrade and pin AGP versions for now.

Seems like there's a dependency conflict, in your gradle files.

gewenyu99 avatar Apr 23 '24 17:04 gewenyu99

This should be fixed for AGP 8.2+ in release 5.1.0 🎉

abnegate avatar Apr 24 '24 09:04 abnegate