简体   繁体   English

应用程式build.gradle错误

[英]App build.gradle error

This is happening after I launched AVD for app test, and it was starting android OS. 这是在我启动AVD进行应用测试之后发生的,并且它正在启动android OS。 few seconds later, my computer( using Mac) was restarted by causing error Android Studio. 几秒钟后,我的计算机(使用Mac)由于导致Android Studio错误而重新启动。 After the happening, my Android Studio is strange. 发生之后,我的Android Studio很奇怪。

  • It was working well, but it suddenly happened. 它运行良好,但突然发生了。
  • Android Studio does not still work after I used a Clean Project ,and it can't recognize things such as R. , all those methods. 使用“清理项目”后,Android Studio仍然无法运行,并且无法识别R.的方法。

Thank you :) 谢谢 :)

I attached the screenshot for your understanding. 我附上了屏幕截图,供您理解。

Android Studio错误

Your styles.xml is error. 您的styles.xml错误。 So you have to fix it and clean your project. 因此,您必须修复它并清理您的项目。 I think you are trying to add AppCompat to your project. 我认为您正在尝试将AppCompat添加到您的项目中。 Did you add the following line in your dependencies? 您是否在依赖项中添加了以下行?

compile 'com.android.support:appcompat-v7:23.1.1'

Make sure you are using the same compile SDK version and the app compat version. 确保您使用相同的编译SDK版本和应用程序兼容版本。 Check your gradle file. 检查您的gradle文件。

For example, if you are compiling with SDK 23 例如,如果您使用SDK 23进行编译

compileSdkVersion 23

You must use the same app compat version 23.xx 您必须使用同一应用程序兼容版本23.xx

compile 'com.android.support:appcompat-v7:23.4.0

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM