'Failed to resolve: com.google.android:flexbox:1.1.0

So I'm trying to sync an android studio project but flexbox keeps failing to resolve. As far as I'm aware all relevant repositories are included. I've tried on multiple internet connections (no proxies involved) to no avail.

I've tried different versions of flexbox as well.

Here's my app build.gradle:

buildscript {
    repositories {
        jcenter()
        maven { url 'https://maven.google.com' }
        maven { url 'https://maven.fabric.io/public' }

    }
    dependencies {
        classpath 'io.fabric.tools:gradle:1.+'
    }
}

allprojects {
    repositories {
        flatDir {
            dirs 'libs'
        }
        maven { url "https://jitpack.io" }
    }
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'org.jetbrains.kotlin.android.extensions'
androidExtensions {
    experimental = true
}
apply plugin: 'io.fabric'
apply plugin: 'jacoco'

repositories {
    google()
    jcenter()
    maven { url 'https://maven.fabric.io/public' }
    maven { url 'https://maven.google.com' }
    mavenCentral()
}

All other google dependencies download and install and it appears that flexbox does download during the gradle sync but always fails afterwards. I really don't know what could be causing this. I've completely removed Android Studio (inc Gradle files, sdk files, preferences, etc) and reinstalled from scratch but this error just keeps occurring. I'm really at a loss here.

The dependency is listed as:

implementation 'com.google.android:flexbox:1.1.0'

EDIT: So while trying to sync again I managed to screengrab the statusbar at the bottom of Android Studio to see what was going on when I saw 'flexbox' flash up:

Screen grab of Android Studio status bar When I try to go to this URL in the browser I get a 404

Is this even the correct repo?



Solution 1:[1]

For those of you who came to this question after removing jcenter() from their gradle files:

According to this comment (https://github.com/google/flexbox-layout/issues/566#issuecomment-844630491) the flexbox library is available from the google maven repository now.

This however requires to change the reference to:

dependencies {
    implementation 'com.google.android.flexbox:flexbox:3.0.0'
}

Solution 2:[2]

Deprecated

Add this to your gradle file

maven {
    url "https://google.bintray.com/flexbox-layout" }

update

Thanks to @Volker Voecking answer

dependencies {
    implementation 'com.google.android.flexbox:flexbox:3.0.0'
}

Solution 3:[3]

You can also check this thread https://github.com/google/flexbox-layout/issues/475 In my opinion it seems to be wider than flexbox.. I have face many dependencies missing from google(), jCenter() and mavenCentral()...

Solution 4:[4]

For those looking for a way to fix this issue as a dependency in a third-party library

Try to put this in your project level gradle file:

allprojects {

    dependencies{
        modules {
            module("com.google.android:flexbox") {
                replacedBy("com.google.android.flexbox:flexbox")
            }
        }
    }
}

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Volker Voecking
Solution 2
Solution 3 Julien
Solution 4 Inliner