安卓工作室 在项目 ':app' 上找不到参数 [目录 'libs'] 的方法实现()



我正在尝试加载APP。但我收到一个错误

构建文件"F:\Android Studio Projects\SalesManagement Agent\app\Build.gradle"行:30

评估项目":应用程序"时出现问题。

在项目":app"上找不到参数[目录"libs"]的方法implementation((。

渐变

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}}

apply plugin: 'com.android.application'
android {
compileSdkVersion 30
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.example.anik.agent"
minSdkVersion 14
targetSdkVersion 30
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'org.apache.httpcomponents:httpcore:4.4.10'
implementation('org.apache.httpcomponents:httpmime:4.5.6') {
exclude module: 'httpclient'
}
}

如有任何帮助,我们将不胜感激。

尝试构建工具30.0.3,并确保Gradle插件是最新的。当时关键字implementation不存在,被称为compile(已弃用,将在Gradle 7中删除(。

请检查"app";,需要一个名为"的文件夹;libs">
建议更改您的构建工具版本(例如:29.03(和渐变版本(例如,4.1.2

相关内容

最新更新