【问题标题】:Error:(46, 0) Could not find property 'compile' on org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler_Decorated@1e88544b错误:(46, 0) 在 org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler_Decorated@1e88544b 上找不到属性“编译”
【发布时间】:2016-09-07 23:01:41
【问题描述】:

我买了一个源代码,我得到这个错误:

Error:(46, 0) Could not find property 'compile' on
org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler_Decorated@1e88544b

apply plugin: 'com.android.application'

android {
    compileSdkVersion 21
    buildToolsVersion "21.1.2"

    defaultConfig {
        applicationId "com.pongodev.recipesapp"
        minSdkVersion 11
        targetSdkVersion 21
        versionCode 5
        versionName "3.0.3"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])

    // Main libraries, you always need this libraries in your project. do not remove them.

    // Important library to create material design. do not remove this.
    compile project(':materialDesign')

    // Library to create tabbar

    // Library to create ripple effect. work together with materialDesign library.

    // Library to create rounded, circle, and any shape image.

    // Library load lazy images.

    // Library to create simple list.

    // Library to create complex clickable list.

    // Library to create material dialog.

    // Library to create animation imageview.

    compile
    'com.android.support:appcompat-v7:24.2.0' compile
    'com.android.support:support-v4:24.2.0' compile
    'com.google.android.gms:play-services:9.4.0' compile
    'com.jpardogo.materialtabstrip:library:1.0.6' compile
    'com.github.traex.rippleeffect:library:1.2.2' compile 'com.makeramen:roundedimageview:1.4.0'
    compile 'com.squareup.picasso:picasso:2.4.0'
    compile 'com.android.support:recyclerview-v7:24.2.0'
    compile 'com.android.support:cardview-v7:24.2.0'
    compile 'com.afollestad:material-dialogs:0.6.0'
    compile 'com.flaviofaria:kenburnsview:1.0.5'
    compile 'com.google.android.gms:play-services-ads:9.4.0'
    compile 'com.google.android.gms:play-services-auth:9.4.0'
    compile 'com.google.android.gms:play-services-gcm:9.4.0'
}

【问题讨论】:

    标签: java android gradle


    【解决方案1】:

    如果您正确复制了 Gradle 构建脚本,它会在接近尾声时被搞砸。 这些行都应该是compile 'asdfasdfasdf',而不是一行的compile,然后是下一行的'asdfasdfasdf' compile

    所以块

    compile
    'com.android.support:appcompat-v7:24.2.0' compile
    'com.android.support:support-v4:24.2.0' compile
    'com.google.android.gms:play-services:9.4.0' compile
    'com.jpardogo.materialtabstrip:library:1.0.6' compile
    'com.github.traex.rippleeffect:library:1.2.2' compile 'com.makeramen:roundedimageview:1.4.0'
    

    应该阅读

    compile 'com.android.support:appcompat-v7:24.2.0'
    compile 'com.android.support:support-v4:24.2.0'
    compile 'com.google.android.gms:play-services:9.4.0'
    compile 'com.jpardogo.materialtabstrip:library:1.0.6'
    compile 'com.github.traex.rippleeffect:library:1.2.2'
    compile 'com.makeramen:roundedimageview:1.4.0'
    

    【讨论】:

    • 请告诉我如何修复我买了一个代码,我愿意编辑一些数据库文件,但我没有编码经验:(
    • 我已经告诉过你了。只需修复我告诉你存在的错误,它应该可以工作
    • 您的评论缺少内容
    • 如果不能,请帮我编辑一下,非常感谢
    • 不,'asdfasdfasdf' 当然是你依赖的占位符。你甚至读过我的回答吗?显然不是。
    猜你喜欢
    • 2016-03-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-03-04
    • 1970-01-01
    • 2012-05-22
    相关资源
    最近更新 更多