Gradle项目同步失败。 Android studio 2.3.1中的基本功能(例如,编辑,调试......)

时间:2017-03-21 05:53:54

标签: android-studio android-gradle

我无法运行该项目,我已检查过很多网站&堆栈溢出没有任何问题。 未找到Gradle DSL方法:' compile()& 构建文件可能缺少Gradle插件' Click here to see my Screenshot

的build.gradle(APP)

apply plugin: 'com.android.application'

android {
compileSdkVersion 21
buildToolsVersion '25.0.2'
defaultConfig {
    applicationId "info.devexchanges.bluetoothchatapp"
    minSdkVersion 21
    targetSdkVersion 21
    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(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.0'
testCompile 'junit:junit:4.12'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:design:21'
compile 'com.android.volley:volley:1.0.0'

}

的build.gradle

buildscript {
repositories {
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:2.3.1'
    apply plugin: 'announce'

    apply plugin: 'build-announcements'
    compile 'com.android.volley:volley:1.0.0'


}
}

allprojects {
repositories {
    jcenter()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

1 个答案:

答案 0 :(得分:1)

查找并替换此代码

private final BroadcastReceiver discoveryFinishReceiver = new BroadcastReceiver(){     @覆盖     public void onReceive(Context context,Intent intent){         String action = intent.getAction();

$ git clone https://aur.archlinux.org/trace-cmd.git
$ cd trace-cmd
$ makepkg -si

};

希望你能得到这个!