简体   繁体   English

项目无法在Android Studio中运行

[英]Project wont run in Android Studio

I'm doing the beginner android course on udacity and the code that they make you put in the MainActivity.java file is full of errors and keeps saying build failed in the console. 我正在做关于udacity的初学者android课程,他们使您放入MainActivity.java文件中的代码充满了错误,并一直说在控制台中构建失败。 Here is a link to a screenshot of android studio after failed build http://postimg.org/image/6etcu6ldz/ 这是构建失败后android studio屏幕截图的链接http://postimg.org/image/6etcu6ldz/

I think support library is missing. 我认为缺少支持库。

Go to your build.gradle (Module:app) and check if support library is in dependencies section. 转到您的build.gradle(Module:app)并检查支持库是否在“依赖项”部分中。

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:support-v4:21.+'
}

In addition, you have to install it in SDK Manager. 此外,您必须将其安装在SDK Manager中。

I hope this answer will help you! 希望这个答案对您有所帮助!

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

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