包括cruton库时出错

时间:2015-07-07 11:35:59

标签: android crouton

我正在使用cruton库作为android studio中toast消息的选项。

我已根据https://github.com/keyboardsurfer/Crouton链接上的自述文件添加了代码。但我不断收到错误插件,因为找不到 android:id = maven

 apply plugin: 'com.android.application'

android {
    compileSdkVersion 21
    buildToolsVersion "22.0.1"

    defaultConfig {
        applicationId "com.firstclicker.bengaliclicker"
        minSdkVersion 14
        targetSdkVersion 19
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }

    buildscript {
        repositories {
            mavenCentral()
        }
    }

    repositories {
        mavenCentral()
    }


}

dependencies {
    compile 'com.android.support:support-v4:19.1.+'
    compile 'com.google.android.gms:play-services:+'
    compile files('libs/crouton-1.8.2.jar')
    compile files('libs/picasso-2.5.2.jar')
    compile('de.keyboardsurfer.android.widget:crouton:1.8.5@aar') {
        // exclusion is not necessary, but generally a good idea.
        exclude group: 'com.google.android', module: 'support-v4'
    }

} 

依赖项将插入build.gradle文件中。即使错误仍然存​​在,这是“错误(17,0)插件与id'android-maven'未找到

1 个答案:

答案 0 :(得分:0)

你不需要使用maven。请改用gradle

buildscript {
  repositories {
    mavenCentral()
  }
}

repositories {
  mavenCentral()
}

dependencies {
  ...
  compile('de.keyboardsurfer.android.widget:crouton:1.8.5@aar') {
    // exclusion is not necessary, but generally a good idea.
    exclude group: 'com.google.android', module: 'support-v4'
  }
  ...
}