【发布时间】:2018-04-17 06:41:51
【问题描述】:
我已经参考了其他答案,例如this,但仍然出现以下异常:
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'
}
事实上,当我尝试将 Volley 添加为依赖项时,它从未显示在依赖项列表中。而显示其他谷歌库。
注意:我已经检查了其他 StackOverFlow 链接,所以请只有在您绝对确定答案对此正确有效时,请随意标记重复。
【问题讨论】:
-
您可以从github.com/google/volley 下载 Volley 并作为模块导入到您的项目中,在您的 gradle 文件中,您可以尝试
implementation project(':Module_Volley')其中 Module_Volley 是我的 volley lib 模块名称
标签: android android-studio android-volley