无法解析 com.mapbox.maps:android:10.17.0

问题描述 投票:0回答:1

我该如何修复这个错误??? 几天来我一直在寻找这个错误的解决方案。文档非常差。有人可以帮忙吗 它不是在 Android 上构建的

* What went wrong:
   > Could not resolve com.mapbox.maps:android:10.17.0.
     Required by:
         project :app > project :rnmapbox_maps
      > Could not resolve com.mapbox.maps:android:10.17.0.
         > Could not get resource 'https://api.mapbox.com/downloads/v2/releases/maven/com/mapbox/maps/android/10.17.0/android-10.17.0.pom'.
            > Could not GET 'https://api.mapbox.com/downloads/v2/releases/maven/com/mapbox/maps/android/10.17.0/android-10.17.0.pom'. Received status code 401 from server: Unauthorized
   > Could not resolve com.mapbox.mapboxsdk:mapbox-sdk-turf:6.11.0.
     Required by:
         project :app > project :rnmapbox_maps
      > Could not resolve com.mapbox.mapboxsdk:mapbox-sdk-turf:6.11.0.
         > Could not get resource 'https://api.mapbox.com/downloads/v2/releases/maven/com/mapbox/mapboxsdk/mapbox-sdk-turf/6.11.0/mapbox-sdk-turf-6.11.0.pom'.
            > Could not GET 'https://api.mapbox.com/downloads/v2/releases/maven/com/mapbox/mapboxsdk/mapbox-sdk-turf/6.11.0/mapbox-sdk-turf-6.11.0.pom'. Received status code 401 from server: Unauthorized
buildscript {
    ext {
        buildToolsVersion = "34.0.0"
        minSdkVersion = 23
        compileSdkVersion = 34
        targetSdkVersion = 34
        ndkVersion = "26.1.10909125"
        kotlinVersion = "1.9.22"
        RNMapboxMapsImpl = 'mapbox'
    }
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath("com.android.tools.build:gradle")
        classpath("com.facebook.react:react-native-gradle-plugin")
        classpath("org.jetbrains.kotlin:kotlin-gradle-plugin")
    }
   allprojects {
    repositories {
        // ...other repos
        maven {
            url 'https://api.mapbox.com/downloads/v2/releases/maven'
            authentication {
                basic(BasicAuthentication)
            }
            credentials {
                // Do not change the username below.
                // This should always be `mapbox` (not your username).
                username = 'mapbox'
                // Use the secret token you stored in gradle.properties as the password
                password = project.properties['sk-key'] ?: ""
            }
        }
        // ...even more repos?
    }
}
}
 "dependencies": {
    "@rnmapbox/maps": "^10.1.24",
    "react": "18.2.0",
    "react-native": "0.74.1"
  },

我按照文档中的安装进行操作,但收到此错误。难道就没有办法解决这个问题吗?我花了几个小时:/

react-native installation mapbox-gl-js rnmapbox-maps
1个回答
0
投票

这个问题解决了吗?我也面临同样的问题

© www.soinside.com 2019 - 2024. All rights reserved.