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

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

Closed
2 tasks done
JackuXL opened this issue Sep 23, 2023 · 27 comments · Fixed by #52
Closed
2 tasks done

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

JackuXL opened this issue Sep 23, 2023 · 27 comments · Fixed by #52
Assignees
Labels
bug Something isn't working

Comments

@JackuXL
Copy link

JackuXL commented Sep 23, 2023

👟 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?

@JackuXL JackuXL added the bug Something isn't working label Sep 23, 2023
@balajip-lab
Copy link

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

@balajip-lab
Copy link

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

@theovilardo
Copy link

does anyoneknow how can i downgrade the AGP version?

@AndroidJunior9
Copy link

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

@abdul-rehman-2050
Copy link

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?

@R1NEJ0
Copy link

R1NEJ0 commented Dec 30, 2023

same issue... anyone could fix it?

@lohanidamodar
Copy link
Member

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

@Jovaini1
Copy link

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

@RaunakSeth
Copy link

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

@serveravt
Copy link

any news here?

@abdul-rehman-2050
Copy link

PR is not merged

@R1NEJ0
Copy link

R1NEJ0 commented Jan 18, 2024

any news here?

Not yet. PR was merged on SDK-Generator.

@serveravt
Copy link

and now? :)

@serveravt
Copy link

anyone here? :) ping

@serveravt
Copy link

@christyjacob4 can we finally merge/build it?

@nikhil-here
Copy link

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

@RinatTalibullin
Copy link

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

@R1NEJ0
Copy link

R1NEJ0 commented Feb 16, 2024

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

@RinatTalibullin
Copy link

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"

@amanverma-765
Copy link

any update ?

@hugofpsilva
Copy link

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

@cz9dev
Copy link

cz9dev commented Mar 20, 2024

any update?

@abnegate
Copy link
Member

@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

@hugofpsilva
Copy link

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

@Chandra-Sekhar-Bala
Copy link

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

@gewenyu99
Copy link

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.

@abnegate
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.