I am using BottomNavigationView. But I am getting an error Cannot resolve class com.google.android.material.bottomnavigation.BottomNavigationView.
Gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 34
buildToolsVersion '34.0.0'
defaultConfig {
applicationId "com.pfsol.tfpmobileassetsmanagament"
minSdkVersion 21
targetSdkVersion 34
versionCode 1
versionName "1.0"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
vectorDrawables.useSupportLibrary = true
multiDexEnabled true
}
tasks.withType(JavaCompile).configureEach{
options.fork = true
options.forkOptions.jvmArgs +=[
'--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED',
'--add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED',
'--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED']
}
buildTypes {
release {
minifyEnabled false
debuggable false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
lintOptions {
checkReleaseBuilds false
}
namespace 'com.pfsol.tfpmobileassetsmanagament'
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
androidTestImplementation('androidx.test.espresso:espresso-core:3.5.1', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.11.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
implementation 'com.jakewharton:butterknife:10.2.3'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.vectordrawable:vectordrawable:1.1.0'
implementation 'com.squareup.picasso:picasso:2.71828'
testImplementation 'junit:junit:4.13.2'
implementation 'androidx.recyclerview:recyclerview:1.3.2'
implementation 'com.google.zxing:core:3.4.1'
implementation 'com.journeyapps:zxing-android-embedded:3.6.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.3'
implementation 'com.squareup.okhttp3:logging-interceptor:3.9.1'
//implementation 'com.github.luongvo:GmailBackground:2.0.2'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0' // Use the appropriate version
implementation 'androidx.drawerlayout:drawerlayout:1.2.0' // Use the appropriate version
// implementation 'com.intsig.camscanner:CamScannerSdk:4.1.0.20190920'
implementation 'io.github.mayuce:AndroidDocumentScanner:1.6.1'
// required to avoid crash on Android 12 API 31
implementation 'androidx.work:work-runtime-ktx:2.9.0'
implementation 'com.android.billingclient:billing:6.1.0'
implementation 'com.google.android.material:material:1.11.0'
}
Layout
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<!-- Your other layout elements -->
<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@+id/bottom_navigation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
app:menu="@menu/activity_main_drawer" />
</androidx.constraintlayout.widget.ConstraintLayout>
I am getting error on com.google.android.material.bottomnavigation.BottomNavigationView