- Home /
How can I build a manifest with android:targetSdkVersion="21"?
I need to have targetSdkVersion="21" in my app. How can I build an APK in unity with this?
Answer by codeage · Jul 29, 2015 at 06:51 AM
You can make a customized AndroidManifest.xml and specify the targetSdkVersion, then save this file in folder ProjectRoot/Assets/Plugins/Android (create the folder if it does not exist). Unity will use this customized manifest file while building/exporting the project.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.company.product" android:versionName="1.0.0.1" android:versionCode="1" android:installLocation="auto">
<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="21" />
<uses-permission android:name="android.permission.INTERNET" />
...
</manifest>
Answer by ahmedbenlakhdhar · Dec 08, 2014 at 06:06 PM
You may build a Google Android project by clicking on Export button, after checking the Google Android Project option in the Build Settings.
After that, in the generated folder, you will find the android-manifest file which you may be able to modify as you like. Then you may perform an usual build to create an apk file for your project.
I don't want to change $$anonymous$$SdkVersion, I want to change targetSdkVersion.
I am sorry, I didn't notice that. The answer is edited.
Answer by Dave-Hampson · Mar 31, 2015 at 01:24 PM
Note for 22, if you upgrade your Android SDK to 22, restart Unity and remake your APK it will add targetSdkVersion automatically:
<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="22" />
Your answer
Follow this Question
Related Questions
Multiple Plugin and AndroidManifest.xml 0 Answers
AndroidManifest.XML Question 0 Answers
Unity Admob Failed to re-package resources 2 Answers
Android Activity launchMode override via AndroidManifest 0 Answers
Android manifest file 0 Answers