At the very start we decided to replace the traditional AndroidManifest.xml with C# attrbutes. The reasoning was that this is what C# developers are more familiar with. E.g. the following:
[assembly: Application("dot42Application2")]
translates into:
<application android:label="dot42Application2">
Under the hood, the dot42 compiler generates the AndroidManifest.xml from the attributes before packaging it with the APK.
User feedback told us that something that was intended to be a convenience was more of an obstruction.
Manifest resource item
With 1.0.1.80 we have introduced the manifest resource item template. This allows you to include a traditional AndroidManifest.xml in your dot42 project.
You can either create a new one from the Solution Explorer like this:
- from the context menu of your project select Add -> New Item...
- From the dialog, select node dot42->Android
- From the available items select Manifest resource and set its name at the bottom of the dialog
Visual Studio will now add an Android Manifest to your solution. Some information is taken from your project settings, and inserted in the manifest.
Or you can simply copy an existing manifest to your project, include it in your project and set the build action to "ManifestResource" like this:
If you compile your project, Visual Studio will now detect that you have a manifest in your project and uses this file instead of generating one from attributes. This gives you more freedom over what your manifest contains. But with more freedom comes more responsibility: you have to make sure that all information in the manifest is correct. The only thing we check is if the SDK versions of your project match those in the manifest file. If not, a build error is generated. Clicking this error will take you to the attribute in the manifest that needs to be changed.
If you have both manifest attributes and a manifest file, then your attributes are ignored.
You can have only one manifest in your project. If more are found, a build error is generated for each manifest file. This makes it easier to locate all manifest files.
What about my 'old' manifest attributes?
These will continue to work. Your manifest attributes will only be ignored if you add a manifest resource to your project. If you want to transition from manifest attributes to an explicit manifest file, you can find the generated AndroidManifest.xml in \obj\Debug\TempCode after a successful build. Copy it to the root of your project and include it as described above.