Unity3D - Error: The minSdk version can not be specified in the AndroidManifest.xml file. You have to remove it

1.7k Views Asked by At

Build Error appears in Pop Up.

Gradle Error: MinSDK in Manifest

The minSdk version can not be specified in the AndroidManifest.xml file. You have to remove it.
(See the Console for details)

Build Errors appear in console

> Configure project :launcher
WARNING: The option 'android.enableR8' is deprecated and should not be used anymore.
It will be removed in a future version of the Android Gradle plugin, and will no longer allow you to disable R8.



Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':launcher:lintVitalRelease'.



UnityEditor.BuildPlayerWindow+BuildMethodException: 4 errors
  at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x002be] in /Users/bokken/buildslave/unity/build/Editor/Mono/BuildPlayerWindowBuildMethods.cs:190 
  at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in /Users/bokken/buildslave/unity/build/Editor/Mono/BuildPlayerWindowBuildMethods.cs:95 
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&) (at /Users/bokken/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:189)

Picture of some errors I couldn't copy. Console errors, click to view

in essence: I have tried reinstalling/Updating JAVA. I have tried removing minsdk line from AndroidManifext.xml I have tried all possible solutions available on internet but remained with same error. Please Help to resolve this I want the build.

AndroidManifest.xml File

<?xml version="1.0" encoding="utf-8"?>

<!--
   WARNING: Do NOT modify! Generated file.
-->

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="__AndroidManifest_Package__"
    android:versionCode="__AndroidManifest_VersionCode__"
    android:versionName="__AndroidManifest_VersionName__">
    
    <uses-sdk 
   
        android:targetSdkVersion="__AndroidManifest_TargetSdkVersion__"/>

</manifest>

1

There are 1 best solutions below

1
On

I can't see your problem, but here is my manifest file that works for me. you can try this. be sure to set your package name in line 4.

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
      xmlns:tools="http://schemas.android.com/tools" 
      package="com.test.test" 
      android:theme="@android:style/Theme.NoTitleBar" 
android:versionCode="1" android:versionName="1.0">
<supports-screens 
android:smallScreens="true" 
android:normalScreens="true" 
android:largeScreens="true" 
android:xlargeScreens="true" 
android:anyDensity="true" />
<application android:icon="@drawable/app_icon" 
           android:label="@string/app_name" 
           android:debuggable="true" 
           android:usesCleartextTraffic="true" 
           android:theme="@style/UnityThemeSelector">
  <activity android:name="com.unity3d.player.UnityPlayerActivity" android:label="@string/app_name">
  <intent-filter>
    <action android:name="android.intent.action.MAIN" />
    <category android:name="android.intent.category.LAUNCHER" />
  </intent-filter>   
  <meta-data android:name="unityplayer.UnityActivity" android:value="true" />
  <meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="false" />
</activity>
</application>
<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="21" />
</manifest>