簡體   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