Android 截击-NoClassDefFoundError

Android 截击-NoClassDefFoundError,android,android-studio,android-volley,Android,Android Studio,Android Volley,我已经参考了其他答案,如,但仍然得到以下例外: E/UncaughtException:java.lang.NoClassDefFoundError:解析失败:Lcom/android/volley/toolbox/volley 以下是依赖项: dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') testImplementation 'junit:junit:4.12' imple

我已经参考了其他答案,如,但仍然得到以下例外:

E/UncaughtException:java.lang.NoClassDefFoundError:解析失败:Lcom/android/volley/toolbox/volley

以下是依赖项:

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    testImplementation 'junit:junit:4.12'
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.google.android.gms:play-services-base:12.0.1'
    implementation 'com.google.android.gms:play-services-location:12.0.1'
    implementation "com.google.firebase:firebase-messaging:15.0.0"
    implementation 'com.google.firebase:firebase-core:12.0.1'
    implementation 'com.android.volley:volley:1.1.0'

    apply plugin: 'maven'
}  
事实上,当我尝试将截击作为依赖项添加时,它从未显示在依赖项列表中。而其他google库则显示出来


注意:我已经检查了其他StackOverFlow链接,所以请,只有当您完全确定答案正确时,才可以随意将其标记为重复项。

打开命令提示符,重定向到您的项目目录并键入此内容

如果您是Windows用户:gradlew.bat clean


如果您是mac用户类型:./gradlew clean

如果您的targetSdkVersion介于26和28之间,请尝试在AndroidManifest的应用程序标记中添加uses library android:name=“org.apache.http.legacy”android:required=“false”。第二种方法是:将volley.jar导入你的app/lids目录,而不是从gradle中获取它,在app module的build.gradle中使用你的本地jar作为实现文件('libs/volley.jar')

你可以下载volley并作为模块导入你的项目,在gradle文件中,你可以尝试
实现项目(':Module_-Volley')
其中Module_-Volley是我的Volley lib模块名确保您已在build.gradle中的所有项目中添加了maven