Agustín
Agustín

Reputation: 1

Challenges Resurrecting an Old Flutter Project: Android Folder and Gradle

I downloaded a Flutter project from 4 years ago, and I want to work on top of it. I already have an old version of the Flutter SDK, so I don't have problems with the dependencies. But for some reason, I can't run the app because of a problem in my Android folder. The error message is long, really long, but it looks like this:"

Error running Gradle: ProcessException: Process "C:\Users\pochoclo\youtube-search-flutter-bloc-master\android\gradlew.bat" exited abnormally: Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reused, use --status for details

FAILURE: Build failed with an exception.

Could not resolve all artifacts for configuration ':classpath'. Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.71. Required by: project : > Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.71. > Could not get resource 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-gradle-plugin/1.2.71/kotlin-gradle-plugin-1.2.71.pom'. > Could not GET 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-gradle-plugin/1.2.71/kotlin-gradle-plugin-1.2.71.pom'. > sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target Could not resolve org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.2.71. Required by: project : > com.android.tools.build:gradle:3.2.1 ... ... ...

BUILD FAILED in 10s Command: C:\Users\pochoclo\youtube-search-flutter-bloc-master\android\gradlew.bat app:properties

I don't know what to do; help is higly appreciated :)

Upvotes: 0

Views: 71

Answers (2)

Aizan Sagheer
Aizan Sagheer

Reputation: 1658

There are two solutions.

1. Downgrade your sdk

You can downgrade your sdk to run the project. For that, you can use

flutter downgrade <version>

you can also use FVM if you don't want to change your current sdk, you can use FVM to download another sdk. You can read more here.

2. Migrate your project

It's a bit challenging as there will be many breaking changes but you can do it step by step. See flutter documentation and you can also check it

Upvotes: 0

Simon Jacobs
Simon Jacobs

Reputation: 6608

JCenter shut down in 2021: https://blog.gradle.org/jcenter-shutdown.

Try replacing jcenter() with mavenCentral() wherever it occurs.

Upvotes: 0

Related Questions