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

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?

The only way is export your project to Eclipse, so you can change the manifest freely and package the application inside Eclipse.

Is there any tutorial about this?

‘Create Eclipse project layout’ setting can be found from Build Settings with Unity 4 and newer
http://devsupport.crystalsdk.com/default.asp?pg=pgDownload&pgType=pgWikiAttachment&ixAttachment=2187&sFileName=Screen%20Shot%202013-05-23%20at%2011.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