• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Question - IDE How to merge a custom AndroidManifest with the main one in Gamemaker Studio 2.3

M

MegabyteDev

Guest
I wrote a plugin for GMS2, and it requires some Androidmanifest entries too.
Usually, the sections (2 & 3) in the image below, work for most cases. But if we wanna add some attributes to the main application tag, then we would use the section 1 as in the image. But when we write something in section 1 like:
XML:
<application tools:replace="android:allowBackup" android:allowBackup=true></application>
Gamemaker copies the whole statement as it is inside the final merged "AndroidManifest.xml" and the Manifest merger fails. I also tried adding
XML:
tools:node="merge"
to the application tag still it doesn't merge.
Is there a way to make it merge the attributes only instead of copying the whole text?
I am also new to the gms2 game development, and I really could use some help, I'm stuck here from 2 days and I cannot find any solution to this. Any Help is greatly appreciated :)


Screenshot 2021-02-18 213900.png
 

Mool

Member
I didnt read your text carefully, but I think I still can help you.

A lot of important android files you cant edit via GMS. You need to edit them via a normal text editor directly.

You can find these files in the runner folder, sadly you need to edit them once per runner update.

Here they are:
1613680954049.png

Look here how I do it for one of my extensions: https://github.com/Glim888/IronSource-for-GameMaker-Studio
 
M

MegabyteDev

Guest
@Mool yes, we can but currently doing that is not a solution but more like a workaround. What I want to achieve is directly related to the application tag in the manifest file. Instead of copying the text as inserted into the "First field of the manifest section" where we define gradle injections and manifest injections, it needs to take that text and merge it into the final main android manifest file.

Have you defined anything in the first section of manifest injections field?
 
M

MegabyteDev

Guest
@Mool Yes this works only if, there is no already existing attribute in the final application tag.
In your case clearTextTraffic doesnt exist by default, so no conflict arises.

But
XML:
android:allowBackup
already exists by default in every android application build. Its default value is false, but I need to set it to true, Is there any way?
 

Mool

Member
I just can tell you, that I removed the android:allowBackup via editor, since i had problems with my extensions

1613760345109.png

Is there any way? yes use the workaround. Its done in 5sec
 

Yuri Abel

Member
I didnt read your text carefully, but I think I still can help you.

A lot of important android files you cant edit via GMS. You need to edit them via a normal text editor directly.

You can find these files in the runner folder, sadly you need to edit them once per runner update.

Here they are:
View attachment 38092

Look here how I do it for one of my extensions: https://github.com/Glim888/IronSource-for-GameMaker-Studio
Hello @Mool I'm a beginner, is this change valid only when building the apk? or can i use in debug mode? because when I run the app on my smartphone for testing it rewrites the AndroidManifest and the error comes back, or I must be changing the wrong Manifest, thanks....
 

Yuri Abel

Member
It works always. For testing and for releasing. I do this daily
Yes it worked for me, it was on the wrong path, on the Mac the path to the runner is: /Users/Shared/GameMakerStudio2/Cache/runtimes/runtime-2.3.3.437/android/runner

Thank you very much...
 
Top