gpt4 book ai didi

java - 无法在对象上找到参数 [目录 'libs'] 的方法实现()

转载 作者:塔克拉玛干 更新时间:2023-11-02 20:22:52 26 4
gpt4 key购买 nike

Error Message:- Could not find method implementation() for arguments [directory'libs'] on object of typeorg.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

Code

apply plugin: 'com.android.application'

ext {
supportVersion='27.1.1'
}
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.eassycars.www.dlservices"
minSdkVersion 17
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
buildscript {
repositories {
jcenter()
}
configure(':app') {
dependencies {
classpath 'com.android.tools.build.gradle:4.8.1'
implementation fileTree (include: ['*.jar'], dir: 'libs')
implementation "com.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler :$supportVersion"
implementation "com.android.support:appcompat-v7:$supportVersion"
implementation "com.android.support:cardview-v7:$supportVersion"
implementation "com.android.support:recyclerview-v7:$supportVersion"
implementation "com.android.support:design:$supportVersion"
implementation "com.android.support:palette-v7:$supportVersion"
implementation "com.android.support:customtabs:$supportVersion"
implementation "com.android.support:support-v4:$supportVersion"
implementation 'com.google.android.exoplayer:exoplayer:r2.0.4'
// utils
implementation 'com.github.bumptech.glide:glide:4.0.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.0.0'
implementation 'com.koushikdutta.ion:ion:2.1.7'
implementation 'com.github.Commit451:bypasses:1.0.4'
implementation 'com.jakewharton:butterknife:8.8.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.0'
implementation 'com.drewnoakes:metadata-extractor:2.9.1'
implementation 'com.orhanobut:hawk:2.0.1'
classpath 'com.google.gms:google-services:3.1.1'
implementation 'com.android.support:support-annotations:27.1.1'
}}
}
}

最佳答案

我更新了“gradle/wrapper/gradle-wrapper.properties”文件中的“distributionUrl”以匹配当前的 gradle 版本。

我还更新了顶级 build.gradle 文件中的类路径以匹配 gradle API 级别。

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

重新同步,然后构建正常。

关于java - 无法在对象上找到参数 [目录 'libs'] 的方法实现(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51136966/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com