[英]Gradle - Error Could not find method implementation() for arguments [com.android.support:appcompat-v7:26.0.0]
[英]Could not find method implementation() for arguments [com.android.support:appcompat-v7:28.0.0]
Build.gradle(項目):
buildscript {
repositories {
google()
jcenter()
maven {
url "https://maven.google.com"
name 'Google'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:customtabs:28.0.0'
implementation 'com.android.support:support-vector-drawable:28.0.0'
implementation 'com.android.support:support-media-compat:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven {
url "$rootDir/../node_modules/react-native/android"
}
maven {
url "https://maven.google.com"
name 'Google'
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Build.gradle(moudle):
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
buildToolsVersion 28.0
defaultConfig {
applicationId 'com.shiba.honey'
minSdkVersion 14
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'
}
}
lintOptions {
checkReleaseBuilds false
abortOnError false
ignoreWarnings true //false
}
buildToolsVersion '28.0.3'
productFlavors {
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.google.android.gms:play-services-ads:17.1.2'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
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'
}
當我同步時出現此錯誤:
在類型org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler的對象上找不到參數[com.android.support:appcompat-v7:28.0.0]的方法Implementation()。
請從Android SDK Manager安裝Android支持存儲庫。 打開Android SDK Manager
我從Android SDK安裝了所有支持存儲庫,但不知道該怎么辦.....
嘗試這個 :
在build.gradle(Project)中:
buildscript {
repositories {
google()
jcenter()
maven {
url "https://maven.google.com"
name 'Google'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
// NOTE : REMOVE IMPLEMENTATION FILES FROM HERE AND USE THEM IN DEPENDENCIES IN BUILD.GRADLE(APP).
}
}
allprojects {
repositories {
google()
jcenter()
maven {
url "$rootDir/../node_modules/react-native/android"
}
maven {
url "https://maven.google.com"
name 'Google'
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
在build.gradle(app)中做到這一點:
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
buildToolsVersion 28.0
defaultConfig {
applicationId 'com.shiba.honey'
minSdkVersion 14
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'
}
}
lintOptions {
checkReleaseBuilds false
abortOnError false
ignoreWarnings true //false
}
buildToolsVersion '28.0.3'
productFlavors {
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.google.android.gms:play-services-ads:17.1.2'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
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'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:customtabs:28.0.0'
implementation 'com.android.support:support-vector-drawable:28.0.0'
implementation 'com.android.support:support-media-compat:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.