【问题标题】:Could not find com.mapbox.mapboxsdk:mapbox-android-accounts:0.7.0找不到 com.mapbox.mapboxsdk:mapbox-android-accounts:0.7.0
【发布时间】:2023-04-03 13:39:01
【问题描述】:

我已经从 Mapbox 创建了所需的帐户和密钥。我以不同的顺序列出了存储库,但没有运气。编译时出现如下错误:

无法解析配置“:app:debugRuntimeClasspath”的所有文件。

找不到 com.mapbox.mapboxsdk:mapbox-android-accounts:0.7.0。 在以下位置搜索: - https://dl.google.com/dl/android/maven2/com/mapbox/mapboxsdk/mapbox-android-accounts/0.7.0/mapbox-android-accounts-0.7.0.pom - https://repo.maven.apache.org/maven2/com/mapbox/mapboxsdk/mapbox-android-accounts/0.7.0/mapbox-android-accounts-0.7.0.pom 要求: 项目:app > com.mapbox.mapboxsdk:mapbox-android-sdk:9.2.1

这是我的 build.gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    ext.kotlin_version = "1.5.20"
    repositories {
        google()
        mavenCentral()
        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 
                password = project.properties['MAPBOX_DOWNLOADS_TOKEN'] ?: ""
            }
        }


    }
    dependencies {
        classpath "com.android.tools.build:gradle:4.2.1"
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        mavenCentral()

    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

我已将以下内容添加到我的模块级 build.gradle 实现'com.mapbox.mapboxsdk:mapbox-android-sdk:9.2.1'

【问题讨论】:

  • 您找到解决方案了吗?
  • 没有。我决定采用不同的映射解决方案。

标签: gradle mapbox-android


【解决方案1】:

我只添加了jcenter(),它可以工作。但是,jcenter() 已被弃用。

buildscript {
    repositories {
        google()
        jcenter()
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:4.2.1'
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        mavenCentral()
    }
}

【讨论】:

  • 同样的问题就这样解决了。真的很奇怪...... Mapbox的任何替代品(不包括谷歌地图请哈哈)
【解决方案2】:

似乎他们删除了 mapbox-android-accounts 存储库。 检查这个:https://mvnrepository.com/artifact/com.mapbox.mapboxsdk/mapbox-android-accounts/0.8.0

Github 页面为空。

【讨论】:

  • @Nol4635 这怎么不回答问题?问题是问为什么当我链接到和使用这个库时它不起作用,这是说“它不起作用,因为存储库已被删除。”
猜你喜欢
  • 2022-07-06
  • 2021-10-26
  • 1970-01-01
  • 2021-12-04
  • 2018-03-17
  • 1970-01-01
  • 2015-02-25
  • 1970-01-01
  • 2012-11-13
相关资源
最近更新 更多