【问题标题】:Error:Execution failed for task ':app:compileDebugJavaWithJavac'. java.io.FileNotFoundException:错误:任务“:app:compileDebugJavaWithJavac”执行失败。 java.io.FileNotFoundException:
【发布时间】:2016-05-01 08:42:57
【问题描述】:

更新并重启 android studio 后,出现以下错误。

错误:任务 ':app:compileDebugJavaWithJavac' 执行失败。 java.io.FileNotFoundException: /.../Workspace/MyAppName/app/build/intermediates/exploded-aar/com.google.android.gms/play-services/8.3.0/jars/classes.jar (没有这样的文件或目录)

我已经尝试清理和重建我的项目,但每次我都遇到错误。

编辑:

我的gradle如下:

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:design:23.0.1'
compile 'com.google.android.gms:play-services:8.4.0'
 }

【问题讨论】:

标签: android android-studio google-play-services


【解决方案1】:

Instant run 中存在一个错误,已根据工具 android 网站修复。

解决办法:

使用 alpha6 升级构建工具构建 gradle 版本。

dependencies {
    classpath 'com.android.tools.build:gradle:2.0.0-alpha6'
}

【讨论】:

  • 谢谢。它的工作就像魅力!我可以看到错误列表的链接吗?
  • 不工作....错误:任务':app:compileDebugJavaWithJavac'的执行失败。 > java.io.FileNotFoundException: /opt/schoolerp_android/app/libs/httpclient-4.2.jar (没有这样的文件或目录)
  • 尝试构建 gradle 时提示:插件太旧,请更新到更新版本,或将 ANDROID_DAILY_OVERRIDE 环境变量设置为:“...”
【解决方案2】:

在你的 build gradle 文件中添加代码。因为你可能会错过 com.google.android.gms/play-services 更新库文件,从而发生 FileNotFoundException。

   dependencies {
     classpath 'com.android.tools.build:gradle:1.5.0'
     classpath 'com.google.gms:google-services:2.0.0-alpha2'
    }
 //then complie 
   compile 'com.google.android.gms:play-services:8.3.0'

【讨论】:

    【解决方案3】:

    请禁用即时运行。

    在 Mac 上转到首选项 导航到构建、执行、部署 > 即时运行。

    取消选中 Restart activity on code changes 旁边的框

    这对我有用。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-09-13
      • 2020-03-29
      • 1970-01-01
      • 1970-01-01
      • 2021-05-22
      • 2016-01-08
      • 1970-01-01
      相关资源
      最近更新 更多