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

CommandInvokationFailure for android build

Discussion in 'Android' started by bhupi, Oct 28, 2015.

  1. bhupi

    bhupi

    Joined:
    May 6, 2015
    Posts:
    11
    I am getting this error in unity 5.1.2f1 while creating android build. Code is working perfectly for unity 4.6.3


    CommandInvokationFailure: Failed to re-package resources. See the Console for details.
    /Users/compimac3/Documents/android-sdk-macosx 2/build-tools/21.1.1/aapt package --auto-add-overlay -v -f -m -J gen -M AndroidManifest.xml -S "res" -I "/Users/compimac3/Documents/android-sdk-macosx 2/platforms/android-21/android.jar" -F bin/resources.ap_ --extra-packages com.chartboost.sdk.unity:com.prime31.NAME:com.facebook.android:com.google.android.gms:com.nurdymuny.paperchasex -S "/Users/compimac3/Documents/unity/PC2/paperchase/unity/Temp/StagingArea/android-libraries/facebook/res" -S "/Users/compimac3/Documents/unity/PC2/paperchase/unity/Temp/StagingArea/android-libraries/google-play-services_lib/res" -S "/Users/compimac3/Documents/unity/PC2/paperchase/unity/Temp/StagingArea/android-libraries/unity-android-resources/res"

    stderr[
    /Users/compimac3/Documents/unity/PC2/paperchase/unity/Temp/StagingArea/android-libraries/facebook/res/drawable/com_facebook_close.png: libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
    /Users/compimac3/Documents/unity/PC2/paperchase/unity/Temp/StagingArea/android-libraries/facebook/res/drawable-ldpi/com_facebook_close.png: libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
    /Users/compimac3/Documents/unity/PC2/paperchase/unity/Temp/StagingArea/android-libraries/facebook/res/drawable-hdpi/com_facebook_close.png: libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
    /Users/compimac3/Documents/unity/PC2/paperchase/unity/Temp/StagingArea/android-libraries/facebook/res/drawable-xhdpi/com_facebook_close.png: libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
    res/drawable-xhdpi-v4/ic_plusone_medium_off_client 1.png: Invalid file name: must contain only [a-z0-9_.]
    res/drawable-xhdpi-v4/ic_plusone_small_off_client 1.png: Invalid file name: must contain only [a-z0-9_.]
    res/drawable-xhdpi-v4/ic_plusone_standard_off_client 1.png: Invalid file name: must contain only [a-z0-9_.]
    res/drawable-xhdpi-v4/ic_plusone_tall_off_client 1.png: Invalid file name: must contain only [a-z0-9_.]
    res/drawable-xhdpi-v4/powered_by_google_dark 1.png: Invalid file name: must contain only [a-z0-9_.]
    res/drawable-xhdpi-v4/powered_by_google_light 1.png: Invalid file name: must contain only [a-z0-9_.]
    res/color/common_signin_btn_text_dark 1.xml: Invalid file name: must contain only [a-z0-9_.]
    warning: string 'auth_client_needs_enabling_title' has no default translation.
    /Users/compimac3/Documents/unity/PC2/paperchase/unity/Temp/StagingArea/android-libraries/google-play-services_lib/res/values-af/auth_strings.xml:5: note: locale af found
    /Users/compimac3/Documents/unity/PC2/paperchase/unity/Temp/StagingArea/android-libraries/google-play-services_lib/res/values-am/auth_strings.xml:5: note: locale am found
    /Users/compimac3/Documents/unity/PC2/paperchase/unity/Temp/StagingArea/android-libraries/google-play-services_lib/res/values-ar/auth_strings.xml:5: note: locale ar found
    /Users/compimac3/Documents/unity/PC2/paperchase/unity/Temp/StagingArea/android-libraries/google-play-services_lib/res/values-be/auth_strings.xml:5: note: locale be found
    /Users/compimac3/Documents/unity/PC2/paperchase/unity/Temp/StagingArea/android-libraries/google-play-services_lib/res/values-bg/auth_strings.xml:5: note: locale bg found
    /Users/compimac3/Documents/unity/PC2/paperchase/unity/Temp/StagingArea/android-libraries/google-play-services_lib/res/values-ca/auth_strings.xml:5: note: locale ca found
    /Users/compimac3/Documents/unity/PC2/paperchase/unity/Temp/StagingArea/android-libraries/google-play-services_lib/res/values-cs/auth_strings.xml:5: note: locale cs found
    /Users/compimac3/Documents/unity/PC2/paperchase/unity/Temp/StagingArea/android-libraries/google-play-services_lib/res/values-da/auth_strings.xml:5: note: locale da found
    /Users/compimac3/Documents/unity/PC2/paperchase/unity/Temp/StagingArea/android-libraries/google-play-services_lib/res/values-de/auth_strings.xml:5: note: locale de found
    /Users/compimac3/Documents/unity/PC2/paperchase/unity/Temp/StagingArea/android-libraries/google-play-services_lib/res/values-el/auth_strings.xml:5: note: locale el found
    /Users/compimac3/Documents/unity/PC2/paperchase/unity/Temp/StagingArea/android-libraries/google-play-services_lib/res/values-en-rGB/auth_strings.xml:5: note:
    warning: string 'auth_client_needs_enabling_title' has no default translation.
    /Users/compimac3/Documents/unity/PC2/paperchase/unity/Temp/StagingArea/android-libraries/google-play-services_lib/res/values-af/auth_strings.xml:5: note: locale af found
    /Users/compimac3/Documents/unity/PC2/paperchase/unity/Temp/StagingArea/android-libraries/google-play-services_lib/res/values-am/auth_strings.xml:5: note: locale am found
    /Users/compimac3/Documents/unity/PC2/paperchase/unity/Temp/StagingArea/android-libraries/google-play-services_lib/res/values-ar/auth_strings.xml:5: note: locale ar found
    /Users/compimac3/Documents/unity/PC2/paperchase/unity/Temp/StagingArea/android-libraries/google-play-services_lib/res/values-be/auth_strings.xml:5: note: locale be found
    /Users/compimac3/Documents/unity/PC2/paperchase/unity/Temp/StagingArea/android-libraries/google-play-services_lib/res/values-bg/auth_strings.xml:5: note: locale bg found
    /Users/compimac3/Documents/unity/PC2/paperchase/unity/Temp/StagingArea/android-libraries/google-play-services_lib/res/values-ca/auth_strings.xml:5: note: locale ca found
    /Users/compimac3/Documents/unity/PC2/paperchase/unity/Temp/StagingArea/android-libraries/google-play-services_lib/res/values-cs/auth_strings.xml:5: note: locale cs found
    /Users/compimac3/Documents/unity/PC2/paperchase/unity/Temp/StagingArea/android-libraries/google-play-services_lib/res/values-da/auth_strings.xml:5: note: locale da found
    /Users/compimac3/Documents/unity/PC2/paperchase/unity/Temp/StagingArea/android-libraries/google-play-services_lib/res/values-de/auth_strings.xml:5: note: locale de found
    /Users/compimac3/Documents/unity/PC2/paperchase/unity/Temp/StagingArea/android-libraries/google-play-services_lib/res/values-el/auth_strings.xml:5: note: locale el found
    /Users/compimac3/Documents/unity/PC2/paperchase/unity/Temp/StagingArea/android-libraries/google-play-services_lib/res/values-en-rGB/auth_strings.xml:5: note:


    Any idea?

    Thanks
     
  2. bitter

    bitter

    Unity Technologies

    Joined:
    Jan 11, 2012
    Posts:
    530
    Sounds odd that a Unity upgrade would cause this, but from reading the log I would say the problem is you have spaces in some of your resource filenames:
    Code (csharp):
    1.  
    2. res/drawable-xhdpi-v4/ic_plusone_medium_off_client 1.png: Invalid file name: must contain only [a-z0-9_.]
    3. res/drawable-xhdpi-v4/ic_plusone_small_off_client 1.png: Invalid file name: must contain only [a-z0-9_.]
    4. res/drawable-xhdpi-v4/ic_plusone_standard_off_client 1.png: Invalid file name: must contain only [a-z0-9_.]
    5. res/drawable-xhdpi-v4/ic_plusone_tall_off_client 1.png: Invalid file name: must contain only [a-z0-9_.]
    6. res/drawable-xhdpi-v4/powered_by_google_dark 1.png: Invalid file name: must contain only [a-z0-9_.]
    7. res/drawable-xhdpi-v4/powered_by_google_light 1.png: Invalid file name: must contain only [a-z0-9_.]
    8. res/color/common_signin_btn_text_dark 1.xml: Invalid file name: must contain only [a-z0-9_.]
    9.  
     
  3. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,559
    According to the error, those files under res should have a filename made of particular letters:
    Invalid file name: must contain only [a-z0-9_.]

    e.g: only lowercase letters, digits or underscores. No spaces / upper case letters are allowed.

    I really have no idea why that has changed, maybe 5.1.2 uses a newer version of the android build tools that enforces this restriction.
     
  4. bhupi

    bhupi

    Joined:
    May 6, 2015
    Posts:
    11
    I managed to solve this by replacing whole folder from old code of unity4.