Could not GET 'play-services-location/maven-metadata.xml'. Received status code 502 from server: Bad Gateway
The problem is that a plugin (location
in this case) didn't specify a fixed version of an Android library. So in order to find which versions are available, Gradle must go to the repository to check. In this case, that repository is Bintray
, which has been down for days and returning HTTP 502 Bad Request
.
The steps below provide a quick and dirty workaround so you can build the app while Bintray is down. A more proper solution would be to fork the plugin and make changes to your fork as suggested by Eldar Miensutov, but it might be a bit overkill for a temporary server error.
- In the Project tool window (where your files are listed), scroll all the way down until you find
Flutter Plugins
. If you don't see it, make sure thatProject
is selected in the dropdown at the top of the Project tool window. - Open
Flutter plugins
, findlocation-4.0.0
and open it (you might have a different version number afterlocation-
, that's fine). - Open the file
location-4.0.0/android/build.gradle
- Find the line
api 'com.google.android.gms:play-services-location:16.+'
- Change it to
api 'com.google.android.gms:play-services-location:16.0.0'
. If your editor says that the file does not belong to your project, select"I want to edit this file anyway"
.
You should now be able to build the app.
This change is of course a temporary solution, and if you update the location
plugin your changes will be overwritten. But at least you'll be able to build until Bintray comes online again (or until you had time to migrate to another more recently updated plugin).
OR
In case the problem is caused by the location plugin and you are able to update to the latest version of it (4.3.0
at the moment), that also seems to resolve the problem. In my case, I was stuck on an old version of Flutter and location
because of some other packages that weren't compatible with Flutter 2.
jcenter.bintray.com is down Error: 502 Bad Gateway
It's a global outage in JCenter. You can monitor status at https://status.gradle.com. It replaces the bintray status page which seems is now fully sunset and returns a 502 error.
UPDATE Jan 13, 06:35 UTC
JCenter is now back online, and systems are fully operational.
UPDATE Jan 20
Gradle Plugin resolution outage postmortem
https://blog.gradle.org/plugins-jcenter
Following this incident, the Gradle Plugin Portal now uses a JCenter mirror hosted by Gradle instead of JCenter directly. This should shield users from short JCenter outages for libraries that have been cached by the mirror. We saw another short outage of JCenter over the weekend and this did not appear to impact Gradle Plugin Portal users.
Start React Native : Error 502 from maven-metadata.xml
Try this,
- Go to the android folder.
- Find build.gradle file.
- Change every "jcenter()" into "mavenCentral()".
Flutter error : Could not resolve com.google.android.gms:play-services-location:16.+, Status code 502
All my codes were right, the only problem was the location package which I replaced with geolocator package. Now it's working fine.
Could not HEAD 'https://jcenter.bintray.com/com/facebook/react/react-native/maven-metadata.xml'. Received status code 502 from server: Bad Gateway
I had the same problem and I fixed the issue with this change:
Related Topics
Determine Addaction Click for Android Notifications
Stopping & Starting Music on Incoming Calls
How to Open an Android Studio Project in Eclipse
Android - How to Pass Hashmap<String,String> Between Activities
Setonitemclicklistener on Custom Listview
Ripple Effect on Android Lollipop Cardview
Redraw a Single Row in a Listview
How to Implement Cookie Handling on Android Using Okhttp
Scrollview Can Host Only One Direct Child
Neither User 10102 Nor Current Process Has Android.Permission.Read_Phone_State
Set the Layout Weight of a Textview Programmatically
Dynamic Listview Adding "Load More Items" at the End of Scroll
Custom Row in a Listpreference
Reading SQLite File from Asset Folder
Download the Android Sdk Components for Offline Install
The Android Emulator Is Not Starting, Showing "Invalid Command-Line Parameter"