带有id' crashlytics'的插件没有找到Android studio最新插件的问题

时间:2014-07-16 09:33:21

标签: android-studio android-gradle crashlytics

对于以下gradle构建配置,我面临错误:(11,0)插件ID为' crashlytics'找不到错误。

buildscript {
    repositories {
        maven { url 'http://download.crashlytics.com/maven' }
    }

    dependencies {
    }
}

apply plugin: 'android'
apply plugin: 'crashlytics'
apply plugin: 'hugo'


repositories {
    maven { url 'http://download.crashlytics.com/maven' }
}




android {
    compileSdkVersion 19
    buildToolsVersion '20.0.0'

    defaultConfig {
        applicationId "com.wiznsystems.android"
        minSdkVersion 15
        targetSdkVersion 19
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile files('libs/smartconfiglib.jar')
    // You must install or update the Support Repository through the SDK manager to use this dependency.
    compile 'com.crashlytics.android:crashlytics:1.+'
    compile 'com.android.support:support-v4:19.+'
    compile 'com.google.android.gms:play-services:4.2.42'
    compile 'com.jakewharton.hugo:hugo-runtime:1.1.0'
    compile 'com.squareup.retrofit:retrofit:1.+'
    compile 'com.android.support:appcompat-v7:19.+'
    compile 'com.jakewharton:butterknife:5.+'
    compile 'de.greenrobot:eventbus:2.2.1'
    compile 'fr.avianey:facebook-android-api:+@aar'
    compile 'com.squareup.picasso:picasso:2.+'
    compile 'de.keyboardsurfer.android.widget:crouton:1.8.4'
    compile project(':apptentiveandroidsdk')
}

我做错了吗?或者是否有任何解决方法来构建它?

3 个答案:

答案 0 :(得分:5)

我有同样的问题。我最终做的是将命令的顺序与Crashlytics提供的内容一致。我有类似于你的东西,它没有用。一旦它改变了它工作的文档的确切顺序。这就是我现在的样子。希望这可以帮助。

buildscript {
  repositories {
      mavenCentral()
      maven { url 'http://download.crashlytics.com/maven' }
  }
  dependencies {
      classpath 'com.android.tools.build:gradle:0.12.+'
      classpath 'com.crashlytics.tools.gradle:crashlytics-gradle:1.+'
  }
}

apply plugin: 'android'
apply plugin: 'crashlytics'

repositories {
  mavenCentral()
  maven { url 'http://download.crashlytics.com/maven' }
}

dependencies {
  compile fileTree(dir: 'libs', include: ['*.jar'])
  compile 'com.android.support:appcompat-v7:19.+'
  compile 'com.android.support:support-v4:19.0.+'
  compile 'com.squareup.picasso:picasso:2.3.2'
  compile 'com.joanzapata.android:android-iconify:1.0.6'
  compile 'com.github.hotchemi:android-rate:0.3.1'
  compile 'com.loopj.android:android-async-http:1.4.5'
  compile 'com.github.satyan:sugar:1.3'
  compile 'com.crashlytics.android:crashlytics:1.+'
}

android {
  compileSdkVersion 19
  buildToolsVersion "20"

defaultConfig {
    minSdkVersion 14
    targetSdkVersion 19
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        runProguard false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
    }
}
}

答案 1 :(得分:1)

尝试通知classpath依赖项:

buildscript {
    repositories {
        maven { url 'http://download.crashlytics.com/maven' }
    }

    dependencies {
        classpath 'com.crashlytics.tools.gradle:crashlytics-gradle:1.+'
    }
}

答案 2 :(得分:0)

在与此错误斗争了几个小时后,我最终删除了我的主目录中的“.gradle”文件夹,问题就消失了!因此,如果您遇到此问题,请先尝试删除.gradle文件夹,然后重建项目。