Java 为什么编译器错误显示android.support.design.widget
当我想通过以下文本生成我的应用程序编译器show eror时: 给定工件包含一个字符串文本,其中包含无法安全重写的包引用android.support.design.widget。需要手动更新使用反射(如注释处理器)的库,以添加对androidx的支持 如何解决它?Java 为什么编译器错误显示android.support.design.widget,java,android,Java,Android,当我想通过以下文本生成我的应用程序编译器show eror时: 给定工件包含一个字符串文本,其中包含无法安全重写的包引用android.support.design.widget。需要手动更新使用反射(如注释处理器)的库,以添加对androidx的支持 如何解决它? apply plugin: 'com.android.application' android { compileSdkVersion 29 defaultConfig { application
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
defaultConfig {
applicationId "com.example.fontpackge7"
minSdkVersion 21
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'com.android.tools.lint:lint-gradle:27.2.0-alpha16'
testImplementation 'junit:junit:4.13.1'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation 'com.jakewharton:butterknife:10.0.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:10.0.0'
}
您正在使用androidx库。程序包android.support.design.widget由设计支持库提供。您正在使用androidx库。程序包android.support.design.widget由设计支持库提供。
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:4.0.0"
// 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
}