我最近买了一台新电脑并安装了Android Studio并从git中取出了我的项目。 Android Studio会一直显示消息
“自上次项目同步以来Gradle文件已更改。可能需要项目同步才能使IDE正常工作。”
每个文件顶部的图像。当我“立即同步”时,它会正确同步并完成,报告:
Executing tasks: [:BrewingPrograms:generateDebugSources, :BrewingPrograms:generateDebugTestSources]
Configuration on demand is an incubating feature.
:BrewingPrograms:preBuild
:BrewingPrograms:preDebugBuild
:BrewingPrograms:checkDebugManifest
:BrewingPrograms:preReleaseBuild
:BrewingPrograms:prepareComAndroidSupportSupportV42100Library UP-TO-DATE
:BrewingPrograms:prepareComGoogleAndroidGmsPlayServices6171Library UP-TO-DATE
:BrewingPrograms:prepareDebugDependencies
:BrewingPrograms:compileDebugAidl UP-TO-DATE
:BrewingPrograms:compileDebugRenderscript UP-TO-DATE
:BrewingPrograms:generateDebugBuildConfig UP-TO-DATE
:BrewingPrograms:generateDebugAssets UP-TO-DATE
:BrewingPrograms:mergeDebugAssets UP-TO-DATE
:BrewingPrograms:generateDebugResValues UP-TO-DATE
:BrewingPrograms:generateDebugResources UP-TO-DATE
:BrewingPrograms:mergeDebugResources UP-TO-DATE
:BrewingPrograms:processDebugManifest UP-TO-DATE
:BrewingPrograms:processDebugResources UP-TO-DATE
:BrewingPrograms:generateDebugSources UP-TO-DATE
:BrewingPrograms:preDebugTestBuild
:BrewingPrograms:prepareDebugTestDependencies
:BrewingPrograms:compileDebugTestAidl UP-TO-DATE
:BrewingPrograms:processDebugTestManifest UP-TO-DATE
:BrewingPrograms:compileDebugTestRenderscript UP-TO-DATE
:BrewingPrograms:generateDebugTestBuildConfig UP-TO-DATE
:BrewingPrograms:generateDebugTestAssets UP-TO-DATE
:BrewingPrograms:mergeDebugTestAssets UP-TO-DATE
:BrewingPrograms:generateDebugTestResValues UP-TO-DATE
:BrewingPrograms:generateDebugTestResources UP-TO-DATE
:BrewingPrograms:mergeDebugTestResources UP-TO-DATE
:BrewingPrograms:processDebugTestResources UP-TO-DATE
:BrewingPrograms:generateDebugTestSources UP-TO-DATE
BUILD SUCCESSFUL
Total time: 3.208 secs
但无论我做了多少次,或者使缓存无效并再次执行,黄色条仍然存在并且它想要立即同步。
我的顶级gradle文件看起来像
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.14.1'
classpath "me.tatarka:gradle-retrolambda:2.4.+"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenCentral()
}
}
我在0.8.4版本以及Android Studio的canary channel 0.9.2版本上都有相同的行为。
我的Gradle设置目前为Use default gradle wrapper
还有什么可以尝试的?