简体   繁体   English

Android Studio找不到资源@drawable

[英]Android Studio No resource found @drawable

I have been following the developer tutorial from the official android Udacity course and they have exercises where you work on projects they have uploaded to github. 我一直在遵循官方android Udacity课程中的开发人员教程,并且他们在练习中处理了已上传到github的项目。

All of their projects I have worked on so far have gone smoothly. 到目前为止,我从事的所有项目进展顺利。 Unfortunately, the latest project (and a lot of projects after this project) have the same dependency errors and soon as I open them. 不幸的是,最新的项目(以及该项目之后的许多项目)都具有相同的依赖项错误,因此在我打开它们后就立即出现。 All the errors seem to be looking for a resource in a drawable folder. 所有错误似乎都是在可绘制文件夹中寻找资源。 I realize I don't have a drawable folder under my resources, but I feel this could be a problem due to the fact that I am lacking the correct hidden resource files (if that is possible, i am still new to android development). 我意识到我的资源下没有可绘制的文件夹,但是由于我缺少正确的隐藏资源文件(如果可能的话,我仍然是Android开发的新手),因此我认为这可能是个问题。

Another possibility is that version of android studio and my sdk's are a newer version than the project was originally created with which means the resource calls could be outdated. 另一个可能性是android studio版本和我的sdk版本比最初创建的项目要新,这意味着资源调用可能已过时。

I realize that several of the resource calls seem to have to do with the holo theme which has caused me problems in the past. 我意识到,一些资源调用似乎与过去曾引起我麻烦的全息主题有关。

失误

目录

Here is a link to some of the resource calls http://puu.sh/sKafe/d0a2fd7126.png 这是一些资源调用的链接http://puu.sh/sKafe/d0a2fd7126.png

My compiled and target sdk version is 25 我的编译和目标SDK版本是25 开发包

Here is the github for the project exercise I am attempting to do https://github.com/udacity/ud851-Exercises/tree/student/Lesson02-GitHub-Repo-Search/T02.04-Exercise-ConnectingToTheInternet 这是我正在尝试进行的项目练习的github https://github.com/udacity/ud851-Exercises/tree/student/Lesson02-GitHub-Repo-Search/T02.04-Exercise-ConnectingToTheInternet

I found out what was causing the problem. 我发现了造成问题的原因。 I re-cloned the GitHub, but this time I ran the project from the downloads folder and it worked fine. 我重新克隆了GitHub,但是这次我从downloads文件夹运行了该项目,并且运行良好。 I found out that the first time i downloaded the zip folder with the project, I unzipped it and then moved it to another directory where I keep my android projects. 我发现第一次下载带有项目的zip文件夹时,我将其解压缩,然后将其移动到另一个目录中,该目录中存放了我的android项目。 When I moved the project folder to the new directory, the file directory names became longer and some particular files names became longer than the character limit for the windows file naming system. 当我将项目文件夹移动到新目录时,文件目录名变得更长,并且某些特定的文件名变得超过Windows文件命名系统的字符数限制。 I was then prompted to skip those particular files which I must have selected yes, which caused the missing dependency issues. 然后提示我跳过那些必须选择“是”的特定文件,这会导致缺少依赖项问题。

you don't have the drawable directory,create one 您没有可绘制目录,请创建一个

right click on the res directory, 右键单击res目录,

res -> New -> Directory res->新建->目录

在此处输入图片说明

Enter the Directory Name as drawable -> ok 输入目录名称为可绘制->确定

在此处输入图片说明

add the drawble file in that.thats all. 在that.that全部中添加drawble文件。

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

相关问题 找不到与@ drawable / test err android studio匹配的资源 - No resource found that matches @drawable/test err android studio 找不到android autocomplettextview资源-资源不是可绘制的 - android autocomplettextview Resource not found - Resource is not a drawable 在drawable中找不到android eclipse资源图片 - android eclipse resource image not found in drawable 使用 Android 4.4.4 找不到可绘制资源 - Drawable Resource not found using Android 4.4.4 Android Studio 无法为 ImageView 找到可绘制资源 - Android Studio not able to find drawable resource for ImageView Android Studio Resource Manager 矢量可绘制预览 - Android Studio Resource Manager vector drawable preview Android Studio无法找到Drawable资源 - Android Studio Can't find Drawable Resource Android Studio:无法指定可绘制资源 - Android Studio: Trouble specifying drawable resource 在Android Studio中构建项目时出错“错误:找不到与给定名称匹配的资源(在____处使用值&#39;@ drawable / <name> “) - Error Building Project in Android Studio "Error: No resource found that matches the given name (at ____ with value '@drawable/<name>') 在 Android Studio 的插件中找不到 Android 可绘制导入器 - Android Drawable Importer not found in plugins in Android Studio
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM