bubblewrap
bubblewrap copied to clipboard
add custom element to AndroidManifest
Is your feature request related to a problem? Please describe.
Google wants me to add <uses-permission android:name="com.google.android.gms.permission.AD_ID"/> to the AndroidManifest,xml right before </manifest>. How can I achieve that? bubblewrap build is overwriting all changes and I didn't find a way yet on how to configure the xml file
I was working on that and noticed you can add that by editing the AndroidManifest.xml file that was generated by the bubblewrap after you have run bubblewrap init command.
The AndroidManifest.xml should be at location : <Project_location>\app\src\main
Then when you run the command to build , that manifest is the one that would be copied inside your apk
Hey, what feature are you trying to add to your TWA?
The official way of fixing this issue would be to add a feature that would include all the code that needs to be added in various places - for example the AppsFlyerFeature. You can see that feature already adds a few permissions to the manifest.
@iktumi If I edit the AndroidManifest.xml and build, all my changes get lost and the file looks like before
@PEConn I just try to add the mentioned tag in order to add ads to the PWA later (I wanna push it to the Google Play Store). THanks for the hint with features. Are you aware of any documentation about features?
Documentation on available features exists at https://github.com/GoogleChromeLabs/bubblewrap/tree/main/packages/cli#features.
Taking a step back, why do you need this permission within the TWA?
I have this issue too, prompted by the google play store:

Is there not a way to easily inject permissions into the manifest? If not, is there any documentation on creating a custom feature?
yes exactly. That is the reason @andreban . Thanks @andrewmunro
Anyone able to solve this? We have the same problem. bubblewrap build removes manually added ad_id tag. Is it part of the features list?