在代码中使用 kotlin 中的 AdvancedDrawerLayout 时出现错误

问题描述 投票:0回答:1

当我尝试在下面的代码中使用

AdvancedDrawer
时,我收到屏幕截图中显示的错误请帮助我解决它告诉我的错误“布局文件中引用的类,
com.infideap.drawerbehavior.AdvanceDrawerLayout
,未找到在项目或库中” 下面提到了activity和gradle文件的代码请告诉我如何解决错误。

<?xml version="1.0" encoding="utf-8"?>
<com.infideap.drawerbehavior.AdvanceDrawerLayout
    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">
</com.infideap.drawerbehavior.AdvanceDrawerLayout>

build.gradle

plugins {
    id 'com.android.application'
    id 'org.jetbrains.kotlin.android'
    id 'kotlin-android-extensions'
    id 'kotlin-kapt'
}

android {
    compileSdk 32

    defaultConfig {
        applicationId "com.example.plantdisease"
        minSdk 21
        targetSdk 32
        multiDexEnabled true
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    kotlinOptions {
        jvmTarget = '1.8'
    }
    aaptOptions{
        noCompress "tfLite"
    }
}

dependencies {

    implementation 'androidx.core:core-ktx:1.7.0'
    implementation 'androidx.appcompat:appcompat:1.4.1'
    implementation 'com.google.android.material:material:1.6.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
    testImplementation 'junit:junit:4.13.2'

    implementation 'org.tensorflow:tensorflow-lite:1.14.0'
    implementation 'androidx.cardview:cardview:1.0.0'
    implementation 'com.github.razir.progressbutton:progressbutton:2.1.0'
    implementation 'com.infideap.drawerbehavior:drawer-behavior:1.0.1'
    implementation 'androidx.core:core-ktx:1.0.1'
    implementation 'com.github.ibrahimsn98:SmoothBottomBar:1.7.5'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'androidx.navigation:navigation-fragment:2.2.2'
    implementation 'androidx.navigation:navigation-ui:2.2.2'
    implementation 'com.android.support:multidex:1.0.3'
    implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'

    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}

enter image description here

请帮忙解决错误

java android kotlin drawerlayout mobile-development
1个回答
0
投票

我一直在经历同样的问题,我想知道您是否能找到解决方案....如果可以,请提供帮助,谢谢!

© www.soinside.com 2019 - 2024. All rights reserved.