【发布时间】:2020-09-17 19:06:34
【问题描述】:
我没有在 stackoverflow 或任何地方找到解决此问题的方法。 我只是将我的项目转移到 android studio 4.0.1 并迁移到 androidx 并收到此错误:
这是包含 recyclerview 的 xml 文件中的错误
build.gradle(app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 30
buildToolsVersion "26.0.3"
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "com.sadeghjfr22.market"
minSdkVersion 16
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'com.squareup.picasso:picasso:2.3.2'
implementation 'com.nineoldandroids:library:2.4.0'
implementation 'com.daimajia.slider:library:1.1.5@aar'
implementation 'com.google.android.material:material:1.2.1'
implementation 'com.github.bumptech.glide:glide:3.7.0'
implementation 'com.github.smarteist:autoimageslider:1.3.7-appcompat'
implementation 'com.synnapps:carouselview:0.1.5'
implementation 'de.hdodenhof:circleimageview:2.1.0'
implementation 'cn.pedant.sweetalert:library:1.3'
implementation 'com.jakewharton:butterknife:8.8.1'
implementation 'com.melnykov:floatingactionbutton:1.3.0'
implementation 'com.github.JustKiddingBaby:VercodeEditText:v1.0.5'
implementation 'uk.co.chrisjenx:calligraphy:2.3.0'
implementation 'com.zarinpal:purchase:0.0.8-beta'
testImplementation 'junit:junit:4.12'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
}
build.gradle(项目)
// 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.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven { url 'https://jitpack.io'}
maven { url "https://maven.google.com" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
如果您需要更多信息,请告诉我。
谢谢你的回答:)
【问题讨论】:
-
你跳过
Clean Project和Invalidate Caches / Restart的舞蹈吗? -
@cactustictacs 是的。没用。
标签: android android-studio gradle android-recyclerview