jcenter dependency causing build issues
See original GitHub issueDescribe 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 > com.android.tools.build:gradle:4.1.3 project :flutter_barcode_scanner > com.android.tools.build:gradle:4.1.3 > com.android.tools.build:builder:4.1.3 project :flutter_barcode_scanner > com.android.tools.build:gradle:4.1.3 > org.ow2.asm:asm-commons:7.0 project :flutter_barcode_scanner > com.android.tools.build:gradle:4.1.3 > org.ow2.asm:asm-util:7.0 Could not resolve org.ow2.asm:asm:7.0. Could not get resource ‘https://jcenter.bintray.com/org/ow2/asm/asm/7.0/asm-7.0.pom’. Could not HEAD ‘https://jcenter.bintray.com/org/ow2/asm/asm/7.0/asm-7.0.pom’. Received status code 502 from server: Bad Gateway
To Reproduce
To manually reproduce: try to download the respective file with wget:
wget https://jcenter.bintray.com/org/ow2/asm/asm/7.0/asm-7.0.pom
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: https://stackoverflow.com/questions/70687342/jcenter-bintray-com-is-down-error-502-bad-gateway The recommended solution is to replace jcenter() with mavenCentral() in the build.gradle file.
Issue Analytics
- State:
- Created 2 years ago
- Comments:9
Top GitHub Comments
I had the same problem when introducing the flutter_barcode_scanner dependency in my pubspec.yaml.
FAILURE: Build failed with an exception.
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.
If you want to try it, you can just put this in you pubspec.yaml instead of the regular entry for the package: