首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >android数据绑定生成的类错误:包不存在

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

Stack Overflow用户
提问于 2020-02-03 10:48:32
回答 1查看 358关注 0票数 1

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

代码语言:javascript
复制
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。这是密码。

代码语言:javascript
复制
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'

}
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-02-03 11:18:30

例如,

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

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

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

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/60037670

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档