Android studio Gradle build error: Could not find com.tapadoo.android:alerter:6.1.0

  Kiến thức lập trình

I’m new to Android development. I get this error from both Android Studio and ns build android:

Build file 'C:ProgettiAPPsrcapp-mobileplatformsandroidappbuild.gradle' line: 577
A problem occurred configuring project ':app'.
Could not find com.tapadoo.android:alerter:6.1.0.
Required by:
    project :app

I updated my build.gradle file with the suggested config from https://github.com/Tapadoo/Alerter

repositories {
    // used for local *.AAR files
    pluginDependencies = nativescriptDependencies.collect {
        "$rootDir/${it.directory}/$PLATFORMS_ANDROID"
    }

    // some plugins may have their android dependencies in a /libs subdirectory
    pluginDependencies.addAll(nativescriptDependencies.collect {
        "$rootDir/${it.directory}/$PLATFORMS_ANDROID/libs"
    })

    if (!externalRuntimeExists) {
        pluginDependencies.add("libs/runtime-libs")
    }

    def appResourcesPath = getAppResourcesPath()
    def localAppResourcesLibraries = "$appResourcesPath/Android/libs"

    pluginDependencies.add(localAppResourcesLibraries)

    if (pluginDependencies.size() > 0) {
        flatDir {
            dirs pluginDependencies
        }
    }

    mavenCentral()
    maven { url "https://jitpack.io" }

}


dependencies {
    .
    .
    .

    implementation "androidx.multidex:multidex:$androidXMultidexVersion"
    implementation "androidx.appcompat:appcompat:$androidXAppCompatVersion"
    debugImplementation "com.google.android.material:material:$androidXMaterialVersion"
    implementation "androidx.exifinterface:exifinterface:$androidXExifInterfaceVersion"
    implementation "androidx.viewpager2:viewpager2:$androidXViewPagerVersion"
    implementation "androidx.fragment:fragment:$androidXFragmentVersion"
    implementation "androidx.transition:transition:$androidXTransitionVersion"
    implementation "com.tapadoo.android:alerter:6.1.0"

    def useV8Symbols = false

    def appPackageJsonFile = file("${getAppPath()}/$PACKAGE_JSON")
    if (appPackageJsonFile.exists()) {
        def appPackageJson = new JsonSlurper().parseText(appPackageJsonFile.text)
        useV8Symbols = appPackageJson.android && appPackageJson.android.useV8Symbols
    }

    if (!useV8Symbols) {
        // check whether any of the dependencies require v8 symbols
        useV8Symbols = nativescriptDependencies.any {
            def packageJsonFile = file("$rootDir/${it.directory}/$PACKAGE_JSON")
            def packageJson = new JsonSlurper().parseText(packageJsonFile.text)
            return packageJson.nativescript && packageJson.nativescript.useV8Symbols
        }
    }

All this config has been initially generated by ns build android and I get the same error when I run such command.

What am I missing? Thanks in advance, any help is really appreciated.

I updated my build.gradle file with the suggested config from https://github.com/Tapadoo/Alerter

You have:

implementation "com.tapadoo.android:alerter:6.1.0"

They have:

implementation 'com.github.tapadoo:alerter:$current-version'

You have com.tapadoo.android as the artifact group. This library used to use that, years ago. Their current instructions have com.github.tapadoo as the artifact group, which is not what you have. And, for com.github.tapadoo, $current-version is 7.2.4, as of today.

So, you should use:

implementation "com.github.tapadoo:alerter:7.2.4"

Recognized by Mobile Development Collective

4

Solved this way, in build.gradle:

allprojects {
    configurations {
        all {
            resolutionStrategy {
                dependencySubstitution {
                    substitute(module("com.tapadoo.android:alerter:6.1.0"))
                            .using(module("com.github.tapadoo:alerter:7.2.4"))
                            .because("401 error in main repo")
                }
            } 
        }
    }
}

In dependencies section

dependencies {
    implementation "com.github.tapadoo:alerter:7.2.4"
}

1

This is happening with nativescript-feedback plugin in my codebase.

The above library is one of those jitpack issues of old, you can just switch your project to use this one:

https://github.com/valor-software/nativescript-plugins/tree/master/packages/nativescript-feedback

After the removal of nativescript-feedback and adding https://github.com/valor-software/nativescript-plugins/tree/master/packages/nativescript-feedback resolved the gradle build issue.

Theme wordpress giá rẻ Theme wordpress giá rẻ Thiết kế website Kho Theme wordpress Kho Theme WP Theme WP

LEAVE A COMMENT