Android 库必须使用完全相同的版本规范

Android 库必须使用完全相同的版本规范,android,Android,我是android新手。我的项目API等级25。当我运行项目时,它显示构建成功..,但2秒后,应用程序停止 这是我的格拉德尔: apply plugin: 'com.android.application' android { compileSdkVersion 25 buildToolsVersion "25.0.2" defaultConfig { applicationId "com.opent.fusedlocationproviderapp"

我是android新手。我的项目API等级25。当我运行项目时,它显示
构建成功..
,但2秒后,应用程序停止

这是我的格拉德尔:

apply plugin: 'com.android.application'

android {

    compileSdkVersion 25
    buildToolsVersion "25.0.2"
    defaultConfig {
        applicationId "com.opent.fusedlocationproviderapp"
        minSdkVersion 15
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }}

dependencies 
{
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:support-compat:25.3.1'

    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    testCompile 'junit:junit:4.12'
    compile 'com.google.android.gms:play-services:11.0.4'

}
apply plugin: 'com.google.gms.google-services'

我在网上得到建议


编译'com.android.support:support compat:25.3.1'
所有com.android.support库必须使用与25.3.1,25.2.0版本完全相同的版本规范(混合修订可能导致运行时崩溃)。 示例包括ldecom.android.support:25.3.1 支持:动画向量drwabale:25.2.0


我需要在Gradle中做哪些更改?

您的google play服务使用的是旧版本,因为它们依赖于支持库,所以您会遇到冲突

最新版本为:

compile 'com.google.android.gms:play-services:11.2.2'

请记住,对于版本差异,您只会收到警告,而不会收到错误,这意味着它们仍然可以工作,但同样,最好保持最新状态。

compile'com.android.support:support compat:25.3.1'编译'com.android.support:support compat:25.0.1'编译'com.android.support:support compat:25.0.2'显示崩溃日志。也许这不是它崩溃的原因?现在,当运行我的项目时,事件日志显示“无法绑定到本地8600以进行调试器。@Hristo Stoyanovtry clean-rebuildnow事件日志显示“即时运行执行了完整的生成和安装,因为设备上的安装与磁盘上的本地生成不匹配”。@Hristo Stoyanov