Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding permissions using yml file #54

Closed
marioshtika opened this issue Mar 24, 2022 · 11 comments
Closed

Adding permissions using yml file #54

marioshtika opened this issue Mar 24, 2022 · 11 comments

Comments

@marioshtika
Copy link

Hello everyone,

I am trying to add some permissions on the AndroidManifest.xml file using a yml file.

I am adding the below lines on my yml file

  android:
    manifest:
      - file: AndroidManifest.xml
        target: manifest/application
        inject: |
          <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
          <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
          <uses-feature android:name="android.hardware.location.gps" />

and when I run the yml file it only enters the first one.

Am I doing something wrong?
Does the inject accept only one xml tag?
Is there another way to add permissions?

Thank you in advance

@lucafulgenzi
Copy link

@marioshtika had this problem too and solved it this way:

- file: AndroidManifest.xml
   target: manifest
   inject: |
       <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

- file: AndroidManifest.xml
   target: manifest
   inject: |
       <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

- file: AndroidManifest.xml
   target: manifest
   inject: |
       <uses-feature android:name="android.hardware.location.gps" />

Surely it's not the nicest and cleanest way, but it works for me.

@marioshtika
Copy link
Author

Thank you @lucafulgenzi this is how I also solved it.

But I was wandering if this is the solution or a workaround?
Or is there another way to add permissions?

@lucafulgenzi
Copy link

I think that's not the solution, as it would be inelegant to maybe have 15 different permissions and add them that way. I think that the problem will be solved soon because the project is still 'new' and it is not a too invasive issue.

@mlynch
Copy link
Contributor

mlynch commented Apr 5, 2022

Good point, this should work. Will take a look as I'm currently working on manifest stuff for #55

mlynch added a commit that referenced this issue Apr 5, 2022
@mlynch
Copy link
Contributor

mlynch commented Apr 11, 2022

This should be live in the next release. Can you install the most recent @next tag and give that a try?

@lucafulgenzi
Copy link

@mlynch Ok, I just tested it and it seems to work fine

@mlynch
Copy link
Contributor

mlynch commented Apr 11, 2022

@lucafulgenzi thank you! Will work on a formal release this week

@mlynch
Copy link
Contributor

mlynch commented Apr 13, 2022

2.0.8 is out with this feature, thanks!

@mlynch mlynch closed this as completed Apr 13, 2022
@marioshtika
Copy link
Author

Hello @mlynch and sorry for the late response.

I can confirm it too. This is working perfectly 👍

@JaumeBoschAnglada
Copy link

Hello. Mi permissions get duplicated run. I'm doing something wrond?

@puneetratan
Copy link

Any update on this, inject is keep on adding permission, if I am running command multiple time and I am using @trapezedev/configure": "^7.0.10-next.0",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants