Mayur Misal Mayur Misal - 25 days ago 10
Android Question

Failed to resolve: com.google.firebase:firebase-storage-common:11.0.1

I am upgrading my Android Studio, Gradle version 2.3 to 2.3.3, also have updated my sdk - API level 26, SDK build tool 26, Google Play Service 41, Google Repository 54.

When I clean my project, I get this error:

Failed to resolve: com.google.firebase:firebase-storage-common:11.0.1


build.gradle:

apply plugin: 'com.android.application'

android {
compileSdkVersion 26
buildToolsVersion '26.0.0'
defaultConfig {
minSdkVersion 16
targetSdkVersion 26
multiDexEnabled = true
}

def applicationVersion = '1.524 20170612'

dexOptions {
preDexLibraries = false
javaMaxHeapSize "2g"
}

...


useLibrary 'org.apache.http.legacy'
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'build.gradle'
exclude 'build.xml'
exclude 'META-INF/jersey-module-version'
exclude 'META-INF/NOTICE'
}
allprojects {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:deprecation"
}
}
}

dependencies {

compile 'com.fasterxml.jackson.core:jackson-core:2.9.0.pr1'
compile 'com.fasterxml.jackson.core:jackson-annotations:2.9.0.pr1'
compile 'com.fasterxml.jackson.core:jackson-databind:2.9.0.pr1'
compile 'com.android.support:multidex:1.0.1'

compile 'com.google.android.gms:play-services:11.0.1'
compile 'com.google.android.gms:play-services-base:11.0.1'
compile 'com.google.android.gms:play-services-appindexing:9.8.0'
compile 'com.google.android.gms:play-services-contextmanager:9.4.0'
compile 'com.google.android.gms:play-services-places:11.0.1'
compile 'com.google.android.gms:play-services-nearby:11.0.1'
compile 'com.google.android.gms:play-services-maps:11.0.1'
compile 'com.google.android.gms:play-services-ads:11.0.1'
compile 'com.google.android.gms:play-services-auth:11.0.1'
compile 'com.google.android.gms:play-services-gcm:11.0.1'
compile 'com.google.android.gms:play-services-analytics:11.0.1'
compile 'com.google.android.gms:play-services-location:11.0.1'
compile 'com.google.maps.android:android-maps-utils:0.4'
compile 'com.google.zxing:core:3.2.0'
compile 'com.journeyapps:zxing-android-embedded:3.3.0@aar'
compile 'com.google.firebase:firebase-messaging:11.0.1'
compile 'com.google.firebase:firebase-core:11.0.1'
compile 'com.google.firebase:firebase-analytics:11.0.1'

compile 'com.flurry.android:analytics:6.4.2'
compile 'com.android.support.constraint:constraint-layout:+'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'

Answer Source

This error throws because of in GooglePlayService package some changes are happened. They moves some class files and there methods to Firebase pacakge. Reference link are: https://developers.google.com/android/guides/releases#october_2016_-_version_98 Now need to changes some project link on build.gradle file.

apply plugin: 'com.android.application'
android {
    compileSdkVersion 26
    buildToolsVersion '26.0.0'
    defaultConfig {
        minSdkVersion 16
        targetSdkVersion 26
        multiDexEnabled = true
    }

    def applicationVersion = '1.20170612'
dexOptions {
    preDexLibraries = false
    javaMaxHeapSize "2g"
}
enter code here
lintOptions {
    checkReleaseBuilds false
    // Or, if you prefer, you can continue to check for errors in release builds,
    // but continue the build even when errors are found:
    abortOnError false

}

buildTypes {
    release {
        minifyEnabled false
    }
    debug {
        minifyEnabled false
    }
    }
}
dependencies {
compile project(':paymentGatewayCommons')
compile project(':paypal')
compile project(':paytm')
compile project(':payu')
compile 'com.fasterxml.jackson.core:jackson-core:2.9.0.pr1'
compile 'com.fasterxml.jackson.core:jackson-annotations:2.9.0.pr1'
compile 'com.fasterxml.jackson.core:jackson-databind:2.9.0.pr1'
compile 'com.android.support:multidex:1.0.1'
compile 'com.google.android.gms:play-services-base:11.0.1'
compile 'com.google.android.gms:play-services-cast-framework:11.0.1'
compile 'com.google.android.gms:play-services-places:11.0.1'
compile 'com.google.android.gms:play-services-nearby:11.0.1'
compile 'com.google.android.gms:play-services-maps:11.0.1'
compile 'com.google.android.gms:play-services-ads:11.0.1'
compile 'com.google.android.gms:play-services-auth:11.0.1'
compile 'com.google.android.gms:play-services-gcm:11.0.1'
compile 'com.google.android.gms:play-services-analytics:11.0.1'
compile 'com.google.android.gms:play-services-location:11.0.1'
compile 'com.google.maps.android:android-maps-utils:0.4.+'
compile 'com.google.zxing:core:3.2.0'
compile 'com.journeyapps:zxing-android-embedded:3.3.0@aar'
compile 'com.google.firebase:firebase-appindexing:11.0.1'
compile 'com.google.firebase:firebase-messaging:11.0.1'
compile 'com.google.firebase:firebase-core:11.0.1'
compile 'com.google.firebase:firebase-analytics:11.0.1'
compile 'com.flurry.android:analytics:6.4.2'
compile 'com.android.support.constraint:constraint-layout:+'


  testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'

Also change in Main project build.gradle file

dependencies {
        classpath 'com.android.tools.build:gradle:2.3.3'
        classpath 'com.google.gms:google-services:3.1.0'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }