Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/192.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 添加recyclerView依赖项时找不到参数的方法complie()_Android_Android Gradle Plugin - Fatal编程技术网

Android 添加recyclerView依赖项时找不到参数的方法complie()

Android 添加recyclerView依赖项时找不到参数的方法complie(),android,android-gradle-plugin,Android,Android Gradle Plugin,我正在尝试添加一个依赖项,以便可以使用RecyclerView 在andriod studio中,我进入了构建>编辑库和依赖项。然后在choose library依赖项中搜索Recycler。我在下面找到了图书馆 com.android.support:recyclerview-v7 (com.android.support:recyclerview-v7:26.0.0-alpha1) 添加此项后,gradle无法构建。我在这里读到,这是由于版本,这是应该更改为'com.android.sup

我正在尝试添加一个依赖项,以便可以使用RecyclerView

在andriod studio中,我进入了构建>编辑库和依赖项。然后在choose library依赖项中搜索Recycler。我在下面找到了图书馆

com.android.support:recyclerview-v7 (com.android.support:recyclerview-v7:26.0.0-alpha1)
添加此项后,gradle无法构建。我在这里读到,这是由于版本,这是应该更改为'com.android.support:recyclerview-v7:25.3.1'

但是现在我收到了一个不同的错误消息,我没有注意到

Error:(30, 1) A problem occurred evaluating project ':app'.
在org.gradle.api.internal.artifacts.dsl.dependency.DefaultDependencyHandler类型的对象上找不到参数[com.android.support:recyclerview-v7:25.3.1]的方法complie()

gradle

 apply plugin: 'com.android.application'

 android {
    compileSdkVersion 25
    buildToolsVersion "26.0.1"
    defaultConfig {
        applicationId "com.example.xxx.yyyyyyyyy"
        minSdkVersion 24
        targetSdkVersion 25
        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(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', 
{
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:25.3.1'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    testCompile 'junit:junit:4.12'
    complie 'com.android.support:recyclerview-v7:25.3.1'
}
清单



你有
complie
而不是
compile

你有
complie
而不是
compile

找不到方法complie()

您的
依赖项中有一个小的输入错误

更改:

complie 'com.android.support:recyclerview-v7:25.3.1'
与:

找不到方法complie()

您的
依赖项中有一个小的输入错误

更改:

complie 'com.android.support:recyclerview-v7:25.3.1'
与:

compile 'com.android.support:recyclerview-v7:25.3.1'