All com.android.support libraries must use the exact same version specification

前端 未结 30 2202
忘掉有多难
忘掉有多难 2020-11-21 05:10

After updating to android studio 2.3 I got this error message. I know it\'s just a hint as the app run normally but it\'s really strange.

All com.andr

30条回答
  •  Happy的楠姐
    2020-11-21 05:54

    Use variables: Doing something like the following will make it easier for you to ensure that you use the same version with all libraries

    dependencies {
    
        ext {
            support_library_version = '25.2.0'
            google_play_services_version = '10.2.0'
        }
    
        //#####################################################################
        //          Support Library
        //#####################################################################
        compile "com.android.support:appcompat-v7:${support_library_version}"
        compile "com.android.support:palette-v7:${support_library_version}"
        compile "com.android.support:design:${support_library_version}"
    
        //#####################################################################
        //          Google Play Services
        //#####################################################################
        compile "com.google.android.gms:play-services-auth:${google_play_services_version}"
        compile "com.google.android.gms:play-services-ads:${google_play_services_version}"
        compile "com.google.android.gms:play-services-analytics:${google_play_services_version}"
    
        //#####################################################################
        //          Firebase
        //#####################################################################
        compile "com.google.firebase:firebase-core:${google_play_services_version}"
        compile "com.google.firebase:firebase-auth:${google_play_services_version}"
        compile "com.google.firebase:firebase-messaging:${google_play_services_version}"
    

    More information on how Google suggests that you handle this versioning can be found in this article: https://developer.android.com/studio/build/index.html#top-level

提交回复
热议问题