Android Studio 中的任务:app:compileDebugJavaWithJavac 执行失败

新手上路,请多包涵

我正在 Android Studio 中开发一个 Android 应用程序。不太确定出了什么问题。几天前我成功构建了。任何帮助都会很棒。

这是错误:

 Error:Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

这是我的 build.gradle

 apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "21.1.2"

defaultConfig {
    multiDexEnabled true
    applicationId "com.tubbs.citychurchob"
    minSdkVersion 14
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
      proguardFiles getDefaultProguardFile('proguard-android.txt'),        'proguard-rules.pro'
    }
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile fileTree(dir: 'libs', include: 'Parse-*.jar')
compile 'com.android.support:appcompat-v7:23.1.0'
compile 'com.android.support:cardview-v7:23.1.0'
compile 'com.parse.bolts:bolts-android:1+'
compile 'com.android.support:recyclerview-v7:23.1.0'
}

原文由 MrTimotheos 发布,翻译遵循 CC BY-SA 4.0 许可协议

阅读 1.9k
2 个回答

尝试将您的 buildToolsVersion 升级到“23.0.1”,如下所示:

 compileSdkVersion 23
buildToolsVersion "23.0.1"

如果您没有安装此版本的 buildTools,请使用 SDKManager 作为提示下载它。

原文由 starkshang 发布,翻译遵循 CC BY-SA 4.0 许可协议

在 Android Studio 3.1 中,您可以在 Build 窗口中查看错误详细信息。

打开构建选项卡。它们有些隐藏,您必须展开 Java 编译器节点。你会在那里看到错误。

在此处输入图像描述

但是有一种更好的方法来查看错误。您可以单击“切换视图”按钮以更好地查看错误。这样您就不必展开每个节点。

在此处输入图像描述

原文由 live-love 发布,翻译遵循 CC BY-SA 4.0 许可协议

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题