简体   繁体   中英

Gradle settings for this project are not configured yet - android studio

I'm trying to load an existing project and i'm running into these problems:

在此处输入图片说明

clicking ok i will have this:

在此处输入图片说明

在此处输入图片说明

Searching here I have not found grangle 2.2.2. Minimum grandle is 3.0.0

build.grandle :

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

buildscript {
    repositories {
        jcenter()
        google()
    }
    dependencies {
    classpath 'com.android.tools.build:gradle:2.2.2'

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

allprojects {
repositories {
    jcenter()
    }
}

app.build.grande :

apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion '23.0.2'

defaultConfig {
    applicationId "com.prouast.heartbeat"
    minSdkVersion 15
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
}

// add a task that calls regular ndk-build(.cmd) script from app directory
task ndkBuild(type: Exec, description: 'Compile JNI source via NDK') {
    def ndkDir = android.ndkDirectory
    commandLine "$ndkDir/ndk-build",
            '-C', file('src/main/jni').absolutePath, // relative path to jni source
            'NDK_LIBS_OUT=../jniLibs',
            '-j', Runtime.runtime.availableProcessors(),
            'all',
            'NDK_DEBUG=1'
}

task ndkClean(type: Exec, description: 'Clean JNI object files') {
    def ndkDir = android.ndkDirectory
    commandLine "$ndkDir/ndk-build",
            '-C', file('src/main/jni').absolutePath, // relative path to jni source
            'NDK_LIBS_OUT=../jniLibs',
            'clean'
}

// add this task as a dependency of Java compilation
tasks.withType(JavaCompile) {
    compileTask -> compileTask.dependsOn(['ndkBuild'])
}

clean.dependsOn(['ndkClean'])

sourceSets.main {
    jni.srcDirs = []
    //jniLibs.srcDir 'src/main/libs'
}

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

dependencies {
compile 'org.apache.commons:commons-io:1.3.2'
compile 'com.android.support:appcompat-v7:23.1.1'
compile project(':libraries:opencv')
}

Need I to change something on app grandle or anybody have some suggestion? Could you suggest me some links to follow or explain step by step how can I solve it?

EDIT : adding the jcenter to gradle.build resolves the issue:

buildscript {
    repositories {
    mavenLocal()
    mavenCentral()
    jcenter()
}

只需单击Studio的“确定”即可自动执行Gradle配置。

单击“确定”以进行gradle包装,或在build.gradle中手动进行并更新以下行:

    **classpath 'com.android.tools.build:gradle:3.2.1'**

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM