skip to Main Content

I had an project that was really old. Its still work fine for the most part and I still in charge of maintaining it. When I tried to moved the project to a different PC and try to build the app on Android Studio, I got error as following:


* What went wrong:
Execution failed for task ':app:mergeDebugAssets'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Could not find mapbox-android-accounts-0.7.0.aar (com.mapbox.mapboxsdk:mapbox-android-accounts:0.7.0).
     Searched in the following locations:
         https://jcenter.bintray.com/com/mapbox/mapboxsdk/mapbox-android-accounts/0.7.0/mapbox-android-accounts-0.7.0.aar

==============================================================================

4: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:processDebugManifest'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Could not find mapbox-android-accounts-0.7.0.aar (com.mapbox.mapboxsdk:mapbox-android-accounts:0.7.0).
     Searched in the following locations:
         https://jcenter.bintray.com/com/mapbox/mapboxsdk/mapbox-android-accounts/0.7.0/mapbox-android-accounts-0.7.0.aar

==============================================================================

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 mapbox-android-accounts-0.7.0.aar (com.mapbox.mapboxsdk:mapbox-android-accounts:0.7.0).
     Searched in the following locations:
         https://jcenter.bintray.com/com/mapbox/mapboxsdk/mapbox-android-accounts/0.7.0/mapbox-android-accounts-0.7.0.aar

==============================================================================

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 mapbox-android-accounts-0.7.0.aar (com.mapbox.mapboxsdk:mapbox-android-accounts:0.7.0).
     Searched in the following locations:
         https://jcenter.bintray.com/com/mapbox/mapboxsdk/mapbox-android-accounts/0.7.0/mapbox-android-accounts-0.7.0.aar

==============================================================================

7: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':realm:stripDebugDebugSymbols'.
> No toolchains found in the NDK toolchains folder for ABI with prefix: arm-linux-androideabi

==============================================================================

Here is my build.gradle (android/build.gradle) files:

buildscript {
    ext {
        buildToolsVersion = "31.0.0"
        minSdkVersion = 21
        compileSdkVersion = 33
        targetSdkVersion = 34
    }

    repositories {
        google()
        mavenCentral()  // Maven Central repository
        jcenter()
        maven { url "$rootDir/../node_modules/react-native/android" }
        maven { url "https://jitpack.io" }
        maven { url "https://maven.google.com" }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.5.4' ////  <!-- Fix ggmap sdk30 -->
        classpath 'com.google.gms:google-services:4.3.13'
        classpath "com.bugsnag:bugsnag-android-gradle-plugin:5.+"
    }
}
subprojects {
    project.configurations.all {
        resolutionStrategy.eachDependency { details ->
            if (details.requested.group == 'com.android.support'
                    && !details.requested.name.contains('multidex') ) {
                details.useVersion "26.1.0"
            }
        }
    }
}

allprojects {
    repositories {
        exclusiveContent {
           filter {
               includeGroup "com.facebook.react"
           }
           forRepository {
               maven {
                   url "$rootDir/../node_modules/react-native/android"
              }
           }
       }
       
        mavenLocal()
        mavenCentral()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url ("$rootDir/../node_modules/react-native/android")
        }
        maven {
            // Android JSC is installed from npm
            url("$rootDir/../node_modules/jsc-android/dist")
        }
    
        google()
        jcenter()
        maven { url 'https://www.jitpack.io' }
    }
}

I have tried:

  • Match node, jdk, build Gradle and AGP version (node v16.20.2, jdk 11, build gradle 6.2, AGP 3.5.4)
  • Invalidate, clean and restart AS
  • Change compileSdkVersion to 34
  • I tried npm cache clean --force, rmdir /s /q node_modules and npm install
    I moved a few project ( running a newer version of gradle and RN than this project) before and its worked fine, but not this one.

2

Answers


  1. You’re trying to get something from jcenter. jcenter shutdown permanently last month. Either you built last before that date, or you had the aar cached on the old PC. Either way, the fix is to remove jcenter from your build.gradle and find a new source for the mapbox sdk (and any other dependencies you got from there). mavenCentral() is the most common replacement.

    Login or Signup to reply.
  2. try to add this :
    maven { url ‘https://repo.huaweicloud.com/repository/maven’}

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search