gpt4 book ai didi

java - 如何解决这个 gradle 同步问题

转载 作者:行者123 更新时间:2023-12-01 22:25:36 25 4
gpt4 key购买 nike

我收到此错误错误:在项目“:app”上找不到参数[目录“libs”]的方法实现()。打开文件这些是 build.grade(Module : app) 的内容

//noinspection GradleCompatible
//noinspection ExpiredTargetSdkVersion
apply plugin: 'com.android.application'

android {
compileSdkVersion 28
buildToolsVersion "23.0.3"

defaultConfig {
applicationId "spoorthy.shopping"
minSdkVersion 16
targetSdkVersion 26
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:28.0.0'
}

成绩文件(项目:购物)

 // 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.3.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 28
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "com.waltonbd.myapplication"
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
sourceSets { main { assets.srcDirs = ['src/main/assets', 'src/main/raw'] } }
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:design:28.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

在 defaultConfig{} 中添加 testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 。同时添加 buildToolVersion

同时添加 google()

buildscript {
repositories {
google()
jcenter()

}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.1'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
google()
jcenter()

}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

关于java - 如何解决这个 gradle 同步问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58567798/

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