godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
90.71k stars 21.12k forks source link

Provide a Way to Edit AndroidManifest.xml #25062

Closed Shin-NiL closed 5 years ago

Shin-NiL commented 5 years ago

This is just a feature request based on some of the difficulties I have had lately working with Android modules.

It would be interesting to have a way to edit the entire AndroidManifest.xml file and not just some specific fields (package name, some permissions, etc) as it does today. This way, the user can have more control over more specific cases that which were not initially foreseen.

Today, modules like GPGS need to be recompiled for every app because it has to have the app id inserted on the AndroidManifest and it's a real pain to maintain serveral apps this way.

I'm unable to update the Admob module because in the Google SDK latest versions a provider authority is auto inserted in the final AndroidManifest:

<provider android:authorities="com.godot.game.mobileadsinitprovider" android:exported="false" android:initOrder="100" android:name="com.google.android.gms.ads.MobileAdsInitProvider"/>

Which is a problem, because two apps can't have the same value, but it's impossible to change it without hack the gradle build files. Even if it was a easy way to edit the gradle files before compiling the template, we would be in the same situation as GPGS, one compilation per app.

volzhs commented 5 years ago

related #18865

salomander86 commented 5 years ago

@Shin-NiL How did you hacked gradle build files? I have this issue right now and have no idea what to do...

Shin-NiL commented 5 years ago

@salomander86 I have to edit the generated build.gradle file to add a unique application id:

android {
    defaultConfig.applicationId = "com.company.appname"
}
salomander86 commented 5 years ago

@Shin-NiL so, each time, before compile templates for different games I need to change this name?

Shin-NiL commented 5 years ago

@salomander86 yeah, that's it :(

Calinou commented 5 years ago

This is now possible in the new Android exporting system, closing. See Custom builds for Android in the documentation.

See also #6800.