2016-03-14 46 views
1

我在Android Studio 1.5.1中遇到了一個錯誤,我無法弄清楚它是否適合我的生活。它讀取,沒有這樣的屬性:類的類bootClasspath:com.android.builder.core.AndroidBuilder

"Error:Execution failed for task ':app:dexguardDebug'. No such property: bootClasspath for class: com.android.builder.core.AndroidBuilder"

當運行在命令行./gradle2 debugCompile --stacktrace,它顯示了這一點:

出了什麼問題:

Task 'compileDebug' is ambiguous in root project 'BestWestern'. Candidates are: 'compileDebugAidl', 'compileDebugAndroidTestAidl', 'compileDebugAndroidTestJavaWithJavac', 'compileDebugAndroidTestNdk', 'compileDebugAndroidTestRenderscript', 'compileDebugAndroidTestSources', 'compileDebugJavaWithJavac', 'compileDebugNdk', 'compileDebugRenderscript', 'compileDebugSources', 'compileDebugUnitTestJavaWithJavac', 'compileDebugUnitTestSources'.

我不完全知道該怎麼做,從這一點

這裏是我的等級文件:

////////////////////// 
// Module: app 
////////////////////// 
apply plugin: 'com.android.application' 
apply plugin: 'dexguard' 

android { 
    compileSdkVersion 23 
    buildToolsVersion "23.0.1" 
    defaultConfig { 
     applicationId "com.bestwestern.android" 
     minSdkVersion 14 
     targetSdkVersion 23 
     versionCode 143 
     versionName "5.5" 
     testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 
    } 
    buildTypes { 
     /*release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
      debuggable true 
     }*/ 


     debug { 
      proguardFile getDefaultDexGuardFile('dexguard-debug.pro') 
      proguardFile 'dexguard-project.txt' 
      proguardFile 'proguard-project.txt' 
     } 
     release { 
      proguardFile getDefaultDexGuardFile('dexguard-release.pro') 
      proguardFile 'dexguard-project.txt' 
      proguardFile 'proguard-project.txt' 
     } 
    } 
    packagingOptions { 
     exclude 'LICENSE.txt' 
    } 

    /*productFlavors { 
    }*/ 
} 

repositories { 
    mavenCentral() 
    maven { url 'https://maven.fabric.io/public' } 
    flatDir { 
     dirs 'libs' 
    } 
} 

dependencies { 
    //compile 'com.android.support:multidex:1.0.1' 
    compile fileTree(include: ['*.jar'], dir: 'libs') 
    compile 'com.android.support:appcompat-v7:23.0.1' 
    compile 'com.android.support:cardview-v7:23.0.1' 
    compile 'com.google.android.gms:play-services-location:7.0.0' 
    compile project(':androidtimessquare') 
    compile 'com.squareup.retrofit:retrofit:1.9.0' 
    compile 'com.squareup.okhttp:okhttp-urlconnection:2.2.0' 
    compile 'com.squareup.okhttp:okhttp:2.2.0' 
    //compile 'com.squareup.picasso:picasso:2.+' 
    compile 'com.android.support:recyclerview-v7:23.0.1' 
    compile 'de.hdodenhof:circleimageview:1.2.2' 
    compile 'uk.co.chrisjenx:calligraphy:2.1.0' 
    compile 'de.greenrobot:eventbus:2.4.0' 
    //compile(name: 'masterpass-android-library-release', ext: 'aar') 

    // AndroidJUnit Runner dependencies 
    androidTestCompile 'com.android.support:support-annotations:23.0.1' 
    androidTestCompile 'com.android.support.test:runner:0.2' 
    androidTestCompile 'com.android.support.test:rules:0.2' 
    // Espresso dependencies 
    androidTestCompile 'com.android.support.test.espresso:espresso-core:2.1' 
    compile files('libs/adobeMobileLibrary-4.6.1.jar') 
    compile 'com.facebook.android:facebook-android-sdk:4.1.0' 
    //compile 'org.twitter4j:twitter4j-core:4.0.2' 
    compile('com.twitter.sdk.android:tweet-composer:[email protected]') { 
     transitive = true; 
    } 
    compile 'com.github.bumptech.glide:glide:3.6.+' 
    compile 'com.readystatesoftware.sqliteasset:sqliteassethelper:+' 
    compile project(':googlemapssdkm4b_lib') 
    compile files('libs/RootShell.jar') 
    //compile files('libs/dexguard-util.jar') 
} 

////////////////////// 
// Project: 
////////////////////// 
// Top-level build file where you can add configuration options common to all sub-projects/modules. 

buildscript { 
    repositories { 
     maven { url 'http://repo1.maven.org/maven2' } 
     mavenCentral() 
     flatDir dirs: 'lib' 
    } 
    dependencies { 
     /*classpath ('com.android.tools.build:gradle:1.0.0') { 
      exclude module: 'proguard-gradle' 
     } 
     classpath "jp.leafytree.gradle:gradle-android-scala-plugin:1.3.1" 
     classpath ('net.sf.proguard:proguard-gradle:5.0') { 
      force = true 
     }*/ 

     // NOTE: Do not place your application dependencies here; they belong 
     // in the individual module build.gradle files 

     classpath 'com.android.tools.build:gradle:1.5.0' 
     classpath ':dexguard:' 
    } 
} 

allprojects { 
    repositories { 
     maven { url 'http://repo1.maven.org/maven2' } 
    } 
} 
+0

發佈您的build.gradle以及您正在使用哪個版本的gradle插件。 –

+0

對不起。我已經包括他們了 – flashy

回答

0

這很可能會導致Android Gradle插件和DexGuard庫的不兼容版本。嘗試將Android Gradle插件的版本降級到1.3.1。

我可以問你正在使用哪個版本的DexGuard?

相關問題