bubblewrap icon indicating copy to clipboard operation
bubblewrap copied to clipboard

add custom element to AndroidManifest

Open Thomblin opened this issue 3 years ago • 8 comments

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

Thomblin avatar Sep 17 '22 12:09 Thomblin

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

iktumi avatar Sep 26 '22 00:09 iktumi

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.

PEConn avatar Sep 26 '22 09:09 PEConn

@iktumi If I edit the AndroidManifest.xml and build, all my changes get lost and the file looks like before

Thomblin avatar Oct 15 '22 11:10 Thomblin

@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?

Thomblin avatar Oct 15 '22 11:10 Thomblin

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?

andreban avatar Feb 03 '23 20:02 andreban

I have this issue too, prompted by the google play store:

image

Is there not a way to easily inject permissions into the manifest? If not, is there any documentation on creating a custom feature?

andrewmunro avatar Feb 18 '23 15:02 andrewmunro

yes exactly. That is the reason @andreban . Thanks @andrewmunro

Thomblin avatar Mar 10 '23 20:03 Thomblin

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?

Screenshot 2023-09-28 at 12 28 05 PM

ramakula avatar Sep 28 '23 19:09 ramakula