3

I am using Admob and Google play service in my unity app.

I am getting Merging manifest files error but i already made changes to all manifest files in my project ( MinSDk, TargetSDK, @android:value)

But still i am getting following error.

CommandInvokationFailure: Unable to merge android manifests. 
See the Console for more details. 
C:\Program Files\Java\jdk1.8.0_101\bin\java.exe -Xmx2048M-Dcom.android.sdkmanager.toolsdir="E:\adt-bundle-windows-x86-20130717\sdk\tools" -Dfile.encoding=UTF8 -jar "C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar" -

stderr[
Error: [Temp\StagingArea\AndroidManifest-main.xml:22, F:\Unity_workspace\Game\Temp\StagingArea\android-libraries\play-services-basement-9.6.1\AndroidManifest.xml:5] Trying to merge incompatible /manifest/application/meta-data[@name=com.google.android.gms.version] element:
<meta-data
      @android:name="com.google.android.gms.version"
--    @android:value="8115000">
<meta-data
      @android:name="com.google.android.gms.version"
++    @android:value="@integer/google_play_services_version">
]

stdout[
 [Temp\StagingArea\AndroidManifest-main.xml:22, F:\Unity_workspace\Game\Temp\StagingArea\android-libraries\MainLibProj\AndroidManifest.xml:13] Skipping identical /manifest/application/meta-data[@name=com.google.android.gms.version] element.
[Temp\StagingArea\AndroidManifest-main.xml:24, F:\Unity_workspace\Game\Temp\StagingArea\android-libraries\play-services-ads-lite-9.6.1\AndroidManifest.xml:10] Skipping identical /manifest/application/activity[@name=com.google.android.gms.ads.AdActivity] element.
]
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo   psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.Android.AndroidSDKTools.RunCommandInternal (System.String javaExe, System.String sdkToolsDir, System.String[] sdkToolCommand, Int32 memoryMB, System.String workingdir,   UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.Android.AndroidSDKTools.RunCommandSafe (System.String javaExe, System.String sdkToolsDir, System.String[] sdkToolCommand, Int32 memoryMB, System.String workingdir, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.HostView:OnGUI()

Any help is Welcome.

1 Answers1

1

As you have guessed, somewhere in your project the google_play_services_version field is hard coded.

Search the entire solution in your code editor for the value 8115000.

Replace the value with "@integer/google_play_services_version".

You said that you have already been through all manifests, but it might not be in a manifest, it could be an a values xml file.

lorond
  • 3,856
  • 2
  • 37
  • 52
turnipinrut
  • 614
  • 4
  • 12
  • I did what you told, but now i am getting "unable to convert classes into dex format" i put my console output at https://kobra.io/#/e/-KSv1lTpFjFMRqElJhCv Please look into it and help me. thanks – Manoj Ahirwar Sep 30 '16 at 12:24
  • 1
    This is actually good news, it means that the value problem is fixed, but now you have this new error. The problem with android errors in unity is that there is a ton of usless info in them. See this line 'code' Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat; 'code' That is the actual problem. It means that somewhere in your unity project you have 2 versions of the Android Support Library version 4. Unity is complaining because it is trying to add a class that is already added. – turnipinrut Oct 03 '16 at 07:37
  • Just delete one of the support v4 jar files. Doesn't matter which one. – turnipinrut Oct 03 '16 at 07:39