Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

AndroidManifest

Discussion in 'Android' started by FyreDogStudios, Oct 21, 2015.

  1. FyreDogStudios

    FyreDogStudios

    Joined:
    Aug 23, 2015
    Posts:
    97
    For the last few weeks I have been getting this error when building, and I have no idea why:



    I have done everything, changed the build target API, downloaded every buildtools, downloaded 30GB of APIs still, every time.

    This project has google play games, and Unity Ads in it. Still no idea why, any suggestions?
     
  2. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,559
    Do you have any android library included in your project called MainLibProj ? it seems to be missing the file AndroidManifest.xml (according to the error message).
     
  3. FyreDogStudios

    FyreDogStudios

    Joined:
    Aug 23, 2015
    Posts:
    97
    Yeah, It is missing the AndroidManifest.xml, do I want to copy one from elsewhere in? I'm unsure what should be in this AndroidManifest.xml file.
     
  4. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,559
    This is just a general requirement for an android library. In case you don't need to declare any activities or other components in it, you can define a pretty bare-bones one, for example, something like this:
    Code (CSharp):
    1. <?xml version="1.0" encoding="utf-8"?>
    2.  
    3. <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    4.       package="com.test.package">
    5.     <application/>
    6.  
    7. </manifest>
    I'm actually not sure about the package name part, but give that a try (or change to your own package name).
     
    FyreDogStudios likes this.
  5. FyreDogStudios

    FyreDogStudios

    Joined:
    Aug 23, 2015
    Posts:
    97
    Well, it did something

    Code (CSharp):
    1. Error: [C:\Users\Fyredog\Documents\CirclesRemake\Temp\StagingArea\android-libraries\MainLibProj\AndroidManifest.xml] Fatal error when parsing: AndroidManifest.xml
    2.  
    3. UnityEditor.HostView:OnGUI()
    4.  
    5.  
    6. Error: [C:\Users\Fyredog\Documents\CirclesRemake\Temp\StagingArea\android-libraries\MainLibProj\AndroidManifest.xml] Failed to parse XML file: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 10; The processing instruction target matching "[xX][mM][lL]" is not allowed.
    7.  
    8. UnityEditor.HostView:OnGUI()
    9.  
    10.  
    11. CommandInvokationFailure: Unable to merge android manifests. See the Console for more details.
    12. C:/Program Files/Java/jdk1.8.0_60\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="C:/Users/Fyredog/AppData/Local/Android/android-sdk\tools" -Dfile.encoding=UTF8 -jar "C:\Program Files (x86)\Unity\Editor\Data\PlaybackEngines\androidplayer/Tools\sdktools.jar" -
    13.  
    14. stderr[
    15. Error: [C:\Users\Fyredog\Documents\CirclesRemake\Temp\StagingArea\android-libraries\MainLibProj\AndroidManifest.xml] Fatal error when parsing: AndroidManifest.xml
    16. Error: [C:\Users\Fyredog\Documents\CirclesRemake\Temp\StagingArea\android-libraries\MainLibProj\AndroidManifest.xml] Failed to parse XML file: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 10; The processing instruction target matching "[xX][mM][lL]" is not allowed.
    17. ]
    18. stdout[
    19.  
    20. ]
    21. UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
    22. 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)
    23. 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)
    24. UnityEditor.HostView:OnGUI()
    25.  
    26.  
    27. Error building Player: CommandInvokationFailure: Unable to merge android manifests. See the Console for more details.
    28. C:/Program Files/Java/jdk1.8.0_60\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="C:/Users/Fyredog/AppData/Local/Android/android-sdk\tools" -Dfile.encoding=UTF8 -jar "C:\Program Files (x86)\Unity\Editor\Data\PlaybackEngines\androidplayer/Tools\sdktools.jar" -
    29.  
    30. stderr[
    31. Error: [C:\Users\Fyredog\Documents\CirclesRemake\Temp\StagingArea\android-libraries\MainLibProj\AndroidManifest.xml] Fatal error when parsing: AndroidManifest.xml
    32. Error: [C:\Users\Fyredog\Documents\CirclesRemake\Temp\StagingArea\android-libraries\MainLibProj\AndroidManifest.xml] Failed to parse XML file: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 10; The processing instruction target matching "[xX][mM][lL]" is not allowed.
    33. ]
    34. stdout[
    35.  
    36. ]
    37.  
    38.  
     
  6. FyreDogStudios

    FyreDogStudios

    Joined:
    Aug 23, 2015
    Posts:
    97
    FIX: I coppied this as the AndroidManifest that was missing

    Code (CSharp):
    1. <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    2.     package="com.google.example.games.basegameutils"
    3.     android:versionCode="1"
    4.     android:versionName="1.0" >
    5.  
    6.     <uses-sdk
    7.         android:minSdkVersion="10"
    8.         android:targetSdkVersion="19" />
    9.  
    10. </manifest>
    11.  
     
    protactinium likes this.
  7. protactinium

    protactinium

    Joined:
    Oct 14, 2015
    Posts:
    12
    so now it works?
     
    FyreDogStudios likes this.
  8. FyreDogStudios

    FyreDogStudios

    Joined:
    Aug 23, 2015
    Posts:
    97
    Yeah
     
  9. protactinium

    protactinium

    Joined:
    Oct 14, 2015
    Posts:
    12
    I will try your solution then as I have the same problem
     
    FyreDogStudios likes this.
  10. protactinium

    protactinium

    Joined:
    Oct 14, 2015
    Posts:
    12
    unfortunately it does not work for me....
     
  11. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,559
    what sort of error are you receiving ? could you please post it here ?