ipsilondev / openfl-unityads

UnityAds implementation for OpenFL/Haxe
MIT License
16 stars 1 forks source link

Overwrites other android permissions #7

Open mastef opened 8 years ago

mastef commented 8 years ago

It looks like the extension is overwriting any previous android permissions that were set in the Project.xml or by other extensions, resulting in the AndroidManifest.xml having only one <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> for some reason

Maybe priorities on where the extension was added - can you reproduce?

shadowofsoul commented 8 years ago

I used the extension on legacy, on 3.6.1 with no problems. give some more data:

1) are you using openfl 4.0? or legacy? 2) what other extensions are you using? in what order? so i can replicate.

mastef commented 8 years ago

1) Legacy 3.6.1

2) We're using a lot of them, but basically if I remove openfl-unityads then the permissions are loading correctly again. I removed all other extensions and the behaviour was the same. Seems as if ANDROID_PERMISSIONS is being overwritten so it only ends up with android.permission.WRITE_EXTERNAL_STORAGE

Minimum test case were in project.xml only following entries :

    <haxelib name="flixel" />
    <haxelib name="flixel-addons" />
    <haxelib name="openfl-unityads" if="mobile" />

Later on we're including the <template path="templates" /> and with that our own AndroidManifest.xml, but it also doesn't work if we use lime's AndroidManifest template.

Other extensions like

    <haxelib name="facebook" />
    <haxelib name="hypsystem" />
    <haxelib name="extension-android-immersive" if="android" />
    <haxelib name="extension-iap" />

behave normally, adding their permissions to the list without conflicts.

lime: [2.9.1]
flixel: [4.0.1]
openfl-unityads: [1.0.7]
openfl: [3.6.1]
hxcpp: [3.3.49]
mastef commented 8 years ago

PS : I think the git haxelib.json is one version behind the haxelib version ( 1.0.6 <-> 1.0.7 ) , could this be?

shadowofsoul commented 8 years ago

No, i usually forget to change the haxelib version, and i realize it after i upload it to haxelib. so i change that number, re-upload to haxelib and forgot to update the version in the git repo.

i can't check this right now, but i will investigate. is weird but maybe this line in include.xml needs to be removed, as anyway, the android extension already has an AndroidManifest.xml that is merged at compilation time, with the permissions. Still, must be tested. If you want to remove it and check it if fix the problem, let me know.

mastef commented 8 years ago

Yeah something is not right, I wasn't able to pinpoint it yet. I don't want to exclude the possibility that the other plugins aren't declaring the android permissions correctly themselves

Is the android.permission.WRITE_EXTERNAL_STORAGE needed? Should it be in the AndroidManifest instead?