appwrite / sdk-for-android

[READ-ONLY] Official Appwrite Android SDK 💚 🤖
https://appwrite.io
BSD 3-Clause "New" or "Revised" License
98 stars 21 forks source link

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

Closed JackuXL closed 3 months ago

JackuXL commented 10 months ago

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

🏢 Have you read the Code of Conduct?

balajip-lab commented 10 months ago

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

balajip-lab commented 10 months ago

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 commented 9 months ago

does anyoneknow how can i downgrade the AGP version?

AndroidJunior9 commented 7 months ago

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 commented 7 months ago

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 commented 7 months ago

same issue... anyone could fix it?

lohanidamodar commented 7 months ago

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

Jovaini1 commented 6 months ago

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

RaunakSeth commented 6 months ago

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

serveravt commented 6 months ago

any news here?

abdul-rehman-2050 commented 6 months ago

PR is not merged

R1NEJ0 commented 6 months ago

any news here?

Not yet. PR was merged on SDK-Generator.

serveravt commented 6 months ago

and now? :)

serveravt commented 6 months ago

anyone here? :) ping

serveravt commented 6 months ago

@christyjacob4 can we finally merge/build it?

nikhil-here commented 6 months ago

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

RinatTalibullin commented 5 months ago

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 commented 5 months ago
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 commented 5 months ago
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 commented 4 months ago

any update ?

hugofpsilva commented 4 months ago

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

cz9dev commented 4 months ago

any update?

abnegate commented 4 months ago

@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 commented 4 months ago

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 commented 3 months ago

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

gewenyu99 commented 3 months ago

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 commented 3 months ago

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