To allow your game to run on lower Android versions, set the Minimum Android version to the desired version in the project properties. Since MonoGame targets Android 4.2, the Target Framework in your Android project must be set to 4.2 or higher. If you build MonoGame from source, you will need the SDK Platform for API Level 17 installed in the Android SDK Manager. MonoGame is built to target Android 4.2 (API Level 17), but can run on lower Android versions. When it completes, you can click in Open Folder on the Archives screen to see your generated APK file.Specifying the target Android versions can be confusing. You may be prompted to type the Key Store password. if you don't, you can create a new Android Key Store by clicking in +. If you already have one, you can use it by clicking in Import. In the following screen, an Android Key Store is needed to sign the APK. The second will directly publish the app in Google Play.Ĭhoosing the first is recommended, so you can test the APK in other devices if you want. The first will create an APK and save it in your computer. The Distribute screen will present you two options: Ad-hoc and Google Play. When it finishes archiving the project, click in Distribute. This will open the Archive manager and begin archiving the project, preparing to create the APK file. To create the APK file, right-click the Xamarin.Android project in the Solution Explorer and select Archive. A full tutorial from Xamarin documentation can be found here: The tutorial below shows how to generate the APK in Visual Studio. You finished configuring your Android project for Release. Supported architectures: Select all, for compatibility reasons.Īfter configuring everything, Rebuild the Project to make sure that it builds successfully. Public class ServiceException : Exception Public sealed class PreserveAttribute : System.Attribute PreserveAttribute.cs namespace My_App_Core.Models To avoid that, you can either set the Linking to "Sdk Assemblies Only" or use the Preserve attribute in your classes, example: Xamarin.Linker may sometimes remove classes that are not seemed to be used by your code, especially if they are in the project's Core (PCL library). This will make the Xamarin Linker to remove all unused classes from SDK and your code, reducing the APK size. Enable developer instrumentation (debugging and profiling): false for Release APK.More information on Proguard for Xamarin.Android can be found here. This enables the Proguard tool that obfuscates Java code in your app. Enable Multi-Dex: true, but you can set it to false if your app is not very complex (that is, has less than 65536 methods, see here).Create your APK for as many platforms as possible, for compatibility reasons. Generate one package (.apk) per selected ABI: false.If Mono Runtime is not installed in the device and this option is set to true in the Release APK, the app will crash. The Mono Runtime is installed automatically when debugging through USB, but not in the Release APK. If you set it to true, the APK will use Mono Runtime to execute. If the Configuration is set to Debug, it will not be accepted by Google Play. These are necessary to build your APK for the Google Play Store. Using the right options here can reduce a lot your APK size and also prevent errors. In the screen below, you can configure the compiler options. Required permissions: Here you determine which permissions are necessary for your app.Install location: This determines where your APK will be installed, in the device storage or SD Card.Version name: This is the version name that will be displayed to the user.When you want to publish an APK for an updated version of your app, you must add 1 to this number for each new upgrade. Version number: The version number is used by Google Play for version control.Application Icon: This is the icon that will be visible to the user, equivalent to the used in Android Studio or Eclipse projects. It must be unique, meaning that it must not use the same package name of other apps in the Google Play Store.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |