2017-09-04 96 views
0

在Android Studio中渲染項目時遇到問題。它說一個文件不存在或不是一個文件,但它存在,它是一個文件。渲染Android studio 2.3.3:文件不存在或不是文件

我已經嘗試了一切,將SDK級別降低到清單所說的級別。我也改變了主題,但沒有任何反應,現在我甚至無法打開模擬器,它說它一直試圖打開300秒。

請幫忙。我會附上照片。

This is the render problem

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

在清單中的SDK的版本是22,這就是我使用了一個:

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

這就是我所說的佈局代碼此文件:

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" > 

而他再是該文件的內容:

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

最有可能的是,該文件不應該在'res/xml /'中。請編輯您的問題併發布該文件的內容以及您嘗試使用它的佈局資源。 – CommonsWare

+0

我在文件和內容資源中添加了我想要使用它的內容 – user8559076

+0

'res/xml /'用於定製XML或沒有自己的專用資源類型的框架XML(例如,首選項,快捷方式,'FileProvider'元數據)。就你而言,你正在定義一個drawable。將該文件移動到'res/drawable-nodpi /',看看你是否有更好的運氣。 – CommonsWare

回答

2

你已經把繪製對象文件(文件包含shape標籤)到xml文件夾,因此Android工作室interpretate它不正確。將它移動到drawable文件夾