简体   繁体   English

Android Studio-在build.gradle中添加依赖项后无法导入类

[英]Android Studio - Unable to import class after added dependency in build.gradle

I am unable to import class after added dependency in build.gradle. 在build.gradle中添加依赖项后,我无法导入类。

dependencies {
    ...
    compile 'com.mcxiaoke.volley:library:1.0.19'
}

Sync it with no error. 同步没有错误。 Did some search about this issue. 是否对此问题进行了一些搜索。 I found that it may be related to Project Structure -> Project -> Plugin Version. 我发现它可能与项目结构->项目->插件版本有关。 Imported module in Android Studio can't find imported class But I am not sure what version I should use. Android Studio中的导入模块找不到导入的类,但是我不确定应该使用哪个版本。

My project version 我的项目版本

Gradle version: 4.1
Android Plugin Version 3.0.1

mcxiaoke library is depricated now mcxiaoke库现在已描述

      com.mcxiaoke.volley:library:1.0.19'

try official by google 尝试通过谷歌官方

try replacing your compile with this 尝试以此替换您的编译

 compile 'com.android.volley:volley:1.0.0'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM