Android 构建提示 android.xactivity 错误(使用 NetBeans)

问题描述 投票:0回答:1

我尝试添加本机 Android 活动。我做到了

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>

但这给了我构建错误:

    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)

没有这个特定的构建提示,构建就成功了。我很好地关闭了所有标签,并确保它是一行,并且没有换行符。请问我错过了什么?

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

android android-activity build codenameone hint
1个回答
0
投票

正如您从生成的清单中看到的,

android.xactivity
构建提示不是添加额外的活动,而是向默认的 Android 活动添加自定义属性。

您正在寻找的是构建提示

android.xapplication

© www.soinside.com 2019 - 2024. All rights reserved.