gpt4 book ai didi

Android SDK 资源转换/编译问题

转载 作者:太空宇宙 更新时间:2023-11-03 13:07:13 25 4
gpt4 key购买 nike

我正在开发 Android 应用程序,但遇到布局资源问题,失败。

我是 Java、Android 和 Eclipse 的新手。每次我保存 XML 时,Eclipse 只会输出以下内容:

...“无效文件名:必须仅包含 [a-z0-9_.]”

我检查过没有 .out 文件。我检查了 XML,它似乎是有效的。文件名为 numberSelectorDialog.xml。我已检查路径是否接近 Win32 限制。

我的布局资源 xml 如下所示:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:id="@+id/LinearLayout01"
android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:padding="12px"
android:layout_width="175px" android:layout_gravity="center_vertical|center_horizontal|center"
android:focusable="true" android:focusableInTouchMode="true"
android:gravity="center_vertical|center_horizontal|center">
<LinearLayout android:id="@+id/LinearLayout02"
android:layout_width="wrap_content" android:layout_height="wrap_content">
<Button android:id="@+id/Button01" android:text="1"
android:layout_width="50px" android:layout_height="50px"></Button>
<Button android:id="@+id/Button02" android:text="2"
android:layout_height="50px" android:layout_width="50px"></Button>
<Button android:id="@+id/Button03" android:text="3"
android:layout_height="50px" android:layout_width="50px"></Button>
</LinearLayout>
<LinearLayout android:id="@+id/LinearLayout03"
android:layout_width="wrap_content" android:layout_height="wrap_content">
<Button android:text="4" android:layout_height="50px"
android:layout_width="50px" android:id="@+id/Button04"></Button>
<Button android:text="5" android:layout_height="50px"
android:layout_width="50px" android:id="@+id/Button05"></Button>
<Button android:text="6" android:layout_height="50px"
android:layout_width="50px" android:id="@+id/Button06"></Button>
</LinearLayout>
<LinearLayout android:id="@+id/LinearLayout04"
android:layout_width="wrap_content" android:layout_height="wrap_content">
<Button android:text="7" android:layout_height="50px"
android:layout_width="50px" android:id="@+id/Button07"></Button>
<Button android:text="8" android:layout_height="50px"
android:layout_width="50px" android:id="@+id/Button08"></Button>
<Button android:text="9" android:layout_height="50px"
android:layout_width="50px" android:id="@+id/Button09"></Button>
</LinearLayout>
<Button android:layout_height="wrap_content" android:text="Clear" android:layout_width="fill_parent" android:id="@+id/ButtonClear"></Button>
</LinearLayout>

还有其他建议吗?

谢谢,

菲利普

最佳答案

我发现了问题... secret 就在错误消息中 ;-)

文件名必须完全小写,而不是我使用的驼峰式大小写。

菲利普

关于Android SDK 资源转换/编译问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2075073/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com