android - "Gradle files have changed since last project sync."消息总是出现

标签 android android-studio gradle

我正在编写一个 Android Studio 项目,同时使用 USB 内存棒不断地在笔记本电脑和台式机之间来回移动。自从 Android Studio 稳定以来,我尝试了几个月都没有问题,直到今天,无论我同步 gradle 多少次,此消息都会一直显示:

Gradle files have changed since last project sync. A project sync may be necessary for the IDE to work properly.

Gradle Console 表示构建成功。我也尝试清理和重建项目,甚至重新安装Android Studio,仍然弹出消息。

似乎是什么问题?不建议在多个Android Studio上写一个项目吗?

这是我的 build.gradle 的外观:

apply plugin: 'com.android.application'

android {
compileSdkVersion 21
buildToolsVersion "21.1.2"

defaultConfig {
    applicationId "com.simplifyinc.prodigy"
    minSdkVersion 16
    targetSdkVersion 21
    versionCode 1
    versionName "0.3.2"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:21.0.3'
    compile 'de.hdodenhof:circleimageview:1.2.1'
    compile 'com.oguzdev:CircularFloatingActionMenu:1.0.2'
    compile 'net.the4thdimension:audio-wife:1.0.3'
    compile project('libraries:android-crop')
}

最佳答案

在 build.gradle(module:app) 改变 构建工具,(在我的例子中是 23.0.1) targetSdkVersion (23) 和 依赖 编译版本
(“com.android.support:appcompat-v7:23.1.0”) 最新 这是由于 gradle 更新而发生的

*****检查你的电脑日期*****

关于android - "Gradle files have changed since last project sync."消息总是出现,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28634836/

相关文章:

android - 在 ListView 中搜索无法正常工作

android - 如何在 ubuntu 上的 android studio 2.2 中包含 opencv 和 opencv_contrib 模块?

java - GVM 始终离线

android - 适用于 Android 的 KSOAP2 提供

android - 是否可以将外部 jar 文件嵌入(合并)到我的 eclipse 库项目中?

android - 如何将图像添加到 android studio 中的空白 Activity ?

java - 在 android studio 中,当手机没有互联网时,如何防止缓冲读取器从 url 读取时出现错误

android - appcompat-v7 :21. 0. 0': No resource found that matches the given name: attr ' android:actionModeShareDrawable'

gradle - BootJar + MavenJar。工件不是由这个构建产生的

Android 错误 [尝试在空对象引用上调用虚拟方法 'void android.app.ActionBar']