0

我是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>
4

1 回答 1

0

我明白了,我在 res/drawable.xml 中有很多应该删除的额外文件,所以

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

所以我删除它并编译

于 2013-07-03T19:29:45.523 回答