当前位置: 首页 > 知识库问答 >
问题:

无法解析com。地图框。mapboxsdk:mapbox android帐户:0.7.0在一个项目中,但在另一个项目中可以吗?

朱啸
2023-03-14

我有2个项目,其中有相同的gradle设置关于映射框一般和他们中的一个工作完全正常和其他不工作在所有的错误,这被写入日志内的构建时间是众所周知的:

代码片段(项目gradle):

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['MB_TOKEN'] ?: ""
            }
        }

模块等级:

implementation("com.mapbox.mapboxsdk:mapbox-android-telemetry:7.0.0")

implementation('com.mapbox.mapboxsdk:mapbox-android-plugin-annotation-v9:0.9.0')

implementation('com.mapbox.mapboxsdk:mapbox-android-plugin-markerview-v9:0.4.0')
implementation("com.mapbox.mapboxsdk:mapbox-sdk-geojson:5.8.0")
implementation("com.mapbox.mapboxsdk:mapbox-android-accounts:0.8.0")

完整生成消息:

Executing tasks: [:app:assembleDebug] in project /home/lzajicek/AndroidStudioProjects/loci

Starting Gradle Daemon...
Gradle Daemon started in 1 s 199 ms
> Task :app:preBuild UP-TO-DATE
> Task :app:preDebugBuild UP-TO-DATE
> Task :app:compileDebugAidl NO-SOURCE
> Task :app:compileDebugRenderscript NO-SOURCE
> Task :app:generateDebugBuildConfig UP-TO-DATE
> Task :app:generateDebugDatabaseInterface UP-TO-DATE
> Task :app:checkDebugAarMetadata FAILED
> Task :app:generateDebugResValues UP-TO-DATE
> Task :app:generateDebugResources UP-TO-DATE
> Task :app:mergeDebugResources FAILED
> Task :app:createDebugCompatibleScreenManifests UP-TO-DATE
> Task :app:extractDeepLinksDebug UP-TO-DATE
> Task :app:processDebugMainManifest FAILED
> Task :app:javaPreCompileDebug UP-TO-DATE
> Task :app:mergeDebugNativeDebugMetadata NO-SOURCE
> Task :app:mergeDebugShaders UP-TO-DATE
> Task :app:compileDebugShaders NO-SOURCE
> Task :app:generateDebugAssets UP-TO-DATE
> Task :app:mergeDebugAssets FAILED
> Task :app:processDebugJavaRes NO-SOURCE
> Task :app:checkDebugDuplicateClasses FAILED
> Task :app:desugarDebugFileDependencies FAILED
> Task :app:mergeDebugJniLibFolders UP-TO-DATE
> Task :app:mergeDebugNativeLibs FAILED
> Task :app:validateSigningDebug UP-TO-DATE
> Task :app:writeDebugAppMetadata UP-TO-DATE
> Task :app:writeDebugSigningConfigVersions UP-TO-DATE

FAILURE: Build completed with 7 failures.

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Could not find com.mapbox.mapboxsdk:mapbox-android-accounts:0.8.0.
    Searched in the following locations:
    - https://dl.google.com/dl/android/maven2/com/mapbox/mapboxsdk/mapbox-android-accounts/0.8.0/mapbox-android-accounts-0.8.0.pom
    - https://repo.maven.apache.org/maven2/com/mapbox/mapboxsdk/mapbox-android-accounts/0.8.0/mapbox-android-accounts-0.8.0.pom
    Required by:
        project :app
   > Could not find com.mapbox.mapboxsdk:mapbox-android-accounts:0.8.0.
    Searched in the following locations:
    - https://dl.google.com/dl/android/maven2/com/mapbox/mapboxsdk/mapbox-android-accounts/0.8.0/mapbox-android-accounts-0.8.0.pom
    - https://repo.maven.apache.org/maven2/com/mapbox/mapboxsdk/mapbox-android-accounts/0.8.0/mapbox-android-accounts-0.8.0.pom
    Required by:
        project :app > com.mapbox.mapboxsdk:mapbox-android-plugin-annotation-v9:0.9.0 > com.mapbox.mapboxsdk:mapbox-android-sdk:9.2.0

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================

2: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:mergeDebugResources'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Could not find com.mapbox.mapboxsdk:mapbox-android-accounts:0.8.0.
    Searched in the following locations:
    - https://dl.google.com/dl/android/maven2/com/mapbox/mapboxsdk/mapbox-android-accounts/0.8.0/mapbox-android-accounts-0.8.0.pom
    - https://repo.maven.apache.org/maven2/com/mapbox/mapboxsdk/mapbox-android-accounts/0.8.0/mapbox-android-accounts-0.8.0.pom
    Required by:
        project :app
   > Could not find com.mapbox.mapboxsdk:mapbox-android-accounts:0.8.0.
    Searched in the following locations:
    - https://dl.google.com/dl/android/maven2/com/mapbox/mapboxsdk/mapbox-android-accounts/0.8.0/mapbox-android-accounts-0.8.0.pom
    - https://repo.maven.apache.org/maven2/com/mapbox/mapboxsdk/mapbox-android-accounts/0.8.0/mapbox-android-accounts-0.8.0.pom
    Required by:
        project :app > com.mapbox.mapboxsdk:mapbox-android-plugin-annotation-v9:0.9.0 > com.mapbox.mapboxsdk:mapbox-android-sdk:9.2.0

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================

3: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:processDebugMainManifest'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Could not find com.mapbox.mapboxsdk:mapbox-android-accounts:0.8.0.
    Searched in the following locations:
    - https://dl.google.com/dl/android/maven2/com/mapbox/mapboxsdk/mapbox-android-accounts/0.8.0/mapbox-android-accounts-0.8.0.pom
    - https://repo.maven.apache.org/maven2/com/mapbox/mapboxsdk/mapbox-android-accounts/0.8.0/mapbox-android-accounts-0.8.0.pom
    Required by:
        project :app
   > Could not find com.mapbox.mapboxsdk:mapbox-android-accounts:0.8.0.
    Searched in the following locations:
    - https://dl.google.com/dl/android/maven2/com/mapbox/mapboxsdk/mapbox-android-accounts/0.8.0/mapbox-android-accounts-0.8.0.pom
    - https://repo.maven.apache.org/maven2/com/mapbox/mapboxsdk/mapbox-android-accounts/0.8.0/mapbox-android-accounts-0.8.0.pom
    Required by:
        project :app > com.mapbox.mapboxsdk:mapbox-android-plugin-annotation-v9:0.9.0 > com.mapbox.mapboxsdk:mapbox-android-sdk:9.2.0

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================

4: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:mergeDebugAssets'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Could not find com.mapbox.mapboxsdk:mapbox-android-accounts:0.8.0.
    Searched in the following locations:
    - https://dl.google.com/dl/android/maven2/com/mapbox/mapboxsdk/mapbox-android-accounts/0.8.0/mapbox-android-accounts-0.8.0.pom
    - https://repo.maven.apache.org/maven2/com/mapbox/mapboxsdk/mapbox-android-accounts/0.8.0/mapbox-android-accounts-0.8.0.pom
    Required by:
        project :app
   > Could not find com.mapbox.mapboxsdk:mapbox-android-accounts:0.8.0.
    Searched in the following locations:
    - https://dl.google.com/dl/android/maven2/com/mapbox/mapboxsdk/mapbox-android-accounts/0.8.0/mapbox-android-accounts-0.8.0.pom
    - https://repo.maven.apache.org/maven2/com/mapbox/mapboxsdk/mapbox-android-accounts/0.8.0/mapbox-android-accounts-0.8.0.pom
    Required by:
        project :app > com.mapbox.mapboxsdk:mapbox-android-plugin-annotation-v9:0.9.0 > com.mapbox.mapboxsdk:mapbox-android-sdk:9.2.0

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================

5: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:checkDebugDuplicateClasses'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Could not find com.mapbox.mapboxsdk:mapbox-android-accounts:0.8.0.
    Searched in the following locations:
    - https://dl.google.com/dl/android/maven2/com/mapbox/mapboxsdk/mapbox-android-accounts/0.8.0/mapbox-android-accounts-0.8.0.pom
    - https://repo.maven.apache.org/maven2/com/mapbox/mapboxsdk/mapbox-android-accounts/0.8.0/mapbox-android-accounts-0.8.0.pom
    Required by:
        project :app
   > Could not find com.mapbox.mapboxsdk:mapbox-android-accounts:0.8.0.
    Searched in the following locations:
    - https://dl.google.com/dl/android/maven2/com/mapbox/mapboxsdk/mapbox-android-accounts/0.8.0/mapbox-android-accounts-0.8.0.pom
    - https://repo.maven.apache.org/maven2/com/mapbox/mapboxsdk/mapbox-android-accounts/0.8.0/mapbox-android-accounts-0.8.0.pom
    Required by:
        project :app > com.mapbox.mapboxsdk:mapbox-android-plugin-annotation-v9:0.9.0 > com.mapbox.mapboxsdk:mapbox-android-sdk:9.2.0

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================

6: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:desugarDebugFileDependencies'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Could not find com.mapbox.mapboxsdk:mapbox-android-accounts:0.8.0.
    Searched in the following locations:
    - https://dl.google.com/dl/android/maven2/com/mapbox/mapboxsdk/mapbox-android-accounts/0.8.0/mapbox-android-accounts-0.8.0.pom
    - https://repo.maven.apache.org/maven2/com/mapbox/mapboxsdk/mapbox-android-accounts/0.8.0/mapbox-android-accounts-0.8.0.pom
    Required by:
        project :app
   > Could not find com.mapbox.mapboxsdk:mapbox-android-accounts:0.8.0.
    Searched in the following locations:
    - https://dl.google.com/dl/android/maven2/com/mapbox/mapboxsdk/mapbox-android-accounts/0.8.0/mapbox-android-accounts-0.8.0.pom
    - https://repo.maven.apache.org/maven2/com/mapbox/mapboxsdk/mapbox-android-accounts/0.8.0/mapbox-android-accounts-0.8.0.pom
    Required by:
        project :app > com.mapbox.mapboxsdk:mapbox-android-plugin-annotation-v9:0.9.0 > com.mapbox.mapboxsdk:mapbox-android-sdk:9.2.0

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================

7: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:mergeDebugNativeLibs'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Could not find com.mapbox.mapboxsdk:mapbox-android-accounts:0.8.0.
    Searched in the following locations:
    - https://dl.google.com/dl/android/maven2/com/mapbox/mapboxsdk/mapbox-android-accounts/0.8.0/mapbox-android-accounts-0.8.0.pom
    - https://repo.maven.apache.org/maven2/com/mapbox/mapboxsdk/mapbox-android-accounts/0.8.0/mapbox-android-accounts-0.8.0.pom
    Required by:
        project :app
   > Could not find com.mapbox.mapboxsdk:mapbox-android-accounts:0.8.0.
    Searched in the following locations:
    - https://dl.google.com/dl/android/maven2/com/mapbox/mapboxsdk/mapbox-android-accounts/0.8.0/mapbox-android-accounts-0.8.0.pom
    - https://repo.maven.apache.org/maven2/com/mapbox/mapboxsdk/mapbox-android-accounts/0.8.0/mapbox-android-accounts-0.8.0.pom
    Required by:
        project :app > com.mapbox.mapboxsdk:mapbox-android-plugin-annotation-v9:0.9.0 > com.mapbox.mapboxsdk:mapbox-android-sdk:9.2.0

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/7.0.2/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 1m 0s
18 actionable tasks: 7 executed, 11 up-to-date

同步gradle配置后的警告消息:

Failed to resolve: com.mapbox.mapboxsdk:mapbox-android-accounts:0.8.0
Show in Project Structure dialog
Affected Modules: app

有人知道扭曲在哪里吗?在这两种方法中,我都没有使用jcenter(),但我在一个不起作用的方法中尝试了它,它也没有任何帮助。任何帮助都将不胜感激

共有1个答案

商同
2023-03-14

我已经尝试过它自己和我也得到同样的错误没有添加

jcenter()

存储库。但是在添加jcenter()之后,它工作得很好。

很可能您在错误的位置添加了jcenter()存储库。在Android Studio北极狐版本中,

所有项目{}

块移动到设置。gradle文件,您应该在其中添加jcenter()存储库。

这就是新设置的方式。gradle文件现在看起来像,

dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
    google()
    mavenCentral()
    jcenter() // Warning: this repository is going to shut down soon
  }
}
rootProject.name = "TinderLikeSwipeCardsJetpackCompose"
include ':app'
 类似资料:
  • 我正在构建一个定制的Java库。我把我的大部分“重复”代码都保存在那里,比如文件处理、字符串处理等。每次我想使用它们时,我都必须将该类复制并粘贴到我正在进行的其他项目中。有没有办法让这个自定义库类成为“依赖项”?我在用我的智能手机。

  • 我已经从Mapbox创建了所需的帐户和密钥。我以不同的顺序列出了存储库,但运气不好。在建筑物中,出现以下错误: 无法解析配置“: app: debug RuntimeClasspath”的所有文件。 找不到com.mapbox.mapboxsdk:mapbox-android-帐户:0.7.0。在以下位置搜索:-https://dl.google.com/dl/android/maven2/com

  • 问题内容: 我在玩Android Studio,制作一个非常简单,非常愚蠢的应用,以了解 有关保存关键首选项的知识,但遇到了一个奇怪的障碍。我将尽力 提供尽可能多的内容,因为可能很难重现此错误,但是 老实说,我正在运行的两个应用程序都是超级基本的,并且没有编译 错误。 规格:没有模拟器,我正在运行Samsung Galaxy Tablet。Windows 7,Android Studio 1.2,

  • 我的firebase函数在开发中运行正常(D),但在生产中给了我以下错误。此外,当我检查firebase functions控制台上的日志时,似乎没有任何活动。就好像函数没有被调用一样。 这里是我的angular应用程序调用函数的代码- 以下是功能- 索引.ts GPublish.ts 在开发和生产中部署功能时,我已经正确地更改了服务帐户密钥和google凭据。 null

  • 我使用MFC和对话框创建了两个独立的可执行文件项目。 我是visual studio的新手,所以请给出一些建议。谢谢

  • 我有以下控制器: 我想这意味着一些连接正在工作,但我在网页上得到了一个404错误。 奇怪的是,当我将这两个类复制粘贴到另一个项目(在一个我以前工作过并知道工作的包中)时,代码运行良好。但是,如果在同一个项目中,我创建了一个新的包,并在该包中放置了新的控制器和一个新的启动类,那么控制器也不能工作(404错误)。 我使用eclipse构建了这个项目,并在类路径中包含了所有依赖项,我从来不需要创建web