Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Unity 2017.3 cannot build the Android player.

Discussion in '2017.3 Beta' started by georgeq, Oct 27, 2017.

  1. georgeq

    georgeq

    Joined:
    Mar 5, 2014
    Posts:
    662
    I simply cannot build the Android player with Unity 2017.3.b3, b5 nor b6. The process end with this message in the console:


    *********************************


    CommandInvokationFailure: Failed to re-package resources.
    C:\AndroidSDK\build-tools\25.0.2\aapt.exe package --auto-add-overlay -v -f -m -J "gen" -M "AndroidManifest.xml" -S "res" -I "C:/AndroidSDK\platforms\android-23\android.jar" -F bin/resources.ap_

    stderr[
    AndroidManifest.xml:5: error: Error: String types not allowed (at 'configChanges' with value 'mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale|layoutDirection|density').

    ]
    stdout[
    Configurations:
    (default)
    v14
    v21
    ldpi-v4
    mdpi-v4
    hdpi-v4
    xhdpi-v4
    xxhdpi-v4
    xxxhdpi-v4

    Files:
    drawable\app_banner.png
    Src: (xhdpi-v4) res\drawable-xhdpi\app_banner.png
    drawable\app_icon.png
    Src: (ldpi-v4) res\drawable-ldpi\app_icon.png
    Src: (mdpi-v4) res\drawable-mdpi\app_icon.png
    Src: (hdpi-v4) res\drawable-hdpi\app_icon.png
    Src: (xhdpi-v4) res\drawable-xhdpi\app_icon.png
    Src: (xxhdpi-v4) res\drawable-xxhdpi\app_icon.png
    Src: (xxxhdpi-v4) res\drawable-xxxhdpi\app_icon.png
    values\strings.xml
    Src: () res\values\strings.xml
    values\styles.xml
    Src: () res\values\styles.xml
    Src: (v14) res\values-v14\styles.xml
    Src: (v21) res\values-v21\styles.xml
    AndroidManifest.xml
    Src: () AndroidManifest.xml

    Resource Dirs:
    Type drawable
    drawable\app_banner.png
    Src: (xhdpi-v4) res\drawable-xhdpi\app_banner.png
    drawable\app_icon.png
    Src: (ldpi-v4) res\drawable-ldpi\app_icon.png
    Src: (mdpi-v4) res\drawable-mdpi\app_icon.png
    Src: (hdpi-v4) res\drawable-hdpi\app_icon.png
    Src: (xhdpi-v4) res\drawable-xhdpi\app_icon.png
    Src: (xxhdpi-v4) res\drawable-xxhdpi\app_icon.png
    Src: (xxxhdpi-v4) res\drawable-xxxhdpi\app_icon.png
    Type values
    values\strings.xml
    Src: () res\values\strings.xml
    values\styles.xml
    Src: () res\values\styles.xml
    Src: (v14) res\values-v14\styles.xml
    Src: (v21) res\values-v21\styles.xml
    Including resources from package: C:\AndroidSDK\platforms\android-23\android.jar
    applyFileOverlay for drawable
    applyFileOverlay for layout
    applyFileOverlay for anim
    applyFileOverlay for animator
    applyFileOverlay for interpolator
    applyFileOverlay for transition
    applyFileOverlay for xml
    applyFileOverlay for raw
    applyFileOverlay for color
    applyFileOverlay for menu
    applyFileOverlay for mipmap
    Processing image: res\drawable-xhdpi\app_banner.png
    Processing image: res\drawable-ldpi\app_icon.png
    Processing image: res\drawable-mdpi\app_icon.png
    Processing image: res\drawable-hdpi\app_icon.png
    (processed image res\drawable-mdpi\app_icon.png: 99% size of source)
    Processing image: res\drawable-xhdpi\app_icon.png
    (processed image res\drawable-ldpi\app_icon.png: 99% size of source)
    Processing image: res\drawable-xxhdpi\app_icon.png
    (processed image res\drawable-hdpi\app_icon.png: 99% size of source)
    Processing image: res\drawable-xxxhdpi\app_icon.png
    (processed image res\drawable-xhdpi\app_banner.png: 93% size of source)
    (processed image res\drawable-xhdpi\app_icon.png: 98% size of source)
    (processed image res\drawable-xxhdpi\app_icon.png: 98% size of source)
    (processed image res\drawable-xxxhdpi\app_icon.png: 98% size of source)
    (new resource id app_banner from xhdpi-v4\drawable\app_banner.png #generated)
    (new resource id app_icon from ldpi-v4\drawable\app_icon.png #generated)
    (new resource id app_icon from mdpi-v4\drawable\app_icon.png #generated)
    (new resource id app_icon from hdpi-v4\drawable\app_icon.png #generated)
    (new resource id app_icon from xhdpi-v4\drawable\app_icon.png #generated)
    (new resource id app_icon from xxhdpi-v4\drawable\app_icon.png #generated)
    (new resource id app_icon from xxxhdpi-v4\drawable\app_icon.png #generated)
    ]
    exit code: 1
    UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
    UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
    UnityEditor.Android.PostProcessor.Tasks.TasksCommon.Exec (System.String command, System.String args, System.String workingdir, System.String errorMsg)
    UnityEditor.Android.PostProcessor.Tasks.BuildResources.CompileResources (UnityEditor.Android.PostProcessor.PostProcessorContext context)
    UnityEditor.Android.PostProcessor.Tasks.BuildResources.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context)
    UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)



    *********************************


    I did a little research and it seems this problem occurs when you have a plug included in your assets folder, but I do not have any, no DLL nor XML files, nothing that could cause interference. Just my scripts, models, textures, fonts and sounds, nothing else... nothing!

    However... I can build it with no problem if I open my project on version 2017.1.2f... by the way this the highest version that compiles my project, any newer version including 2017.2 throws the exception mentioned above. So I'm assuming it is a bug.

    Bug report: case 962274
     
  2. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    835
    We are aware of this issue and it will be fixed. For now make sure you have android API 24 or newer installed and selected as a target api level (if not using auto option). The problem is that aapt tool does not allow density value for the configChanges until API level 24. https://issuetracker.google.com/issues/67580651
     
  3. georgeq

    georgeq

    Joined:
    Mar 5, 2014
    Posts:
    662
    Thanks!

    Do you think this will be fixed on the final release of 2017.3?
     
  4. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    835
    Yes. As you can see in the issue ticket I've previously linked, this was an android documentation bug, so our fix will be simply to not add density value to configChanges if the selected target API is lower than 24.
    This will be fixed in 2017.3b8 and 2017.2p2. It's also coming to 2017.1 and 5.6, but I don't know the exact version numbers yet.