Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NumberFormatException: Invalid revision: 24.0.0-alpha1: Invalid revision: 24.0.0-alpha1

Android studio show me error in event log NumberFormatException: Invalid revision: 24.0.0-alpha1: Invalid revision: 24.0.0-alpha1

build.gradle:

    apply plugin: 'com.android.application'
android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"
    lintOptions {
        checkReleaseBuilds false
        abortOnError false
    }
    defaultConfig {
        applicationId "com.xxxx"
        minSdkVersion 10
        multiDexEnabled true
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}

dependencies {
    compile project(':library')
    compile 'com.android.support:multidex:1.0.0'
    compile 'com.android.support:support-v4:23.2.1'
    compile 'com.google.guava:guava:18.0'
    compile 'com.android.support:appcompat-v7:23.0.2'
    compile 'com.google.android.gms:play-services:+'
    compile 'com.google.android.gms:play-services-analytics:8.1.0'
    compile files('libs/gdata-base-1.0.jar')
    compile files('libs/gdata-calendar-2.0.jar')
    compile files('libs/gdata-calendar-meta-2.0.jar')
    compile files('libs/gdata-client-1.0.jar')
    compile files('libs/gdata-client-meta-1.0.jar')
    compile files('libs/gdata-contacts-3.0.jar')
    compile files('libs/gdata-contacts-meta-3.0.jar')
    compile files('libs/gdata-core-1.0.jar')
    compile files('libs/gdata-maps-2.0.jar')
    compile files('libs/gdata-maps-meta-2.0.jar')
}

IDE fatal errors show me someting like this:

This exception in plugin Android Support.

java.lang.NumberFormatException: Invalid revision: 24.0.0-alpha1 at com.android.sdklib.repository.FullRevision.parseRevisionImpl(FullRevision.java:198) at com.android.sdklib.repository.FullRevision.parseRevision(FullRevision.java:127) at com.android.ide.common.repository.SdkMavenRepository.getHighestInstalledVersion(SdkMavenRepository.java:179) at com.android.tools.lint.checks.GradleDetector.checkLocalMavenVersions(GradleDetector.java:1092) ...

like image 401
Alexandr Tutkevich Avatar asked Mar 14 '16 08:03

Alexandr Tutkevich


2 Answers

I had the same problem after SDK update. In my case the solution was to remove 24.0.0-alpha1 folder from sdk/extras/android/m2repository/com/android/support/appcompat-v7 and to delete <version>24.0.0-alpha1</version> line from sdk/extras/android/m2repository/com/android/support/appcompat-v7/maven-metadata.xml

like image 166
Svetlana Kuleshova Avatar answered Oct 08 '22 00:10

Svetlana Kuleshova


This worked for me.

In build.gradle of Project (not module) i changed the classpath.

It now looks like this

dependencies {
    classpath 'com.android.tools.build:gradle:1.3.0'

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

Hope it helps someone.

like image 20
Swapna Lekshmanan Avatar answered Oct 07 '22 22:10

Swapna Lekshmanan