Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/229.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
自API 22更新以来,Android Studio出现了多个错误_Android_Android Studio_Android Gradle Plugin - Fatal编程技术网

自API 22更新以来,Android Studio出现了多个错误

自API 22更新以来,Android Studio出现了多个错误,android,android-studio,android-gradle-plugin,Android,Android Studio,Android Gradle Plugin,我在我的项目中遇到了多个错误,以前它工作得很好。我尝试过改变目标api改变依赖项,我不知道为什么它不起作用。请帮帮我 将您的build.gradle文件更改为此 android { compileSdkVersion 22 buildToolsVersion '22.0.1' defaultConfig { applicationId "com.example.name" minSdkVersion 14 targetS

我在我的项目中遇到了多个错误,以前它工作得很好。我尝试过改变目标api改变依赖项,我不知道为什么它不起作用。请帮帮我


将您的build.gradle文件更改为此

android {
    compileSdkVersion 22
    buildToolsVersion '22.0.1'
    defaultConfig {
        applicationId "com.example.name"
        minSdkVersion 14
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
    }
.......
dependencies {
    compile 'com.android.support:appcompat-v7:22.2.1'
    compile 'com.google.android.gms:play-services:6.5.87'
    }

现在清理并重建项目

将您的build.gradle文件更改为此

android {
    compileSdkVersion 22
    buildToolsVersion '22.0.1'
    defaultConfig {
        applicationId "com.example.name"
        minSdkVersion 14
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
    }
.......
dependencies {
    compile 'com.android.support:appcompat-v7:22.2.1'
    compile 'com.google.android.gms:play-services:6.5.87'
    }

现在清理并重建项目

将支持版本更改为22.2.1,buildToolsVersion更改为22.0.1,将DkVersion编译为22并清理项目,查看它是否有帮助Rokash Sarkar的答案是否正确,稍加搜索,您也知道原因:@ThMBc MainActivity errors stills persistsclean project,rebuild project(在“内置”菜单下)并检查mainactivity文件中的导入,以确保使用了正确的R导入(您需要自己的导入(import com.pklabs.rgpvdigest.R或类似的东西)。将支持版本更改为22.2.1,buildToolsVersion更改为22.0.1,将DkVersion编译为22并清理project,查看它是否有帮助Rokash Sarkar的答案是否正确,稍加搜索,您也会知道原因:@ThMBc MainActivity errors stills persistsclean project,rebuild project(在“内置”菜单下)并检查mainactivity文件中的导入,以确保使用了正确的R导入(您需要您的导入(导入com.pklabs.rgpvdigest.R或类似内容)。我的gradle错误已消失,但mainactivity错误仍然存在…:(我的gradle错误已消失,但mainactivity错误仍然存在…:(