你好,我的伙伴和我一直在研究这个问题,并在过去的两周里对这个问题进行了研究。我们使用的是 Android 版本 5.0.1,它不会生成我们的资源文件(r.java)。 我们认为这可能与我们在创建项目时遇到的这些错误有关。任何帮助将非常感激。错误跟在这一段之后。
[2014-12-23 13:01:39 - jcandroid!] C:\Users\Jacob\workspace\jcandroid!\res\values\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name Theme.AppCompat.Light'.
[2014-12-23 13:01:39 - jcandroid!]
[2014-12-23 13:01:39 - jcandroid!] C:\Users\Jacob\workspace\jcandroid!\res\values-v11\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'.
[2014-12-23 13:01:39 - jcandroid!]
[2014-12-23 13:01:39 - jcandroid!] C:\Users\Jacob\workspace\jcandroid!\res\values-v14\styles.xml:8: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'.
[2014-12-23 13:01:39 - jcandroid!]
最佳答案
我注意到一件事是你有一个感叹号!在您的项目名称中。您应该删除它,因为它可能会导致工具出现奇怪的问题。
同时检查您的项目是否包含 AppCompat 库。
按照说明下载并安装 AppCompat 库 on the Android Developers site .
通过右键单击项目然后选择属性 -> Android,确保将库添加到 Eclipse 中的项目。在库中,单击添加,然后选择 appcompat_v7 库。
关于java - Android Eclipse v.20 不生成 R.java,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27625698/