swe*_*ili 73 android gradle build.gradle
我知道我的这个问题已被多次询问,我确实按照大部分答案,但没有一个帮助我.所以这是我的问题,每当我同步我的项目时它总是失败.以下是gradle控制台的外观:
执行任务:[:app:generateDebugSources,:app:generateDebugAndroidTestSources,:app:mockableAndroidJar,:app:prepareDebugUnitTestDependencies]
按需配置是一项孵化功能.增量java编译是一个孵化功能.: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:应用:prepareComAndroidSupportDesign2420Library UP-TO-DATE:应用:prepareComAndroidSupportMediarouterV72300Library UP-TO-DATE:应用:prepareComAndroidSupportRecyclerviewV72420Library UP-TO-DATE:应用:prepareComAndroidSupportSupportCompat2420Library UP-TO-DATE:应用:prepareComAndroidSupportSupportCoreUi2420Library UP-TO-DATE:应用:prepareComAndroidSupportSupportCoreUtils2420Library UP-至今: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 :prepareComGoogleAndroidG msPlayServicesAds940Library UP-TO-DATE:应用:prepareComGoogleAndroidGmsPlayServicesAdsLite940Library UP-TO-DATE:应用:prepareComGoogleAndroidGmsPlayServicesAnalytics940Library UP-TO-DATE:应用:prepareComGoogleAndroidGmsPlayServicesAnalyticsImpl940Library UP-TO-DATE:应用:prepareComGoogleAndroidGmsPlayServicesAppindexing940Library UP-TO-DATE:应用:prepareComGoogleAndroidGmsPlayServicesAppinvite940Library UP-TO-日期:应用:prepareComGoogleAndroidGmsPlayServicesAuth940Library UP-TO-DATE:应用:prepareComGoogleAndroidGmsPlayServicesAuthBase940Library UP-TO-DATE:应用:prepareComGoogleAndroidGmsPlayServicesBase940Library UP-TO-DATE:应用:prepareComGoogleAndroidGmsPlayServicesBasement940Library UP-TO-DATE:应用:prepareComGoogleAndroidGmsPlayServicesCast940Library UP-TO-DATE:应用:prepareComGoogleAndroidGmsPlayServicesCastFramework940Library最新消息:app:prepareComGoogleAndroidGmsPlayServicesClearcut940Library UP-TO-DATE:app:prepareComGoogleAndroidGmsPlayServicesContextmanager940Library UP-TO-DATE:app :prepareComGoogleAndroidGmsPlayServicesDrive940Library UP-TO-DATE:应用:prepareComGoogleAndroidGmsPlayServicesFitness940Library UP-TO-DATE:应用:prepareComGoogleAndroidGmsPlayServicesGames940Library UP-TO-DATE:应用:prepareComGoogleAndroidGmsPlayServicesGass940Library UP-TO-DATE:应用:prepareComGoogleAndroidGmsPlayServicesGcm940Library UP-TO-DATE:应用程序:prepareComGoogleAndroidGmsPlayServicesIdentity940Library失败:建立因例外而失败.
出了什么问题:java.lang.NullPointerException(没有错误消息)
尝试:使用--stacktrace选项运行以获取堆栈跟踪.使用--info或--debug选项运行以获取更多日志输出.
建筑失败
总时间: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'
Run Code Online (Sandbox Code Playgroud)
如何解决这个问题?
ras*_*tik 183
我从项目中删除了.gradle文件夹,并且能够再次重建它.
注意:为了以防万一,请备份.
Kon*_*esh 28
突然系统重新启动时创建此问题,然后gradle文件损坏.并且已损坏的文件已被缓存,因此我们需要从您的项目中删除此文件
your_project_path/.gradle/2.14.1/taskArtifacts
Run Code Online (Sandbox Code Playgroud)
它将再次重新生成.
然后重启Android工作室并重新编译项目.
来源:https://code.google.com/p/android/issues/detail?id = 220741#c13
这对我有用.
如果您仍然遇到此问题,即使按照上面的建议删除了项目路径下的 .gradle 文件夹,请终止任务管理器上运行的所有 Java 进程并尝试更新您的 Android Studio。
我也遇到过同样的情况,但现在一切正常。
希望能帮助到你!
| 归档时间: |
|
| 查看次数: |
57958 次 |
| 最近记录: |