gpt4 book ai didi

android - 无法为 org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler 类型的对象设置未知属性 'implementation'

转载 作者:行者123 更新时间:2023-12-03 03:17:30 25 4
gpt4 key购买 nike

我正在为新的 android-kotlin 项目添加新的依赖项,但在同步项目后出现以下错误。

Could not set unknown property 'implementation' for object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

以下是我的 build.gradle 文件。

apply plugin: 'com.android.application'    
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: 'androidx.navigation.safeargs'

android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.samplekotlin"
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
dataBinding.enabled = true
}

def lifeCycleExtensionVersion = '1.1.1'
def supportVersion = '28.0.0'
def retrofitVersion = '2.3.0'
def glideVersion = '4.9.0'
def rxJavaVersion = '2.1.1'
def roomVersion = '2.1.0-rc01'
def navVersion = '2.1.0-alpha05'
def preferencesVersion = '1.0.0'

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.core:core-ktx:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation = "com.android.support:design:$supportVersion"
implementation = "android.arch.lifecycle:extension:$lifeCycleExtensionVersion"
implementation = "androidx.room:room-runtime:extension:$roomVersion"
implementation = "androidx.legacy:legacy-support-v4:1.0.0"
kapt "androidx.room:room-compiler:$roomVersion"
implementation = "androidx.room:room-ktx:$roomVersion"
implementation = "org.jetbrains.kotlinx:kotlinx-coroutine-core:1.1.1"

implementation = "androidx.navigation:navigation-fragment-ktx:$navVersion"
implementation = "androidx.navigation:navigation-ui-ktx:$navVersion"
implementation = "com.google.android.material:material:1.0.0"

implementation = "com.squareup.retrofit2:retrofit:$retrofitVersion"
implementation = "com.squareup.retrofit2:converter-gson:$retrofitVersion"
implementation = "com.squareup.retrofit2:adapter-rxjava2:$retrofitVersion"

implementation = "io.reactivex.rxjava2:rxjava:$rxJavaVersion"
implementation = "io.reactivex.rxjava2:rxandroid:$rxJavaVersion"

implementation = "com.github.bumptech.glide:glide:$glideVersion"

implementation = "com.android.support:palette-v7:$supportVersion"

implementation = "androidx.preference:preference:$preferencesVersion"

testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}

点击同步按钮后,出现“执行”错误。

最佳答案

愚蠢的错误。发现了问题。刚刚删除 = 运算符

implementation =

关于android - 无法为 org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler 类型的对象设置未知属性 'implementation',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57708531/

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