No resource found Errors for support:appcompat-v7:22.0.0 on Android Studio

眉间皱痕 提交于 2019-11-29 14:09:16

I got this error when the filename was too long.

If you are running under windows, your build/intermediates/... files can get very long. You will get an odd error like this one if that happens.

I solved this by adding multiDexEnabled true in defaultConfig in gradle file.

And by adding

 dexOptions {
        javaMaxHeapSize "4g"
    }

after defaultConfig.

Since I ran into the same problem and there is no complete answer, I'll post it.

As @Brian Donovan-Smith mentioned, the problem occurs when one or more file names is too long (more than 260 characters). It is worth to note that the name includes the entire path. So, that was the problem in my case, and I solved it by moving the source folders to a closer to C: location.

Make sure you downloaded the files on your computer via SDK manager like in this guide: https://developer.android.com/tools/support-library/setup.html (Scroll down to "Adding libraries with resources")

Gradle alone won't do it, you need to download via SDK manager additoionally as this library inlcudes ressources:

Some Support Libraries contain resources beyond compiled code classes, such as images or XML files. For example, the v7 appcompat and v7 gridlayout libraries include resources.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!