Search code examples
androidandroid-activitybuildcodenameonehint

Android Build Hint android.xactivity Error (using NetBeans)


I tried to add Native Android Activity. I did

android.xactivity = <activity android:name="com.appne.exam.NFCActivity" android:label="@string/app_name"><intent-filter><action android:name="android.intent.action.MAIN" /><category android:name="android.intent.category.LAUNCHER" /></intent-filter></activity>

But that gives me Build Errors:

    at com.android.build.gradle.internal.tasks.manifest.ManifestHelperKt.mergeManifestsForApplication(ManifestHelper.kt:83)
    ... 102 more
Caused by: org.xml.sax.SAXParseException; lineNumber: 27; columnNumber: 1; Element type "activity" must be followed by either attribute specifications, ">" or "/>".
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203)

The build was successful without this particular build hint. I closed all tags well and ensured it's a single line, and no line breaks. Please What am I missing?

Error Log line 1-20
User-level: 9000
Request Args: 
-----------------
build.incSources=1
android.xactivity=<activity android:name="com.juliocmms.exam.NFCActivity" android:label="@string/app_name" ><intent-filter><action android:name="android.intent.action.MAIN" /><category android:name="android.intent.category.LAUNCHER" /></intent-filter></activity>
java.version=8
android.xpermissions=<uses-permission android:name="android.permission.NFC"/>
ios.newStorageLocation=true
-------------------
Effective build tools version = 30
Executing: 
Executing: /home/ec2-user/android-sdk/tools/android create project --target android-33 --name NFCuju --path /tmp/build595835833784802315xxx/NFCuju --activity NFCujuStub --package com.juliocmms.exam --gradle --gradle-version 4.1.1 /home/ec2-user/android-sdk/tools/android create project --target android-33 --name NFCuju --path /tmp/build595835833784802315xxx/NFCuju --activity NFCujuStub --package com.juliocmms.exam --gradle --gradle-version 4.1.1 
Executing with timeout -1
Created directory /tmp/build595835833784802315xxx/NFCuju/src/main/java
Created directory /tmp/build595835833784802315xxx/NFCuju/src/main/java
Created directory /tmp/build595835833784802315xxx/NFCuju/src/main/java/com/juliocmms/exam
Created directory /tmp/build595835833784802315xxx/NFCuju/src/main/java/com/juliocmms/exam
Added file Added file /tmp/build595835833784802315xxx/NFCuju/src/main/java/com/juliocmms/exam/NFCujuStub.java
/tmp/build595835833784802315xxx/NFCuju/src/main/java/com/juliocmms/exam/NFCujuStub.java
Created directory Created directory /tmp/build595835833784802315xxx/NFCuju/src/androidTest/java/tmp/build595835833784802315xxx/NFCuju/src/androidTest/java
........
...... line 107 - 121
      <activity android:name="NFCujuStub"
<activity android:name="com.juliocmms.exam.NFCActivity" android:label="@string/app_name" ><intent-filter><action android:name="android.intent.action.MAIN" /><category android:name="android.intent.category.LAUNCHER" /></intent-filter></activity> android:exported="true"                  android:theme="@style/CustomTheme"
                  android:configChanges="orientation|keyboardHidden|screenSize|smallestScreenSize|screenLayout"
                  android:launchMode="singleTop"
                  android:label="NFCuju">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
  <receiver android:name="com.codename1.impl.android.LocalNotificationPublisher"  android:exported="false"></receiver>
<receiver android:name="com.codename1.location.BackgroundLocationBroadcastReceiver"  android:exported="true"></receiver>
<service android:name="com.codename1.impl.android.BackgroundFetchHandler" android:exported="false" />
<activity android:name="com.codename1.impl.android.CodenameOneBackgroundFetchActivity" android:theme="@android:style/Theme.NoDisplay" />
<activity android:name="com.codename1.location.CodenameOneBackgroundLocationActivity" android:theme="@android:style/Theme.NoDisplay" />

I hope i included the right portions, its 4865 lines in all. I copied and pasted from the first activity tag to the last


Solution

  • As you can see from the generated manifest the android.xactivity build hint is there not to add an additional activity but rather to add custom attributes to the default android activity.

    What you're looking for is the build hint android.xapplication.