Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

jcenter dependency causing build issues

See original GitHub issue

Issue Description

Describe the bug Build of a flutter project using flutter_barcode scanner fails with the following errors (and more follow-up errors):

FAILURE: Build failed with an exception.

  • What went wrong: A problem occurred configuring project ‘:flutter_barcode_scanner’.

Could not resolve all artifacts for configuration ‘:flutter_barcode_scanner:classpath’. Could not resolve org.ow2.asm:asm:7.0. Required by: project :flutter_barcode_scanner > project :flutter_barcode_scanner > > project :flutter_barcode_scanner > > org.ow2.asm:asm-commons:7.0 project :flutter_barcode_scanner > > org.ow2.asm:asm-util:7.0 Could not resolve org.ow2.asm:asm:7.0. Could not get resource ‘’. Could not HEAD ‘’. Received status code 502 from server: Bad Gateway

To Reproduce To manually reproduce: try to download the respective file with wget: wget for me, the download works only in approximately 1 out of 4 trials, otherwise I receive code 502 from the server.

Expected behavior Building for Android should work.

Additional context See this stackoverflow thread about the issue: The recommended solution is to replace jcenter() with mavenCentral() in the build.gradle file.

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:9

github_iconTop GitHub Comments

Harbinguercommented, Mar 11, 2022

I had the same problem when introducing the flutter_barcode_scanner dependency in my pubspec.yaml.

FAILURE: Build failed with an exception.

  • What went wrong: A problem occurred configuring project ‘:flutter_barcode_scanner’.

Could not resolve all artifacts for configuration ‘:flutter_barcode_scanner:classpath’. Could not resolve Required by: project :flutter_barcode_scanner

I can’t find much documentation about it, so if anyone knows something I would greatly appreciate an answer. The error is a direct consequence of adding the dependency to the pubspec, I have tried to use previous versions and the problem is still there.

dusalexcommented, Mar 11, 2022

If you want to try it, you can just put this in you pubspec.yaml instead of the regular entry for the package:

      url: git://
Read more comments on GitHub >

github_iconTop Results From Across the Web

Is JCenter down permanently (31 Oct)? - Stack Overflow
In android/build.gradle , add the following at the top in allprojects -> repositories . It will remove jcenter() from all the dependencies ......
Read more >
Gradle build after JCenter shutdown - Microsoft Learn
If you use JCenter and Bintray resources in your AppCenter Android builds and your builds fail on Gradle Task failure (could not get...
Read more >
Plugin Portal Dependency Resolution Failing Due to JCenter ...
I noticed this because Jitpack builds are failing, but I can reproduce the problem locally by adding the --refresh-dependencies flag.
Read more >
Upgrade Android Project from JCenter to Maven Central
You may find that not all libraries or SDKs in your project are on Maven Central. If you encounter other "could not resolve"...
Read more >
Updating Android Apps to Handle JCenter Deprecation - Ionic
When an Android project requires a dependency, the dependency is defined within the build. · Gradle will attempt to find the repositories ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found