Android gradle出错“原因:启动失败:构建文件”

时间:2016-06-23 16:01:49

标签: android android-gradle

我的应用程序gradle无法编译。

它标志着下一个错误:

Error

我的完整gradle代码是:

    apply plugin: 'com.android.application'
model {
    android {
        compileSdkVersion 21
        buildToolsVersion '23.0.2'

        defaultConfig {
            applicationId "formiik.com.mobiik.www"
            minSdkVersion 16
            targetSdkVersion 19
            versionCode 160
            versionName "5.3.desa"
            multiDexEnabled true
        }
        compileOptions {
            sourceCompatibility JavaVersion.VERSION_1_7
            targetCompatibility JavaVersion.VERSION_1_7
        }

        buildTypes {
            release {
                minifyEnabled true
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
            }
        }
        dexOptions {
            incremental true
            javaMaxHeapSize "4g"
        }
        lintOptions {
            disable 'MissingTranslation'
        }
}


def openCVAndroidSdkDir = "/Users/jonathan/Development/Formiik/Desarollo/formiik-android-s/Formiik/opencv_sdk/sdk/native"

android.ndk {
    moduleName = "native"
    cppFlags += "-I${file(openCVAndroidSdkDir + "/jni/include")}".toString()
    cppFlags += "-frtti"
    cppFlags += "-fexceptions"
    ldLibs += ["log", "opencv_java3"]
    stl    = "gnustl_static"
}

android.productFlavors {

    create("arm") {
        ndk.abiFilters += "armeabi"
        ndk.ldFlags += "-L${file('src/main/jniLibs/armeabi')}".toString()
    }
    create("arm7") {
        ndk.abiFilters += "armeabi-v7a"
        ndk.ldFlags += "-L${file('src/main/jniLibs/armeabi-v7a')}".toString()
    }
    create("arm8") {
        ndk.abiFilters += "arm64-v8a"
        ndk.ldFlags += "-L${file('src/main/jniLibs/arm64-v8a')}".toString()
    }
}
}

repositories {
    maven { url 'https://zendesk.artifactoryonline.com/zendesk/repo' }
    maven { url "https://jitpack.io" }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile project(':volley')
    compile 'com.android.support:support-v13:23.1.1'
    compile 'com.android.support:cardview-v7:23.1.1'
    compile 'com.android.support:recyclerview-v7:23.1.1'
    compile 'com.google.android.gms:play-services-base:8.4.0'
    compile 'com.google.android.gms:play-services-gcm:8.4.0'
    compile 'com.google.android.gms:play-services-maps:8.4.0'
    compile 'com.google.android.gms:play-services-location:8.4.0'
    compile 'com.crittercism:crittercism-android-agent:5.+'
    compile 'com.github.jd-alexander:library:1.0.5'
    compile 'com.google.code.gson:gson:2.3'
    compile 'com.zendesk:sdk:1.3.2.2'
    compile 'com.facebook.stetho:stetho:1.1.1'
    compile 'com.facebook.stetho:stetho-okhttp:1.1.1'
    compile 'com.cocosw:undobar:1.+@aar'
    compile 'net.lingala.zip4j:zip4j:1.3.2'
    compile 'com.ocpsoft:ocpsoft-pretty-time:1.0.7'
    compile 'in.srain.cube:ultra-ptr:1.0.10'
    compile 'com.github.PhilJay:MPAndroidChart:v2.1.6'
    compile 'com.github.ksoichiro:android-observablescrollview:1.+'
    compile 'com.github.bumptech.glide:glide:3.6.1'
    compile 'com.google.android.gms:play-services-appindexing:8.4.0'
}

我正在尝试使用相同的gradle结构集成另一个项目(该项目工作正常)。但在这个新项目中我得到了这个错误。谢谢你的帮助。

1 个答案:

答案 0 :(得分:0)

还没有足够的声誉发表评论,但您尝试过Build > Clean吗?这可以解决Gradle的一大堆问题,特别是那些与生成的文件有关的问题。