error MSB4018: The "AntBuild" task failed unexpectedly.

Howdy - I’m new to Android development. I’ve just installed the Tegra Android Dev Pack, used in conjuntion with Visual Studio 2010. Note that I have successfully built and run the TDK_Samples. I am now in the process of setting up a cocos2dx project, but when I add cocos2dx\platform\android\java then attempt to build the project, I get the following error:

MentorGraphics.Cpp.Android.Make.targets(123,5): error MSB4018: The "AntBuild" task failed unexpectedly.

And when I open that file, I see several of the xml tags (PropertyPageSchema,projectTools, TrackFileAccess,AntBuild, etc…) are considered to be invalid children.

I should note also that the cocos2dx project is a makefile-based pure java project that I imported via File|New|Project|Android|Import a makefile-based Android Project.

Any thoughts?

More info:

C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Android\MentorGraphics.Cpp.Android.Make.targets(123,5): error MSB4018: The “AntBuild” task failed unexpectedly.
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Android\MentorGraphics.Cpp.Android.Make.targets(123,5): error MSB4018: System.NullReferenceException: Object reference not set to an instance of an object.
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Android\MentorGraphics.Cpp.Android.Make.targets(123,5): error MSB4018: at vs_android.Build.CPPTasks.Android.AntBuild.ParseAndroidManifestXml(String xmlPath)
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Android\MentorGraphics.Cpp.Android.Make.targets(123,5): error MSB4018: at vs_android.Build.CPPTasks.Android.AntBuild.ValidateParameters()
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Android\MentorGraphics.Cpp.Android.Make.targets(123,5): error MSB4018: at Microsoft.Build.Utilities.ToolTask.Execute()
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Android\MentorGraphics.Cpp.Android.Make.targets(123,5): error MSB4018: at Microsoft.Build.CPPTasks.TrackedVCToolTask.Execute()
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Android\MentorGraphics.Cpp.Android.Make.targets(123,5): error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Android\MentorGraphics.Cpp.Android.Make.targets(123,5): error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask, Boolean& taskResult)

More info. The AndroidManifest.xml contains:

<?xml version="1.0" encoding="utf-8"?>

Now, if I add the block, stolen from a tdk sample:

<application android:icon="@drawable/icon" android:label="@string/app_name" android:hasCode="false">
    <!-- Our activity is the built-in NativeActivity framework class.
         This will take care of integrating with our NDK code. -->
    <activity android:name="" android:label="@string/app_name" android:configChanges="orientation|keyboard|keyboardHidden" android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
        <!-- Tell NativeActivity the name of or .so -->
        <meta-data android:name="" android:value="native_accelerometer" />
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />

It does seem to build, though cocos2dx is itself an application - just a package. Is it really necessary to define an block for a package? Or is there something else I really should be doing?

Sorry, we do not support it now. But we will keep it in trace and support it in the future.

Hello Bill,

Nsight Tegra requires application section to be present in the manifest. There must also be the main activity section.

Did you create the project yourself or did you use cocos2dx’s create-android-project.bat?