Android NDK r4 san-angeles问题

时间:2010-06-08 18:25:11

标签: java android xml

我开始学习Android NDK,我立即遇到了问题。

我构建了工具链(花了比我预期的更长的时间!!)并且我编译了C ++代码没有任何问题,现在我正在尝试构建java代码。

我立刻遇到了问题。有一个文件“main.xml”

<?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"
    >
<TextView  
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:text="Hello World, DemoActivity"
    />
</LinearLayout>

我收到以下错误:

Description Resource Path Location Type
error: Error: String types not allowed (at 'layout_height' with value 'match_parent'). main.xml /DemoActivity/res/layout line 2 Android AAPT Problem
error: Error: String types not allowed (at 'layout_height' with value 'match_parent'). main.xml /DemoActivity/res/layout line 2 Android AAPT Problem
error: Error: String types not allowed (at 'layout_width' with value 'match_parent'). main.xml /DemoActivity/res/layout line 2 Android AAPT Problem
error: Error: String types not allowed (at 'layout_width' with value 'match_parent'). main.xml /DemoActivity/res/layout line 7 Android AAPT Problem
error: Error: String types not allowed (at 'layout_width' with value 'match_parent'). main.xml /DemoActivity/res/layout line 7 Android AAPT Problem

所以我可以看到问题在于这些“match_parent”字符串在那里。任何人都知道如何解决这个问题?

1 个答案:

答案 0 :(得分:100)

检查您正在使用的API Level

API级别8(Android 2.2)中将

FILL_PARENT重命名为MATCH_PARENT