mp035
mp035

Reputation: 1065

Flutter Run Error "Could not resolve androidx.window:window:[1.0.0-beta04]"

I have picked up an old flutter application from another developer and I am having difficulty getting it to build. When I try 'flutter run' I get the following error:

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:processDevDebugResources'.
> Could not resolve all task dependencies for configuration ':app:devDebugRuntimeClasspath'.
> Could not resolve androidx.window:window:[1.0.0-beta04].
  Required by:
     project :app > project :in_app_purchase > io.flutter:flutter_embedding_debug:1.0.0-57d3bac3dd5cb5b0e464ab70e7bc8a0d8cf083ab > androidx.window:window-java:1.0.0-beta04
  > Failed to list versions for androidx.window:window.
     > Unable to load Maven meta-data from https://google.bintray.com/exoplayer/androidx/window/window/maven-metadata.xml.
        > Could not get resource 'https://google.bintray.com/exoplayer/androidx/window/window/maven-metadata.xml'.
           > Could not GET 'https://google.bintray.com/exoplayer/androidx/window/window/maven-metadata.xml'. Received status code 502 from server: Bad Gateway

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 6m 38s

Has anyone come across this before? Do you know what causes it and/or how to rectify the issue?

I am very new to flutter, so please let me know what further information is requried to diagnose this issue.

FYI, I have removed jcenter() from repositories, but it doesn't seem to help. Here is build.gradle:

buildscript {
    ext.kotlin_version = '1.3.50'
    repositories {
        google()
        mavenCentral()
        // mp035 removed
        // jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.5.4'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath 'com.google.gms:google-services:4.3.4'
        classpath 'com.google.firebase:firebase-crashlytics-gradle:2.6.1'
    }
}

allprojects {
    repositories {
        google()
        mavenCentral()
        /// mp035 removed
        //jcenter()
    }
}
ext.flutterFFmpegPackage = 'full'

rootProject.buildDir = '../build'
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
    project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
    delete rootProject.buildDir
}


 

Upvotes: 2

Views: 1745

Answers (1)

mp035
mp035

Reputation: 1065

Ok, so after a lot of research, it turns out that flutter packages themselves can have a build.gradle, and one of those packages (in_app_purchase in this case) had a reference to jcenter (google.bintray.com) in it.

The solution was to upgrade to a later version of the plugin. Note however, that this started a snowball effect requiring me to upgrade most of the plugins in the project and go through the code and fix up the project to work with all of the API changes that were introduced in the newer plugins.

Upvotes: 1

Related Questions