Unity3d lets you customize your AndroidManifest.xml by placing a file under Assets/Plugins/Android/AndroidManifest.xml. As said earlier, we generate this file using StringTemplate. This file is supposedly copied under the APK packaging directory during the build (under Temp).
Except it doesn't work for us. For some reason Unity3.5 copies then overwrites the file during the build process. I am not really sure why. Unity's support told me the cause might be because we are using another plugin (we are using the playtomic one).
So we implemented a work-around. We still generate the proper AndroidManifest.xml during build pre-processing but as this file doesn't end up in the APK, we also post-process the APK before deploying it to appaloosa-store.
The script for post-processing the APK is found here https://gist.github.com/2235151 and is heavily inspired by this unity3d forum post. Note that we use the debug.keystore instead.
And here is how we invoke the script:
echo "Forcing the generated manifest" ANDROID_HOME=/Applications/android-sdk-macosx export PATH=$ANDROID_HOME/platform-tools:$PATH export PATH=$ANDROID_HOME/tools:$PATH ./scripts/android_set_manifest.sh target/Our.apk Assets/Plugins/Android/AndroidManifest.xml target/Our.apk
Hey,
ReplyDeletethanks for the nice post.
To me it seems like the file under Assets/Plugins/Android/AndroidManifest.xml is touched but some parts get overriden afterwards, like the bundle version code.
Have you considered to modify the 'ProjectSettings.asset' in a pre build step and update the 'AndroidBundleVersionCode'
Christoph
This is extremely helpful article. Saved me huge amount of time. Thanks for posting this!
ReplyDeleteThis site is very useful for everyone. I have found lot of stuff here, which is very interesting, but don't forget to check my website. We have amazing jackets and coats. All products are available at discounted price. We have limited stock. Order your favorite ones now. Mark L. Young Filthy Rich Green Jacket
ReplyDelete