Render Android studio 2.3.3: File does not exist or is not a file

Issue

I’m having trouble when rendering a project in Android Studio. It says a file doesn’t exist or is not a file, but it exists and it is a file.

I have tried everything, lowering the SDK level to the one the manifest says. I also changed the theme, but nothing happens and now I can’t even open the emulator, it says that it has been trying for 300 seconds to open.

This is the render problem:

This is the render problem

Here is the file that "doesn’t exist" according to the problem:

Here is the file that "doesn't exist" according to the problem

The version of the SDK in the manifest is 22 and that’s the one I’m using:

<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="22" />   

This is the code of the layout where I call this file:

android:id="@+id/lyHeader"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@xml/header_color"
android:paddingBottom="5dip"
android:paddingTop="5dip" >

And here is the content of the file:

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<solid android:color="#71A2C7" />
</shape>

Solution

You have put the Drawable file (file contains shape tag) to xml folder, so Android Studio interpretate it incorrectly. Just move it to drawable folder

Answered By – Valentun

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published