在编码期间缺少R.java

时间:2016-10-15 10:33:02

标签: android r.java-file

我正在研究我的项目,突然间R.java消失了,整个项目现在因R缺失而被打破。我尝试重新重建它,但它没有工作.........任何解决方案,拜托?

错误讯息:

Information:Gradle tasks [clean, :app:generateDebugSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies, :app:generateDebugAndroidTestSources, :app:compileDebugSources, :app:compileDebugUnitTestSources, :app:compileDebugAndroidTestSources]
C:\Users\devha\AndroidStudioProjects\SystemApp\app\src\main\res\layout\activity_main.xml
Error:(13, 24) No resource found that matches the given name (at 'theme' with value '@style/AppTheme.AppBarOverlay').
C:\Users\devha\AndroidStudioProjects\SystemApp\app\src\main\res\layout\activity_main2.xml
Error:(13, 24) No resource found that matches the given name (at 'theme' with value '@style/AppTheme.AppBarOverlay').
Error:(20, 29) No resource found that matches the given name (at 'popupTheme' with value '@style/AppTheme.PopupOverlay').
C:\Users\devha\AndroidStudioProjects\SystemApp\app\src\main\res\layout\activity_main3.xml
Error:(12, 24) No resource found that matches the given name (at 'theme' with value '@style/AppTheme.AppBarOverlay').
C:\Users\devha\AndroidStudioProjects\SystemApp\app\src\main\res\layout\content_main2.xml
Error:(83, 27) No resource found that matches the given name (at 'text' with value '@string/sign_out').
C:\Users\devha\AndroidStudioProjects\SystemApp\app\build\intermediates\res\merged\debug\layout\activity_main.xml
Error:(13, 24) No resource found that matches the given name (at 'theme' with value '@style/AppTheme.AppBarOverlay').
C:\Users\devha\AndroidStudioProjects\SystemApp\app\build\intermediates\res\merged\debug\layout\activity_main2.xml
Error:(13, 24) No resource found that matches the given name (at 'theme' with value '@style/AppTheme.AppBarOverlay').
Error:(20, 29) No resource found that matches the given name (at 'popupTheme' with value '@style/AppTheme.PopupOverlay').
C:\Users\devha\AndroidStudioProjects\SystemApp\app\build\intermediates\res\merged\debug\layout\activity_main3.xml
Error:(12, 24) No resource found that matches the given name (at 'theme' with value '@style/AppTheme.AppBarOverlay').
C:\Users\devha\AndroidStudioProjects\SystemApp\app\build\intermediates\res\merged\debug\layout\content_main2.xml
Error:(83, 27) No resource found that matches the given name (at 'text' with value '@string/sign_out').
Error:Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt
Information:BUILD FAILED
Information:Total time: 11.348 secs
Information:11 errors
Information:0 warnings
Information:See complete output in console

1 个答案:

答案 0 :(得分:0)

  1. 检查所有布局文件并修复错误(

  2. 删除项目和应用的构建文件夹。

  3. 然后清理您的项目并重建它。

  4. 它会解决您的问题。 :)