Seems jcenter service does not work at all and returns 403 Forbidden and also deprecated in IntelliJ products (Like Android Studio)
What should be used instead?
https://jcenter.bintray.com/
Migrating your app away from JCenter can be done by replacing all jcenter() references with mavenCentral() and adding explicit inclusions for dependencies that haven't migrated yet. For your published libraries, try to migrate as soon as possible, and don't forget to also migrate all existing artifacts.
Summary: After February 1st, 2022 jcenter() will not work anymore. According to this Gradle blog post: Gradle 7.0 will deprecate the use of jcenter() to resolve dependencies. You will still be able to use JCenter as a repository, but Gradle will emit a warning.
To do so, you must simply add mavenCentral() in your build. gradle file. Make sure to put mavenCentral() before JCenter so that the build script takes the up-to-date versions on mavenCentral in priority.
When you encounter this error message, you are basically trying to reach an address or a website that is forbidden to access. Here are examples of some these errors that are commonly thrown: Forbidden: You don't have permission to access [directory] on this server HTTP Error 403 – Forbidden
How to Fix the 403 Forbidden Error . Check for URL errors and make sure you're specifying an actual web page file name and extension, not just a directory. Most websites are configured to disallow directory browsing, so a 403 Forbidden message when trying to display a folder instead of a specific page, is normal and expected.
He's been writing about tech for more than two decades and serves as the VP and General Manager of Lifewire. The 403 Forbidden error is an HTTP status code that means that accessing the page or resource you were trying to reach is absolutely forbidden for some reason.
The error message could mean that you need additional access before you can view the page. Typically, a website produces a 401 Unauthorized error when special permission is required, but sometimes a 403 Forbidden is used instead.
After many investigating I found some suitable repositories, you can use
mavenCentral()
instead of
jcenter()
And also you need to check your connection and Proxy if you use
Today 16-09-2021 our flutter pipeline stopped working for no apparent reason.
I had to update some gradle versions, and then I ran into this issue:
Could not resolve io.flutter:flutter_embedding_debug
and Read timed out
Error log:
[ ] "Install Android SDK Platform 30 (revision: 3)" complete.
[ ] "Install Android SDK Platform 30 (revision: 3)" finished.
[+1706 ms] FAILURE: Build failed with an exception.
[ ] * What went wrong:
[ ] Could not determine the dependencies of task ':app:processDebugResources'.
[ ] > Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
[ ] > Could not resolve io.flutter:flutter_embedding_debug:1.0.0-05e680e202af9a92461070cb2d9982acad46c83c.
[ ] Required by:
......
[ ] > Could not resolve io.flutter:flutter_embedding_debug:1.0.0-05e680e202af9a92461070cb2d9982acad46c83c.
[ ] > Could not get resource 'https://jcenter.bintray.com/io/flutter/flutter_embedding_debug/1.0.0-05e680e202af9a92461070cb2d9982acad46c83c/flutter_embedding_debug-1.0.0-05e680e202af9a92461070cb2d9982acad46c83c.pom'.
[ ] > Could not GET 'https://jcenter.bintray.com/io/flutter/flutter_embedding_debug/1.0.0-05e680e202af9a92461070cb2d9982acad46c83c/flutter_embedding_debug-1.0.0-05e680e202af9a92461070cb2d9982acad46c83c.pom'.
[ ] > Read timed out
[ ] * 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 3m 11s
[ ] Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
[ ] Use '--warning-mode all' to show the individual deprecation warnings.
[ ] See https://docs.gradle.org/6.1.1/userguide/command_line_interface.html#sec:command_line_warnings
[ +400 ms] Running Gradle task 'assembleDebug'... (completed in 192.0s)
[ +4 ms] "flutter apk" took 210,111ms.
[ +4 ms] Gradle task assembleDebug failed with exit code 1
[ ]
#0 throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
#1 buildGradleApp (package:flutter_tools/src/android/gradle.dart:411:7)
<asynchronous suspension>
#2 _AndroidBuilderImpl.buildApk (package:flutter_tools/src/android/android_builder.dart:101:7)
<asynchronous suspension>
#3 BuildApkCommand.runCommand (package:flutter_tools/src/commands/build_apk.dart:103:5)
<asynchronous suspension>
#4 FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:1157:12)
<asynchronous suspension>
#5 FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1009:27)
<asynchronous suspension>
#6 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#7 AppContext.run (package:flutter_tools/src/base/context.dart:149:12)
<asynchronous suspension>
#8 CommandRunner.runCommand (package:args/command_runner.dart:197:13)
<asynchronous suspension>
#9 FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:278:9)
<asynchronous suspension>
#10 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#11 AppContext.run (package:flutter_tools/src/base/context.dart:149:12)
<asynchronous suspension>
#12 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:234:5)
<asynchronous suspension>
#13 run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:64:9)
<asynchronous suspension>
#14 run.<anonymous closure> (package:flutter_tools/runner.dart:62:12)
<asynchronous suspension>
#15 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#16 AppContext.run (package:flutter_tools/src/base/context.dart:149:12)
<asynchronous suspension>
#17 runInContext (package:flutter_tools/src/context_runner.dart:73:10)
<asynchronous suspension>
#18 main (package:flutter_tools/executable.dart:90:3)
<asynchronous suspension>
[ +2 ms] ensureAnalyticsSent: 0ms
[ +1 ms] Running shutdown hooks
[ ] Shutdown hooks complete
[ ] exiting with code 1
The fix was updating the buildscript repositories in the build.gradle
file.
Earlier we used jcenter()
but now we have to use mavenCentral()
it seems.
buildscript {
repositories {
google()
//jcenter() // Does not work any more! (Forbidden)
mavenCentral() // Repo that works.
}
dependencies {
// Don't confuse gradle with the Android gradle plugin (Grr)!
// Android gradle https://developer.android.com/studio/releases/gradle-plugin
//classpath 'com.android.tools.build:gradle:3.3.1' //flutter 1.17.5
//classpath 'com.android.tools.build:gradle:3.5.4' // Flutter 2.0.6 NullSafety
classpath 'com.android.tools.build:gradle:4.0.0' // Flutter 2.0.6 NullSafety
classpath 'com.google.gms:google-services:4.3.3' // Firebase for Firebase Cloud Messaging (FCM) Push Notifications on Android.
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With