android ide不会忘记图像 - android

时间:2013-07-03 18:56:21

标签: android compilation intellij-idea

我是Android开发的新手。我运行我的测试应用程序,并继续在values.xml文件

中收到编译错误消息
Gradle: String types not allowed (at 'myimage.jpg' with value 'myimage.jpg')

所以我从我的myimage.jpg文件中删除了main.xml引用,但我继续发出相同的消息(我在清理项目后重新启动了我的ide)

编辑:这是我的values.xml文件

<?xml version="1.0" encoding="utf-8"?>
<resources>

    <dimen name="activity_horizontal_margin">16dp</dimen>
    <dimen name="activity_vertical_margin">16dp</dimen>

    <drawable name="myimage.jpg">hey_image_ny.jpg</drawable>
    <drawable name="image_ny.jpg">image_ny.jpg</drawable>
    <drawable name="oups.jpg">oups</drawable>

    <string name="action_settings">Settings</string>
    <string name="app_name">gproject</string>
    <string name="hello_world">Hello world!</string>

    <style name="AppBaseTheme" parent="android:Theme.Light">
        <!--
            Theme customizations available in newer API levels can go in
            res/values-vXX/styles.xml, while customizations related to
            backward-compatibility can go here.
        -->
    </style>

    <style name="AppTheme" parent="AppBaseTheme">
        <!-- All customizations that are NOT specific to a particular API-level can go here. -->
    </style>

</resources>

和我的布局

<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:orientation="vertical"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:background="@drawable/oups">

</LinearLayout>

1 个答案:

答案 0 :(得分:0)

我明白了,我在res / drawable.xml中有很多应该被删除的extra_files,因此

<resources>
    <drawable name="myimage.jpg">myimage.jpg</drawable>
</resources>

所以我删除了它并编译了