如何更新谷歌播放服务m2repository?

时间:2017-12-09 10:32:10

标签: android google-play-services

我的dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') compile fileTree(include: ['*.jar'], dir: 'app/libs') androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.android.support', module: 'support-annotations' }) //Ormlite compile('com.crashlytics.sdk.android:crashlytics:2.6.8@aar') { transitive = true; } //compile files('libs/YouTubeAndroidPlayerApi.jar') //compile 'com.github.nisrulz:screenshott:2.0.0' compile 'com.android.support:appcompat-v7:26.1.0' compile 'com.android.support:recyclerview-v7:26.1.0' compile 'com.android.support:cardview-v7:26.1.0' compile 'com.android.support:design:26.1.0' compile 'com.android.support:support-v4:26.1.0' compile 'com.android.support:mediarouter-v7:26.1.0' compile 'com.android.support:animated-vector-drawable:26.1.0' //compile 'com.android.support:percent:26.1.0' compile 'com.android.support:customtabs:26.1.0' compile 'com.android.support:preference-v7:26.1.0' compile 'com.android.support:preference-v14:26.1.0' compile 'com.google.firebase:firebase-messaging:11.6.2' compile 'com.google.firebase:firebase-core:11.6.2' compile 'com.google.firebase:firebase-database:11.6.2' compile 'com.google.firebase:firebase-auth:11.6.2' compile 'com.google.firebase:firebase-config:11.6.2' compile 'com.google.firebase:firebase-ads:11.6.2' compile 'com.facebook.android:facebook-android-sdk:4.25.0' compile 'com.facebook.android:audience-network-sdk:4.25.0' compile 'com.google.android.gms:play-services-auth:11.6.2' //compile 'com.google.android.gms:play-services-awareness:11.6.2' compile 'com.android.support:multidex:1.0.2' compile 'com.github.bumptech.glide:glide:3.7.0' compile 'com.google.code.gson:gson:2.8.0' compile 'com.blankj:utilcode:1.5.1' compile 'com.j256.ormlite:ormlite-android:5.0' compile 'com.j256.ormlite:ormlite-core:5.0' compile 'com.airbnb.android:lottie:2.2.5' compile 'com.github.lsjwzh.RecyclerViewPager:lib:v1.1.2@aar' //compile 'com.github.lsjwzh.RecyclerViewPager:tablayoutsupport:v1.1.2@aar' compile 'com.evernote:android-job:1.2.1' compile 'com.makeramen:roundedimageview:2.2.1' annotationProcessor 'com.jakewharton:butterknife:8.8.1' compile 'com.jakewharton:butterknife:8.8.1' compile 'com.mindorks:placeholderview:0.7.2' compile 'jp.wasabeef:glide-transformations:2.0.2' /*compile 'com.specyci:residemenu:1.6+'*/ //compile 'me.biubiubiu.justifytext:library:1.1' compile 'com.haozhang.libary:android-slanted-textview:1.2' //compile 'com.southernbox:RippleLayout:0.1.0' compile 'com.squareup.retrofit2:retrofit:2.3.0' compile 'com.squareup.retrofit2:converter-gson:2.3.0' compile 'com.squareup.okhttp3:okhttp:3.8.1' //compile 'com.fivehundredpx:blurringview:1.0.0' compile 'pub.devrel:easypermissions:1.0.1' compile 'com.github.jd-alexander:LikeButton:0.2.3' testCompile 'junit:junit:4.12' compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version" implementation project(':nineoldandroids-library-2.4.0') //Cognito Related dependencies compile 'com.amazonaws:aws-android-sdk-core:2.6.+' compile 'com.amazonaws:aws-android-sdk-pinpoint:2.6.+' compile('com.amazonaws:aws-android-sdk-mobile-client:2.6.+@aar') { transitive = true; } compile('com.amazonaws:aws-android-sdk-auth-core:2.6.+@aar') { transitive = true; } compile('com.amazonaws:aws-android-sdk-auth-ui:2.6.+@aar') { transitive = true; } compile('com.amazonaws:aws-android-sdk-auth-facebook:2.6.+@aar') { transitive = true; } compile('com.amazonaws:aws-android-sdk-auth-google:2.6.+@aar') { transitive = true; } playServices版本为58(11.0.4)。 位置是:

m2repository

Android sdkmanager GUI显示版本58,无可用更新。

此命令

my_android_sdk/extras/google/m2repository/com/google/android/gms

也不会显示./tools/bin/sdkmanager --list 的任何更新。

有没有办法获取m2repository的最新aar - 文件?

解决方案

我在这里找到了包裹:

play-services-ads-11.6.0

play-services-location-11.6.0

1 个答案:

答案 0 :(得分:1)

您不应该依赖SDK的m2repository文件夹中的内容,而应该依赖于您在应用程序上设置的库版本。添加类似依赖项的依赖项时会自动下载AAR:

dependencies {
    ....
    implementation "com.google.android.gms:play-services-auth:$LAST_LIB_VERSION"
    implementation "com.google.android.gms:play-services-drive:$LAST_LIB_VERSION"
    //read below to know $LAST_LIB_VERSION values
    ....
}
//the google play services plugin, applied at the end of the build.gradle file
apply plugin: 'com.google.gms.google-services'

首先,您应该有一个与此类似的项目build.gradle

buildscript {
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath "com.android.tools.build:gradle:$LATEST_AGP_VERSION"
        //as the time of writing $LATEST_AGP_VERSION is 3.0.1

        classpath "com.google.gms:google-services:$GPS_VERSION"
        //read below for $GPS_VERSION values
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
  
      
  1. $ GPS_VERSION 有效值在this page

  2. 内   
  3. $ LAST_LIB_VERSION 有效值:

         
        
    • 如果您使用Firebase功能,请遵循this page的依赖项版本,并列出可用的依赖项here

    •   
    • 如果您使用的是Firebase功能,请遵循this page的依赖项版本,并列出可用的依赖项here

    •   
  4.   

就是这样。