我开始使用
Android开发了.
我已经按照这个 Getting Started指南使用Android Studio(不是eclipse).
我已经按照这个 Getting Started指南使用Android Studio(不是eclipse).
我在我的设备上运行了Hello World,到目前为止一直很好.但..
添加此导入时问题开始:(按照指南的说明)
import android.support.v4.app.NavUtils; // cannot resolve symbol 'support'
看来它需要这一行(评论它并自动解决导入没有工作)
NavUtils.navigateUpFromSameTask(this);
支持导入是红色下划线,鼠标悬停告诉我无法解析符号’支持’
建造不会在任何一个地方工作.我已经看到类似问题的答案,例如;
建议清除缓存和重新启动(试过),
建议以管理员身份运行SDK Manager并更新(尝试过),
和其他一些看似日蚀的问题/解决方案.
我是Android开发和IDE的新手.如何在Android Studio v0.2.9中修复此问题?
编辑:
我的build.gradle文件的内容
buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:0.5.+' } } apply plugin: 'android' repositories { mavenCentral() } android { compileSdkVersion 17 buildToolsVersion "17.0.0" defaultConfig { minSdkVersion 7 targetSdkVersion 16 } } dependencies { // You must install or update the Support Repository through the SDK manager to use this dependency. // The Support Repository (separate from the corresponding library) can be found in the Extras category. // compile 'com.android.support:appcompat-v7:18.0.0' }
解决方法
修改您的gradle文件,如下所示,并尝试它是否有效.
...... dependencies { compile 'com.android.support:support-v4:18.0.0' // You must install or update the Support Repository through the SDK manager to use this dependency. // The Support Repository (separate from the corresponding library) can be found in the Extras category. // compile 'com.android.support:appcompat-v7:18.0.0' }
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。