我开始学习 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”字符串在那里。有谁知道如何解决这个问题?
最佳答案
查看API Level你正在使用。
FILL_PARENT
在 API 级别 8 (Android 2.2) 中重命名为 MATCH_PARENT
。
关于java - Android NDK r4 san-angeles 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3000131/