-
Notifications
You must be signed in to change notification settings - Fork 47
Description
Summary
Running @trapezedev/configure on an Android project resets every <activity>’s android:name attribute in AndroidManifest.xml to .MainActivity. The transform is only supposed to touch the app’s launcher activity.
Steps to reproduce
- In
config.yaml, setplatforms.android.packageName(or leave the default staging value). - Ensure the project has additional activities (e.g., Facebook’s
com.facebook.FacebookActivityandcom.facebook.CustomTabActivity). - Run
npx @trapezedev/configure <config> android. - Open
android/app/src/main/AndroidManifest.xml.
Expected behavior
Only the main launcher activity should have its package updated.
Actual behavior
All <activity> nodes get rewritten to android:name=".MainActivity", breaking third-party activities.
Root cause
AndroidProject.setPackageName() calls:
this.manifest.setAttrs('manifest/application/activity', {
'android:name': activityName
});setAttrs updates every matching node. When the manifest lacks a <manifest package="…"> attribute (common with AGP 8+), activityName stays .MainActivity, so the loop overwrites each activity.
Environment
@trapezedev/configure7.1.3- Capacitor/Cordova Android project (AGP 8+ manifest without a
manifest@packageattribute)
Suggested fix
Update setPackageName() to target only the main/launcher activity—e.g., select the one with android.intent.action.MAIN or android:name='.MainActivity'—instead of every <activity>.