断开互联网后Android Studio无法找到一些资源

时间:2017-02-14 23:44:22

标签: java android xml android-studio resources

所以我遇到了一些与某些资源图像相关的麻烦,这些图像阻止我开发代码。我的代码工作正常,但几分钟没有上网,不知何故,Android Studio给了我一个错误,它再也找不到3个资源文件了:

Information:Gradle tasks [:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies, :app:compileDebugSources, :app:compileDebugAndroidTestSources, :app:compileDebugUnitTestSources]
C:\Users\...\Dropbox\programacao\Guia-do-Aluno-UnB\app\src\main\res\layout\activity_main.xml
Error:(99, 26) No resource found that matches the given name (at 'src' with value '@drawable/ic_directions_car_black_24dp').
Error:(109, 26) No resource found that matches the given name (at 'src' with value '@drawable/ic_directions_bike_black_24dp').
Error:(118, 26) No resource found that matches the given name (at 'src' with value '@drawable/ic_directions_walk_black_24dp').
C:\Users\...\Dropbox\programacao\Guia-do-Aluno-UnB\app\build\intermediates\res\merged\debug\layout\activity_main.xml
Error:(99, 26) No resource found that matches the given name (at 'src' with value '@drawable/ic_directions_car_black_24dp').
Error:(109, 26) No resource found that matches the given name (at 'src' with value '@drawable/ic_directions_bike_black_24dp').
Error:(118, 26) No resource found that matches the given name (at 'src' with value '@drawable/ic_directions_walk_black_24dp').

这是执行错误:

Error:Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt

我试过了:

  • 检查了+ id
  • 清理并重建项目
  • 重新同步Gradle并构建它
  • 以管理员身份运行
  • 彻底安装
  • 更改了compileSdkVersion

Here is an image of the file structure with the error code

我无法构建项目或再运行它!你能帮我么?

1 个答案:

答案 0 :(得分:0)

我没有找到答案,而是我的备份文件又重新整理了整个代码,因为我找不到答案。