未解决的参考:android

玛尼·巴拉西(Mani Bharathy)

在此处输入图片说明

从图像中可以看到,Android Studio无法在此行中解析此导入“ com.android”。

import com.android.volley.toolbox.Volley

我尝试了从其他答案中找到的以下truobleshooting:

  1. 清理并重建
  2. 文件->使缓存无效并重新启动
  3. 通过build.gradle打开项目
  4. 删除项目中的.idea文件夹
  5. 安装旧版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'

}
阿萨杜扎曼医师

我以为您忘记了在gradle文件中添加依赖项。向模块级build.gradle文件添加依赖项

dependencies {
    ...
    implementation 'com.android.volley:volley:1.1.1'
}

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章