Skip to content Skip to sidebar Skip to footer

Cannot Run Existing Android Project Com.android.tools:common:25.3.3

Help! I´m a newbie to Android Studio and Android Programming. I did some Tutorials that worked fine. Now I tried to open an existing Android project I have to edit. I´m not even

Solution 1:

I just ran into the exact same problem. The key point for you is that you are doing an initial import of a project and it appears to have a problem with the Gradle version being used by that particular project. Try changing the the project level build.gradle file:

    // Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        google() <-- added
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.3'

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

allprojects {
    repositories {
        google()  <-- added
        jcenter()
    }
}

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

Resync the project Gradle files which will fail and offer to upgrade the Gradle plug-in:

Gradle DSL method not found: 'google()'
Possible causes:<ul><li>The project 'SampleApplication' may be using a version of the Android Gradle plug-in that does not contain the method (e.g. 'testCompile' was added in 1.1.0).
Upgrade plugin to version 3.2.0 and sync project</li><li>The project 'SampleApplication' may be using a version of Gradle that does not contain the method.
Open Gradle wrapper file</li><li>The build file may be missing a Gradle plugin.
Apply Gradle plugin</li>

When I upgrade the Gradle plug-in to the offered version and build tools version the project builds fine for me.

Update improved solution: Apparently the 2.3.3 plug-in is no longer available. Changing only the dependency works for me. No need to reference the google() repository.

classpath 'com.android.tools.build:gradle:2.3.0'

UPDATE: The missing library versions have been restored to jcenter(). The problem in the question no longer needs this workaround.


Solution 2:

Been struggling with this the whole day. This was happening for a fresh cordova android project. The issue was that the version 25.2.3 of the android build tools has been removed from all the repos(not sure why) but you can still get version 25.3.0 from mavenCentral.

For Cordova Users

Here is how I fixed it:

From your project folder navigate to platforms/android/cordovaLib and open up the build.gradle file and replace this line:

classpath 'com.android.tools.build:gradle:2.2.3'

with:

classpath 'com.android.tools.build:gradle:2.3.0'

then open up the build.gradle file the platforms/android/ folder and and make the above change in this file too.

And then replace:

 maven {
     url "https://maven.google.com"
 }

with:

mavenCentral()

For non Cordova users

Find all the build.gradle files and replace com.android.tools.build:gradle:2.2.3 with: 'com.android.tools.build:gradle:2.3.0'

And replace

maven {
     url "https://maven.google.com"
 }

with

mavenCentral()

Solution 3:

build-tools are currently at 28.0.3; it ordinary even should ask to fetch them (whatever version). with current Android Studio the buildTools are chosen automatically; current version is Android Studio & Gradle plugin to 3.2.1. add Google's Maven Repository for the Java dependencies.

update: there isn't even any version 25.3.3 but only version 25.3.0... only since version 26.0.0 they are available from the Google Maven repository. just see for yourself: https://mvnrepository.com/artifact/com.android.tools/common

you'd have to change buildTools to version 25.3.0 and add repository mavenCentral().


Solution 4:

UPDATE: Google has confirmed they made a mistake and pulled several packages from jcenter() that they thought (but were not) hosted on google(). They're working on restoring them to jcenter() and you can follow the progress here: https://issuetracker.google.com/issues/120759347

Several packages were impacted, so our workaround was multiple parts. To fix individual package dependencies, we added this to end of our android/build.gradle file (note our four affected packages and adjust for your cases):

subprojects {project ->
    if (
        project.name.contains('pushwoosh-react-native-plugin') ||
        project.name.contains('react-native-immersive') ||
        project.name.contains('react-native-shimmer') ||
        project.name.contains('react-native-vector-icons')

    ) {
        buildscript {
            repositories {
                maven { url = "https://dl.bintray.com/android/android-tools/" }
            }
        }
    }
}

For repo problems with build tools, we had to add these to android/build.grade, under buildscript.repository section:

maven { url 'https://dl.bintray.com/android/android-tools' }
maven { url 'https://google.bintray.com/exoplayer/' }

We also had to add the exoplayer repo to android/build.grade allprojects.repositories section. Basically, when your build encounters a failure, google the missing package, find where it's hosted now and add it to your build.gradle. I get the impression the broken repos will be fixed in a few days. But many of us don't have a few days.
(end update)



I've got the exact same problem. While I'm not super-familiar with gradle, I've been maintaining a project for a few months now.

Yesterday, the build works. Today, it doesn't. No android config changes. We're using AppCenter, so the builds there have no local cache and dependencies are re-downloaded every time. This is how the problem is masked on my local. When I ran gradle with --refresh-dependencies, I got the error.

The above makes me strongly suspect that the file basically disappeared from jcenter/bintray.

I don't know enough about this stuff to be certain or how to check. For now, I'm stuck trying to figure out how to force gradle to pull the library (com.android.tools:common:25.3.3) from somewhere that it does currently exist.

I don't know about your situation, but I can't just update to a new version of gradle (since 2.3.3 version is causing depencency) because it's a lower dependency that is pulling gradle 2.3.3 in the first place. My build.gradle is using com.android.tools.build:gradle:3.1.4.

I know this isn't an answer, but hopefully it'll lead someone else to find the answer.


Solution 5:

You should install Android SDK Build Tools 25.3.3 via Android SDK. like this


Post a Comment for "Cannot Run Existing Android Project Com.android.tools:common:25.3.3"