我知道我的这个问题已经被多次询问过了,我确实遵循了大部分答案,但没有一个帮助我。所以这是我的问题,每当我同步我的项目时,它总是失败。以下是Gradle控制台:
执行任务:[:app:generateDebugSources,:app:generateDebugAndroidTestSources,:app:mockableAndroidJar,:app:prepareDebugUnitTestDependencies] Configuration on demand is an incubating feature. Incremental java compilation is an incubating feature. :app:preBuild UP-TO-DATE :app:preDebugBuild UP-TO-DATE :app:checkDebugManifest :app:preReleaseBuild UP-TO-DATE :app:prepareComAndroidSupportAnimatedVectorDrawable2420Library UP-TO-DATE :app:prepareComAndroidSupportAppcompatV72420Library UP-TO-DATE :app:prepareComAndroidSupportDesign2420Library UP-TO-DATE :app:prepareComAndroidSupportMediarouterV72300Library UP-TO-DATE :app:prepareComAndroidSupportRecyclerviewV72420Library UP-TO-DATE :app:prepareComAndroidSupportSupportCompat2420Library UP-TO-DATE :app:prepareComAndroidSupportSupportCoreUi2420Library UP-TO-DATE :app:prepareComAndroidSupportSupportCoreUtils2420Library UP-TO-DATE :app:prepareComAndroidSupportSupportFragment2420Library UP-TO-DATE :app:prepareComAndroidSupportSupportMediaCompat2420Library UP-TO-DATE :app:prepareComAndroidSupportSupportV42420Library UP-TO-DATE :app:prepareComAndroidSupportSupportVectorDrawable2420Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServices940Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesAds940Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesAdsLite940Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesAnalytics940Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesAnalyticsImpl940Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesAppindexing940Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesAppinvite940Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesAuth940Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesAuthBase940Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesBase940Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesBasement940Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesCast940Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesCastFramework940Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesClearcut940Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesContextmanager940Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesDrive940Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesFitness940Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesGames940Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesGass940Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesGcm940Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesIdentity940Library FAILURE: Build failed with an exception.
构建失败 总时间:7.518秒
这些是我的
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:24.2.0'
compile 'com.android.support:design:24.2.0'
compile 'com.google.android.gms:play-services:9.4.0'
testCompile 'junit:junit:4.12'
compile 'com.google.android.gms:play-services-location:9.4.0'
compile 'com.google.android.gms:play-services-appindexing:9.4.0'
compile 'com.google.firebase:firebase-messaging:9.2.0'
compile 'com.google.firebase:firebase-database:9.0.2'
compile 'com.firebase:firebase-client-android:2.4.0'
compile 'com.google.firebase:firebase-core:9.4.0'
}
apply plugin: 'com.google.gms.google-services'
如何解决这个问题?
发布于 2018-03-15 15:41:30
我已经从项目中删除了.gradle文件夹,并且能够重新构建它。
发布于 2018-03-15 16:38:31
这个问题是在突然重新启动系统时产生的,然后Gradle文件崩溃了。并且那个损坏的文件被缓存了,所以我们需要从你的项目中删除这个文件。
your_project_path/.gradle/2.14.1/taskArtifacts
它将重构。
https://stackoverflow.com/questions/-100004262
复制相似问题