sdk-for-android: ๐Ÿ› Bug Report: Failed to resolve: com.squareup.okhttp3:okhttp-bom:4.10.0

๐Ÿ‘Ÿ 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?

  • I checked and didnโ€™t find similar issue

๐Ÿข Have you read the Code of Conduct?

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 1
  • Comments: 27 (3 by maintainers)

Most upvoted comments

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โ€

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))

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

๐Ÿ˜„ itโ€™s 2:30 AM in India, and Iโ€™m downgrading my AGP version, after investing half an hour on this

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

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