Search Unity

Unity has a horrible habit of making changes to AndroidManifest.xml

Discussion in 'Android' started by GermyGames, Jul 11, 2013.

  1. GermyGames

    GermyGames

    Joined:
    May 20, 2012
    Posts:
    38
    Okay, so I have a custom manifest file in assets/Plugins/Android/AndroidManifest.xml

    Our publisher mentioned that we had a permission request for the camera in our manifest. We didn't have on in our custom manifest file, so this was pretty confusing. I then decoded the APK using apktool, and sure enough the camera permission was added.

    After some monkeying around, I found that if I set android:required="false", that will prevent the permission from being added, and the tag will be left alone.

    Our publisher also requires that we set android:minSdkVersion and android:targetSdkVersion. When we build, Unity removes the entire uses-sdk tag!

    How the hell do we stop Unity from gutting our manifests!? At the very least, we need to be able to add something to the manifest and keep it there. Is there some build setting we can check, or a config file we can change?
     
  2. evandropaulino

    evandropaulino

    Joined:
    Aug 7, 2012
    Posts:
    21
    The only way is export your project to Eclipse, so you can change the manifest freely and package the application inside Eclipse.
     
  3. kenshin

    kenshin

    Joined:
    Apr 21, 2010
    Posts:
    940
    Is there any tutorial about this?
     
  4. Agent_007

    Agent_007

    Joined:
    Dec 18, 2011
    Posts:
    899
    'Create Eclipse project layout' setting can be found from Build Settings with Unity 4 and newer
    http://devsupport.crystalsdk.com/de...leName=Screen Shot 2013-05-23 at 11.40.43.png

    after the project is created you can open it in Eclipse with File -> Import, then Android -> Existing Android code Into workspace

    then you can test it out with real device
    http://developer.android.com/training/basics/firstapp/running-app.html#RealDevice
    and when it is ready for release
    http://developer.android.com/tools/publishing/app-signing.html#releasecompile
    http://developer.android.com/tools/publishing/app-signing.html#ExportWizard
     
    Last edited: Jul 13, 2013