Home > Net >  Start React Native : Error 502 from maven-metadata.xml
Start React Native : Error 502 from maven-metadata.xml

Time:01-16

When I execute npx react-native run-android I have a 502 error that does not allow me to start my project.

I have read these recents topics : "React Native: Android "Received status code 502 from server: Bad Gateway" from JCenter and Bintray being discontinued" et "Could not HEAD maven-metadata.xml. Received status code 502 from server: Bad Gateway".

They mention that the breakdown is repaired. It's confirmed on the official website : Sporadic 502 Bad Gateway, 500 Internal Server Error for maven-metadata.xml resources

Sometimes I read that it can come from my cache. How to check this?

    * What went wrong:
    Execution failed for task ':app:checkDebugAarMetadata'.
    > Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
    > Could not resolve com.facebook.react:react-native: .
        Required by:
            project :app
            project :app > project :notifee_react-native
            project :app > project :react-native-async-storage_async-storage
            project :app > project :react-native-community_masked-view
            project :app > project :react-native-firebase_app
            project :app > project :react-native-firebase_crashlytics
            project :app > project :react-native-firebase_messaging
            project :app > project :react-native-picker_picker
            project :app > project :sayem314_react-native-keep-awake
            project :app > project :react-native-background-actions
            project :app > project :react-native-camera
            project :app > project :react-native-fast-image
            project :app > project :react-native-fbsdk-next
            project :app > project :react-native-gesture-handler
            project :app > project :react-native-image-picker
            project :app > project :react-native-pager-view
            project :app > project :react-native-photoeditorsdk
            project :app > project :react-native-pinchable
            project :app > project :react-native-safe-area-context
            project :app > project :react-native-screens
            project :app > project :react-native-svg
            project :app > project :react-native-vector-icons
            project :app > project :react-native-version-check
        > Failed to list versions for com.facebook.react:react-native.
            > Unable to load Maven meta-data from https://jcenter.bintray.com/com/facebook/react/react-native/maven-metadata.xml.
                > Could not HEAD 'https://jcenter.bintray.com/com/facebook/react/react-native/maven-metadata.xml'. Received status code 502 from server: Bad Gateway
    > Could not resolve com.facebook.android:facebook-android-sdk:12. .
        Required by:
            project :app > project :react-native-fbsdk-next
        > Skipped due to earlier error
    > Could not resolve com.squareup.okio:okio:1.15.0.
        Required by:
            project :app > project :notifee_react-native > com.squareup.okhttp3:okhttp:3.12.13
        > Skipped due to earlier error

CodePudding user response:

Try this, go to the android folder, and in build.gradle file change every "jcenter()" into "mavenCentral()".

  •  Tags:  
  • Related