2017-05-06 68 views
0

你好我似乎無法在我的gradle中的任何地方找到版本13.0.0 ..我也將它設置爲23.4.0在gradle中下面的代碼,但它不會改變任何東西。Android支持v4的Gradle依賴問題13.0.0&23.4.0

感謝:

apply plugin: 'com.android.application' 

android { 
    buildTypes { 
    compileSdkVersion 23 
    buildToolsVersion '25.0.0' 

    defaultConfig { 
     applicationId "com.parse.starter" 
     minSdkVersion rootProject.ext.minSdkVersion 
     targetSdkVersion rootProject.ext.targetSdkVersion 
     versionCode 1 
     versionName "1.0" 
     multiDexEnabled true 
    } 
     release { 


      minifyEnabled true 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
     /*dexOptions { 
      javaMaxHeapSize "4g";;- 


     }*/ 
} 
    buildToolsVersion '25.0.0' 
} 



ext { 

    supportLibraryVersion = '23.4.0' 
    playServicesVersion = '3.2.65' 
    boltVersion = '1.4.0' 
} 

subprojects { 
    project.configurations.all { 
     resolutionStrategy.eachDependency { details -> 
      if (details.requested.jar == 'com.android.support' 
        && !details.requested.name.contains('multidex')) { 
       details.useVersion "$supportLibraryVersion" 
      } 
      if (details.requested.jar == 'com.google.android.gms'){ 
       details.useVersion "playServicesVersion" 
      } 
      if (details.requested.jar == 'com.android.support:animated-vector-drawable'){ 

       details.useVersion "$supportLibraryVersion" 

      } 
      if (details.requested.jar == 'com.parse.bolts:bolts-tasks'){ 

       details.useVersion "$boltVersion" 

      } 


     } 


    } 
} 

configurations.all { 
    resolutionStrategy { 
     // fail eagerly on version conflict (includes transitive dependencies) 
     // e.g. multiple different versions of the same dependency (group and name are equal) 
     failOnVersionConflict() 

     // prefer modules that are part of this build (multi-project or composite build) over external modules 
     preferProjectModules() 


     dependencySubstitution { 

      substitute module('com.android.support:animated-vector-drawable:23.4.0') with module('com.android.support:animated-vector-drawable:23.0.0') 
      //substitute module('com.google.android.gms:play-services:3.2.65') with module('com.google.android.gms:play-services:9.4.0') 
      substitute module('com.android.support:appcompat-v7:13.0.0') with module('com.android.support:appcompat-v7:23.4.0') 
     } 
    }} 

dependencies { 
    compile "com.android.support:appcompat-v7:$supportLibraryVersion" 
    compile "com.google.android.gms:play-services:$playServicesVersion" 
    compile "com.google.android.gms:play-services-maps:$playServicesVersion" 
    compile "com.parse.bolts:bolts-tasks:$boltVersion" 
    compile 'com.parse:parse-android:1.13.0' 
    compile 'com.android.support:multidex:1.0.0' 
    compile 'com.android.support.constraint:constraint-layout:1.0.2' 
    compile 'com.google.maps.android:android-maps-utils:0.3' 
    compile 'com.android.support:support-v4:13.0.0' 

} 

錯誤日誌:衝突被發現以下模塊之間: - com.android.support:support-v4:13.0.0 - com.android.support:support- v4:23.4.0

+0

固定,我更改'com.android.support:support-v4:23.0.0'並使用「force'com.android.support:support-v4:23.0.0'」。似乎已經工作。 –

回答

0

刪除compile 'com.android.support:support-v4:13.0.0'裏面的依賴關係。您有兩個版本的support-v4工件。

dependencies { 
    compile "com.android.support:appcompat-v7:$supportLibraryVersion" 
    compile "com.google.android.gms:play-services:$playServicesVersion" 
    compile "com.google.android.gms:play-services-maps:$playServicesVersion" 
    compile "com.parse.bolts:bolts-tasks:$boltVersion" 
    compile 'com.parse:parse-android:1.13.0' 
    compile 'com.android.support:multidex:1.0.0' 
    compile 'com.android.support.constraint:constraint-layout:1.0.2' 
    compile 'com.google.maps.android:android-maps-utils:0.3' 
    compile 'com.android.support:support-v4:13.0.0' // <-- This is your version 13.1.0 

}