繁体   English   中英

android数据绑定生成类错误:包不存在

[英]android data binding generated classes error: package does not exist

我将我的项目迁移到 androidx,代码没有错误,但是一旦我尝试重新构建项目,我在生成的类中收到以下错误。 app/build/generated/data_binding_base_class_source_out/debug/dataBindingGenBaseClassesDebug

error: package android.support.design.widget does not exist 
error: package androidx.appbarlayout.widget does not exist  
error: package androidx.collapsingtoolbarlayout.widget does not exist   
error: cannot find symbol class ViewPager   
error: cannot find symbol class AppBarLayout    
error: cannot find symbol class CollapsingToolbarLayout 
error: cannot find symbol class ViewPager   
error: cannot find symbol class TabLayout   
error: cannot find symbol class AppBarLayout    
error: cannot find symbol class CollapsingToolbarLayout 
error: cannot find symbol class ViewPager   
error: cannot find symbol class TabLayout

我检查了我的 gradle 文件,所有依赖项都更新为 androidx。 这是代码。

dependencies {
    implementation "com.github.hotchemi:permissionsdispatcher:${permissionsDispatcherVersion}"
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    annotationProcessor "com.github.hotchemi:permissionsdispatcher-processor:${permissionsDispatcherVersion}"
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    //noinspection GradleCompatible
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'com.google.android.material:material:1.0.0'
    implementation 'com.cocosw:bottomsheet:1.4.0'
    implementation 'com.isseiaoki:simplecropview:1.1.4'
    implementation 'com.github.bumptech.glide:glide:4.9.0'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'
    implementation 'com.github.florent37:singledateandtimepicker:1.2.2'
    implementation 'de.hdodenhof:circleimageview:2.0.0'
    implementation 'androidx.multidex:multidex:2.0.1'
    implementation 'com.amitshekhar.android:android-networking:1.0.0'
    implementation 'com.google.code.gson:gson:2.8.5'
    implementation 'org.jsoup:jsoup:1.8.1'
    implementation 'com.github.hani-momanii:SuperNova-Emoji:1.1'
    implementation 'androidx.recyclerview:recyclerview:1.1.0'
    implementation 'androidx.cardview:cardview:1.0.0'
    implementation 'com.ToxicBakery.viewpager.transforms:view-pager-transforms:1.2.32@aar'
    implementation 'com.google.firebase:firebase-messaging:20.1.0'
    implementation 'com.google.firebase:firebase-core:17.2.2'
    implementation 'com.google.android.gms:play-services-maps:17.0.0'
    implementation 'com.google.android.gms:play-services-location:17.0.0'
    implementation 'com.kyleduo.switchbutton:library:1.4.5'
    implementation 'com.github.PhilJay:MPAndroidChart:v3.0.1'
    implementation("com.google.android.libraries.places:places-compat:1.0.0")
    implementation("com.schibstedspain.android:leku:5.0.0") {
        exclude group: 'com.google.android.gms'
        exclude module: "play-services-places"
    }
    implementation 'com.gordonwong:material-sheet-fab:1.2.1'
    implementation 'com.google.firebase:firebase-storage:19.1.0'
    implementation 'com.google.firebase:firebase-auth:19.2.0'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'com.google.android.material:material:1.0.0'

}

例子,

错误:包 androidx.appbarlayout.widget 不存在

您现在需要使用不同的库,即com.google.android.material.appbar.AppBarLayout

请在应用程序中找到被替换以支持 AndroidX 的类映射

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM