gpt4 book ai didi

java - 无法解析 : core Affected Modules: app

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

我正在使用 Android Studio 3.5.3 ,我的 Gradle 版本是 5.4.1 。
添加后 butterknife 我的项目不同步,它显示错误“无法解决:核心”。

我加了

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

在 madule:app 的 android 标签中。

并添加了 butterknife 依赖项:
implementation 'com.jakewharton:butterknife:10.2.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.1'
}

就像 butterknife 在 https://github.com/JakeWharton/butterknife 中的步骤一样

我的 build.gradle(module:app)
apply plugin: 'com.android.application'
apply plugin: 'com.jakewharton.butterknife'


android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "com.example.myapplication"
minSdkVersion 15
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true

}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.jakewharton:butterknife:10.2.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.1'


}
repositories {
mavenCentral()
}

我的 build.gradle(项目:我的应用程序)
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
google()
mavenCentral()
jcenter()


}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.3'
classpath 'com.jakewharton:butterknife-gradle-plugin:10.2.1'

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

allprojects {
repositories {
jcenter()
mavenCentral()
google()
maven { url "https://jitpack.io" }
maven { url "https://maven.google.com"}
}
}

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

这是我的错误代码
ERROR: Failed to resolve: core
Affected Modules: app

my error code

最佳答案

尝试从 'Project Structure'-->'Dependencies'-->'Libraries' 添加 butterKnife 依赖项,您可以轻松地在 ButterKnife 上进行 'Google' 搜索。也可以随意尝试那里的更新建议。

也检查其他库。尝试通过注释来禁用依赖项,直到遇到问题。它是命中和审判的方法,因为事情是不确定的。

如果您可以发布您的 gradle 文件,可能会为您提供帮助。

您可以尝试使缓存失效并让我们知道它是否有效。

怀疑是有一个名为 core 的模块被删除了。可能有任何称为核心的符号,并且没有任何 IDE 能够识别的定义。

关于java - 无法解析 : core Affected Modules: app,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59544214/

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