我正在尝试使用 Volley 库在 Android 应用程序中发出网络请求,但安装/使用 Volley 的说明不起作用(我正在遵循本指南)。当我将此添加到我的应用程序build.gradle依赖项并同步时compile 'com.android.volley:volley:1.1.1'Android Studio 给了我这个错误:Gradle sync failed: Could not find method compile() for arguments [com.android.volley:volley:1.1.1] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.Consult IDE log for more details (Help | Show Log) (10s 809ms)我尝试更改compile为classname并且同步似乎有效,但我似乎仍然无法使用/导入 Volley 类。虽然我不知道我应该导入什么,因为出于某种原因它被排除在指南之外。Android Studio 似乎不知道依赖项,因为它没有提供任何添加导入的选项:为什么这不起作用?我试过清理项目并重新启动 Android Studio。
添加回答
举报
0/150
提交
取消