Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android build throws authentication error on Maven download #3463

Closed
grahamyesfit opened this issue Apr 25, 2024 · 1 comment
Closed

Android build throws authentication error on Maven download #3463

grahamyesfit opened this issue Apr 25, 2024 · 1 comment

Comments

@grahamyesfit
Copy link

grahamyesfit commented Apr 25, 2024

Environment

  • Dev OS: Win10, Android
  • @rnmapbox/maps version: 10.1.19
  • React Native version: 0.72.12
  • RNMapboxMapsVersion: 11.0.0
  • Gradle version: 8.0.1

Steps to reproduce

  1. Create new RN project
react-native init mapboxSample --version 0.72.12
cd mapboxSample
npm install @rnmapbox/maps@10.1.19 --save`
  1. Update android/build.gradle
        maven {
            url 'https://api.mapbox.com/downloads/v2/releases/maven'
            authentication {
                basic(BasicAuthentication)
            }
            credentials {
                username 'mapbox'
                password 'sk.ey...'
            }
        }
  1. Verify that the key is configured correctly, by running the following command. It correctly downloads the file:
curl -u mapbox:sk.ey... https://api.mapbox.com/downloads/v2/releases/maven/com/mapbox/common/logger/0.8.0/logger-0.8.0.aar
  1. Run npx react-native run-android

  2. The build fails with:

      > Could not download logger-0.8.0.aar (com.mapbox.common:logger:0.8.0)
         > Could not get resource 'https://api.mapbox.com/downloads/v2/releases/maven/com/mapbox/common/logger/0.8.0/logger-0.8.0.aar'.
            > Could not HEAD 'https://api.mapbox.com/downloads/v2/releases/maven/com/mapbox/common/logger/0.8.0/logger-0.8.0.aar'.
               > peer not authenticated
@grahamyesfit
Copy link
Author

I fixed this by adding the maven segment to buildscript/repositories and allprojects/repositories

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant