【问题标题】:Error - "Gradle DSL method not found: compile()" while adding recyclerview [duplicate]错误 - 添加 recyclerview 时“找不到 Gradle DSL 方法:compile()”[重复]
【发布时间】:2016-08-24 12:54:20
【问题描述】:

我想在我的应用中使用 recyclerview。我在应用级 build.gradle 文件中添加了“complie 'com.android.support:recyclerview-v7:23.3.0'”。出现错误 - 错误:(26, 0) 未找到 Gradle DSL 方法:'complie()' 可能的原因:

  • 项目“Rview”可能正在使用不包含该方法的 Gradle 版本。 打开 Gradle 包装文件
  • 构建文件可能缺少 Gradle 插件。 应用 Gradle 插件
  • 这里是我的 build.gradle 文件-

    apply plugin: 'com.android.application'
    android {
    compileSdkVersion 23
    buildToolsVersion "23.0.3"
    
    defaultConfig {
        applicationId "com.sid.rview"
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    }
    
    dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.3.0'
    complie 'com.android.support:recyclerview-v7:23.3.0'
    }
    

    【问题讨论】:

      标签: android


      【解决方案1】:

      从任何网站复制编译链接时,请自行编写compile,因为许多网站的字符编码与android studio不同。大多数情况下,此问题仅针对 compile 方法中的第一个 c 方法

      【讨论】:

      • 谢谢老哥,成功了
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-11-19
      • 2015-02-21
      • 2015-03-24
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多