android - 未解决的参考:android
问题描述
从图中可以看出,Android Studio 无法在这一行中解析此导入“com.android”。
import com.android.volley.toolbox.Volley
我尝试了从其他一些答案中找到的以下故障排除:
- 清理和重建
- 文件 -> 使缓存无效并重新启动
- 通过 build.gradle 打开项目
- 删除项目中的.idea文件夹
- 安装旧 sdk (Android 6.0) 和最新版本
但似乎没有任何帮助。请帮忙。
build.gradle(模块)文件: https ://textsaver.flap.tv/lists/326r
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "..."
minSdkVersion 15
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.core:core-ktx:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.android.material:material:1.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
}
解决方案
尝试删除构建文件夹然后重新同步。有时即使使用./gradlew clean
命令,生成的文件也没有正确删除
推荐阅读
- c# - 集合视图中所选项目的圆角
- javascript - React/JS/TS - 表格不会呈现行
- git - 如何在镜像/分叉的 git 存储库之上维护更改?
- python - 返回列表中引用索引的元素
- angular - Angular 9 *ngFor 循环跳过数组中的一些对象
- python - 需要帮助使用 pygame 实现合并排序的可视化工具
- r - 以万无一失的方式覆盖离散的 x 轴标签,以避免标签和数据不匹配
- azure - BlobTrigger 在部署时会导致 Azure Functions 应用崩溃
- ios - 如何导出具有透明背景(Alpha 通道)的视频
- javascript - 反应栏插件