gpt4 book ai didi

android - Gradle 同步失败找不到方法实现()

转载 作者:行者123 更新时间:2023-11-29 02:21:57 28 4
gpt4 key购买 nike

11:14 AM    Gradle sync failed: Could not find method implementation() for arguments [directory 'libs'] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler. (1 s 851 ms)

我打开了一个项目,然后遇到了这个问题。有人可以帮我解决这个问题吗?

apply plugin: 'com.android.application'

android {
compileSdkVersion 27
defaultConfig {
applicationId "com.app.androidlivetv"
manifestPlaceholders = [manifestApplicationId: "${applicationId}",
onesignal_app_id: "0e611d58-a9f2-4665-80c0-3334f0756f82",
onesignal_google_project_number: "REMOTE"]
minSdkVersion 17
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes.each{
it.buildConfigField 'String', 'SERVER_URL', serverUrl
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:customtabs:27.1.1'
implementation 'com.android.support:exifinterface:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'me.relex:circleindicator:1.2.2@aar'
implementation 'com.github.ornolfr:rating-view:0.1.2@aar'
implementation 'cn.gavinliu.android.lib:ShapedImageView:0.8.4'
implementation 'com.loopj.android:android-async-http:1.4.9'
implementation 'com.google.android.gms:play-services-ads:15.0.1'
implementation 'com.google.android.gms:play-services-gcm:15.0.1'
implementation 'com.google.android.gms:play-services-location:15.0.1'
implementation 'com.onesignal:OneSignal:3.9.1@aar'
implementation 'com.google.android.gms:play-services-cast-framework:15.0.1'
implementation 'com.android.support:mediarouter-v7:27.1.1'
implementation 'com.mobsandgeeks:android-saripaar:2.0.2'
implementation 'com.github.ixiDev:GDPRChecker:v0.2'
implementation 'com.google.android.ads.consent:consent-library:1.0.6'
implementation 'com.github.halilozercan:BetterVideoPlayer:1.1.0'
implementation 'uk.co.chrisjenx:calligraphy:2.3.0'
implementation 'com.android.support:multidex:1.0.3'
implementation files('libs/YouTubeAndroidPlayerApi.jar')
implementation project(':vitamio')
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'
}

最佳答案

在你的顶级build.gradle中更新android gradle plugin的版本.

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

同时检查 gradle used 的版本在 gradle/wrapper/gradle-wrapper.properties 文件中:

distributionUrl = https\://services.gradle.org/distributions/gradle-4.10.1-all.zip

关于android - Gradle 同步失败找不到方法实现(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54996664/

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