Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android NDK r4 san-angeles problem

Tags:

java

android

xml

I'm starting to learn the android NDK and I've instantly come up against a problem.

I'e built the tool chain (which took a LOT longer than I was expecting!!) and I've compiled the C++ code with no problems and now I'm trying to build the java code.

Instantly I come up against a problem. There is a file "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> 

and I get the following errors:

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 

So I can see the problem lies in the fact that these "match_parent" strings are in there. Anyone know how to fix this?

like image 279
Goz Avatar asked Jun 08 '10 18:06

Goz


People also ask

What is difference between Android NDK and SDK?

Android provides Native Development Kit (NDK) to support native development in C/C++, besides the Android Software Development Kit (Android SDK) which supports Java. [TODO] more. NDK is a complex and advanced topics.

How do I know what version of NDK I have?

With a project open, click Tools > SDK Manager. Click the SDK Tools tab. Select the Show Package Details checkbox. Select the NDK (Side by side) checkbox and the checkboxes below it that correspond to the NDK versions you want to install.

What is NDK tools in Android Studio?

The Native Development Kit (NDK) is a set of tools that allows you to use C and C++ code with Android, and provides platform libraries you can use to manage native activities and access physical device components, such as sensors and touch input.

How do you use NDK?

You can automatically install the required NDK and CMake using the Android Gradle Plugin 4.2. 0+ when the project is first created, provided their licenses are accepted beforehand. If you have read and agree to the terms of the license, you can use the following command to pre-accept the license in the script.


1 Answers

Check what API Level you are using.

FILL_PARENT was renamed to MATCH_PARENT in API Level 8 (Android 2.2).

like image 163
dbyrne Avatar answered Oct 09 '22 04:10

dbyrne