-
Notifications
You must be signed in to change notification settings - Fork 10
Closed
Description
Edited (2024-10-01)
aapt2 add error checking for AndroidManifest.xml so the following PR changes this build SDK to use that.
#10
See:
- https://developer.android.com/tools/aapt2#aapt2_element_hierarchy
- Backup: http://web.archive.org/web/20241001070128/https://developer.android.com/tools/aapt2#aapt2_element_hierarchy
Original Post
If you slightly mess up the XML in your AndroidManifest.xml file, you should ideally get an obvious compilation error.
For example, OpenXR wasn't working for me because I had failed to put a category within the intent filter.
Todo
Look into the apkanalyzer command line tool and invoke it testing the broken and then fixed version.
See: https://developer.android.com/studio/debug/apk-analyzer
Alternatively we could look at using the lint command here: https://developer.android.com/studio/write/lint.
Both of these commands exist in Android\Sdk\tools\bin
Broken/invalid XML
<activity android:name="HelloVRSDLActivity"
android:label="@string/app_name"
android:alwaysRetainTaskState="true"
android:launchMode="singleInstance"
android:configChanges="layoutDirection|locale|orientation|uiMode|screenLayout|screenSize|smallestScreenSize|keyboard|keyboardHidden|navigation"
android:preferMinimalPostProcessing="true"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="org.khronos.openxr.intent.category.IMMERSIVE_HMD" />
</intent-filter>Correct valid XML
<activity android:name="HelloVRSDLActivity"
android:label="@string/app_name"
android:alwaysRetainTaskState="true"
android:launchMode="singleInstance"
android:configChanges="layoutDirection|locale|orientation|uiMode|screenLayout|screenSize|smallestScreenSize|keyboard|keyboardHidden|navigation"
android:preferMinimalPostProcessing="true"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<category android:name="org.khronos.openxr.intent.category.IMMERSIVE_HMD" />Metadata
Metadata
Assignees
Labels
No labels