Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Unity3d 4.2 Invalid Characters in Path

Discussion in 'Editor & General Support' started by SheheryarAamir, Jul 24, 2013.

  1. SheheryarAamir

    SheheryarAamir

    Joined:
    Dec 21, 2012
    Posts:
    23
    After updating to unity3d 4.2 I'm facing following error while building apk for android
    Error building Player: ArgumentException: Illegal characters in path.


    Please help

    Thanks
     
  2. SJAM

    SJAM

    Joined:
    Jan 11, 2009
    Posts:
    729
    Same Here but no problem with Unity 4.1.5 and Unity 4.2 Rc3.

    To fix that :

    Just add slash at the end of JAVA_HOME environment variable and PATH environment variable

    Works fine now

    $fixpath.jpg
     
  3. SheheryarAamir

    SheheryarAamir

    Joined:
    Dec 21, 2012
    Posts:
    23
    I did everything you said but still facing same error :(
    I'm using windows 7 x64

    My Environment Variables:

    User variables for Administrator

    JAVA_HOME = C:\Program Files\Java\jdk1.7.0_05\
    path = C:\Program Files\Java\jdk1.7.0_05\bin\

    System Variables

    PATH= C:\Program Files\Autodesk\Maya2008\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\DMIX;C:\Program Files (x86)\Microsoft SQL Server\90\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\90\Tools\binn\;C:\Program Files (x86)\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files (x86)\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies\;C:\Program Files (x86)\TortoiseSVN\bin;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\MinGW\bin;C:\MinGW\msys\1.0\bin;D:\android-sdk-windows\tools;D:\android-sdk-windows\platform-tools;C:\Program Files (x86)\Common Files\Autodesk Shared\;C:\Program Files\Common Files\Autodesk Shared\;C:\Program Files (x86)\Microsoft SQL Server\80\Tools\Binn\;C:\Program Files (x86)\Universal Extractor;C:\Program Files (x86)\Universal Extractor\bin;C:\Program Files (x86)\Autodesk\Backburner\;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Program Files\Java\jre6\bin;C:\Program Files\Java\jdk1.6.0_33\bin;C:\Program Files\Java\jdk1.7.0_05\bin\
     
    Last edited: Jul 25, 2013
  4. SJAM

    SJAM

    Joined:
    Jan 11, 2009
    Posts:
    729
    So, I don't know, sorry but if Unity 4.1.5 works fine and if it just U4.2, contact directly the support
     
  5. xpander

    xpander

    Joined:
    Oct 1, 2012
    Posts:
    28
    I have the same issue after upgrading from 4.1.5 to 4.2. Adding slashes to PATH and JAVA_HOME doesn't work. Please help.
     
  6. bitter

    bitter

    Unity Technologies

    Joined:
    Jan 11, 2012
    Posts:
    530
    Hi can one of you please file a bug on this and attach the editor log file?
     
  7. xpander

    xpander

    Joined:
    Oct 1, 2012
    Posts:
    28
    Hello, bitter.
    I've just submitted a bug through Unity Editor (Case 553810).
     
  8. shaddadjr85

    shaddadjr85

    Joined:
    Jul 28, 2012
    Posts:
    13
    I'm having the same issue. Tried the path string fix listed above with no luck.
     
  9. orrtcloud

    orrtcloud

    Joined:
    Aug 3, 2011
    Posts:
    45
    I'm also having this issue as of 4.2 update and none of the above fixes work.
     
  10. SheheryarAamir

    SheheryarAamir

    Joined:
    Dec 21, 2012
    Posts:
    23
    did anyone find any fix for this issue?
     
  11. xpander

    xpander

    Joined:
    Oct 1, 2012
    Posts:
    28
  12. aryin

    aryin

    Joined:
    Jun 17, 2013
    Posts:
    5
    doesn't work for me =( i have just downgraded it back to 4.1.5 and it's building again. Hope Unity has it fixed ASAP.
     
  13. SheheryarAamir

    SheheryarAamir

    Joined:
    Dec 21, 2012
    Posts:
    23
    doesn't work for me either
     
  14. fanjules

    fanjules

    Joined:
    Nov 9, 2011
    Posts:
    167
    I have the same problem and unable to fix with the suggestions here. Please resolve this ASAP as it has brought my development to an entire halt.
     
  15. MobBoss2

    MobBoss2

    Joined:
    Jul 31, 2013
    Posts:
    6
    Im having the same problem, I already tried all the suggested solutions and nothing.
    Please can someone help? I really need to do a deploy
     
  16. MobBoss2

    MobBoss2

    Joined:
    Jul 31, 2013
    Posts:
    6
    Any update with this?
     
  17. fanjules

    fanjules

    Joined:
    Nov 9, 2011
    Posts:
    167
    The silence is deafening from Unity. FWIW...

    1) It's fine on Mac. Obviously really, as clearly somebody has screwed up with paths in the Windows version of the editor. It reminds of a similar issue with the Windows version with 3.5 when paths had spaces in and it confused Mono Develop because Unity had not' allowed for the possibility of spaces. It took them WEEKS to resolve this simple fix. For now I am building to Android on Mac but it's not really a "solution" and anybody without a Mac is screwed.

    2) On reflection, the problem didn't actually occur when I upgraded to Unity 4.2 exactly. The issue only came to head when I upgraded to API18 of Android (4.3) by downloading the entire SDK again (the SDK Manager had issues downloading API18 as it was trying to install API 18 Revision 1 first). Trying to removing API18 and just having API17 there didn't fix it. I know the new SDK involved quite a few other updates to things beyond just API18, which were present in the downloaded ZIP. The problem is, as far as I can see Google do not allow you to download the earlier ZIP which I had which just contained API17 and it's various bits.

    Does this ring any bells with the other people suffering this problem? What API were you on when problems hit? Had you updated it recently or downloaded the latest SDK from Google's site like I did? I'm not certain how relevant the API thing is and it may just be a coincidental thing on my install. I've no doubt the problem lies with Unity though as it's clearly a way it handles the paths.

    It's a shame we can't actually see more than "Error building Player: ArgumentException: Illegal characters in path."
    ...if we could see the actual path we could see exactly what the problem is, but sadly we just get this vague message, and if Unity can't reproduce the problem it makes it hard to fix.

    It would be great to hear from Unity ASAP.
     
  18. SheheryarAamir

    SheheryarAamir

    Joined:
    Dec 21, 2012
    Posts:
    23
    last night, after downgrading my android SDK, to 22 and platform-tools to 16.0.2, I'm able to build apk for android using unity3d 4.2.


    Thanks
     
  19. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    835
    MobBoss2, fanjules and anyone else who is experiencing this

    Please specify these things:
    your Windows version
    Unity location
    Android SDK location
    Project location and to which location you are trying to build it
    Unity and Unity Android plugin license types (free / pro)

    Also please paste the contents of your system's "PATH" variable.
     
    Last edited: Aug 2, 2013
  20. Deleted User

    Deleted User

    Guest

    Windows 8 - 64bit
    C:\Program Files (x86)\Unity
    C:\Dev\SDK\AndroidSDK
    C:\Dev\Unity\Ascent
    (Building to same location)
    Unity Free

    I've been using the Android SDK to get it building to Ouya, which it was doing fine until I updated to android 4.2.
    The annoying thing is, as others have pointed out, is that we're given a very vague error "Error building Player: ArgumentException: Illegal characters in path." to which I can't even start looking on where to fix it.
     
  21. fanjules

    fanjules

    Joined:
    Nov 9, 2011
    Posts:
    167
    Windows 7 - 64bit
    C:\Program Files (x86)\Unity
    C:\Android\sdk
    C:\Work\Projects\UnityLearning\024_android_build_problem
    Building to: C:\Work\Projects\UnityLearning\024_android_build_problem\_BUILDS\Android

    Licenses: Unity Pro, Android Pro, iOS Pro

    System Path:

    C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\PROGRA~2\Borland\Delphi5\Projects\Bpl;C:\PROGRA~2\Borland\Delphi5\Bin;C:\Program Files (x86)\Java\jre7\bin;C:\Program Files\Java\jdk1.7.0_25\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files\WIDCOMM\Bluetooth Software\;C:\Program Files\WIDCOMM\Bluetooth Software\syswow64;
     
  22. fanjules

    fanjules

    Joined:
    Nov 9, 2011
    Posts:
    167
    @JuliusM
    ...just to confirm, are you a Unity engineer? Would be good to know this is being looked into!
     
  23. oye_beto

    oye_beto

    Joined:
    Jul 4, 2013
    Posts:
    1
    Here's my data.

    Windows version:
    Windows 7 home premium

    Unity location:
    C:\Program Files (x86)\Unity

    Android SDK location:
    C:\Program Files (x86)\Android\sdk

    Project location and to which location you are trying to build it:
    C:\Users\Public\Documents\Unity Projects\MecanimTute

    Unity and Unity Android plugin license types (free / pro):
    Free licenses

    Path variable:
    C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files\WIDCOMM\Bluetooth Software\;C:\Program Files\WIDCOMM\Bluetooth Software\syswow64;C:\Program Files\Broadcom\WHL\;C:\Program Files\Broadcom\WHL\syswow64;C:\Program Files\Broadcom\WHL\SysWow64\;C:\Program Files\Broadcom\WHL\SysWow64\syswow64;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files (x86)\Sony\VAIO Startup Setting Tool;C:\Program Files (x86)\Windows Live\Shared;c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files (x86)\GtkSharp\2.12\bin;C:\Program Files (x86)\QuickTime\QTSystem\
     
  24. fanjules

    fanjules

    Joined:
    Nov 9, 2011
    Posts:
    167
    Any news?

    Are we doomed to a crippled version of Unity or will this be fixed in the next release?
     
  25. Deleted User

    Deleted User

    Guest

    Hey all involved, I just wanted to update on my personal issue with this.
    A week ago I had a problem just like the rest of you, where I was unable to build an apk - Today when I tried to build it again (and run it straight on Ouya) it worked - without any errors popping up.

    I can only assume this now works because of the slash I added at the end of the two java variables under the environment variable properties (As suggested on the first page) - Only I didn't notice at the time because (perhaps) I needed to restart my system first.
    That was the only change/fix I did - so other than Unity silently updating itself (Not sure if it does that) I can only assume that was the problem.

    I wish you all the best of luck with getting your issues fixed - something like this certainly can halt development/testing time.
     
  26. fanjules

    fanjules

    Joined:
    Nov 9, 2011
    Posts:
    167
    This doesn't work for me, even with the restart. Could you possibly post your system data, so we can see if theres anything different that we can spot with a working system?
     
  27. Deleted User

    Deleted User

    Guest

    Windows version - Windows 8 64-bit
    Unity location - C:\Program Files (x86)\Unity
    Android SDK location - C:\Dev\SDK\AndroidSDK
    Project location and to which location you are trying to build it - C:\Dev\Unity\Ascent
    Unity and Unity Android plugin license type - Free
    Android API being built to - Android 4.1 'Jelly Bean', API Level 16

    Related user environment variables -
     
  28. WaterWhat

    WaterWhat

    Joined:
    Aug 12, 2013
    Posts:
    2
    I have the same problem after I upgraded from 4.1.5 to 4.2.0. Hope Unity staff can fix this bug ASAP
    My system info:

    Win8 64bit
    Android SDK:
    C:\Downloads\adt-bundle-windows-x86-20130729
    Java SDK:
    C:\Program Files (x86)\Java\jdk1.7.0_25
    Unity:
    C:\Program Files (x86)\Unity
     
  29. fanjules

    fanjules

    Joined:
    Nov 9, 2011
    Posts:
    167
    I noticed you had user variables instead of the paths to JAVA in the system variables path field. So I removed my entries from there, added them to the user variables as you have done and... nothing. Still the same.

    For the benefit of Unity3d devs who actually care, the actual message returned by Unity is the following (the topic of this forum post is slightly incorrect):

    "Error building Player: ArgumentException: Illegal characters in path."

    It would be nice just to hear from Unity on this. I've sent a support e-mail, opened a bug report, somebody else had opened a bug report earlier and nothing. I've now wasted another morning on this. Will it be fixed in the next release or not?
     
  30. WaterWhat

    WaterWhat

    Joined:
    Aug 12, 2013
    Posts:
    2
    Will the Unity Gods do something about this?
     
  31. Aurore

    Aurore

    Director of Real-Time Learning

    Joined:
    Aug 1, 2012
    Posts:
    3,106
    The bug xpander filed has been assigned to a dev after a series of e-mails between QA and xpander to try and get to the root of the issue
     
  32. aryin

    aryin

    Joined:
    Jun 17, 2013
    Posts:
    5
    hope this issue will be solved asap, i've tried everything but no luck, it's a PAIN
     
  33. shaddadjr85

    shaddadjr85

    Joined:
    Jul 28, 2012
    Posts:
    13
    I just tried the new Unity 4.2.1 and still getting the same error. :( has anyone found a way around this? Months of being unable to build for Android is painful.
     
  34. badc0de

    badc0de

    Joined:
    Aug 9, 2012
    Posts:
    3
    This post by nekete fixed it for me (previously all I could do was downgrade to Unity 4.1).
     
  35. fanjules

    fanjules

    Joined:
    Nov 9, 2011
    Posts:
    167
    I am going to repost badc0de's link as it appears he can't post them due to being a new forum user:

    http://forum.unity3d.com/threads/93...d-to-Android?p=1344914&viewfull=1#post1344914

    The problem seems to be at least partly related to SDK R22, but it still seems Unity isn't handling something correct there. Use R21 and it's fine, though I couldn't find the link anywhere on Google's site, only in the above forum post. I also install API 17 (from R21 I couldn't get API18 to install properly - and googling seemed to suggest installing the latest SDK, and of course R22 doesn't work).

    I hope Unity can allow for whatever has changed in the R22 SDK, because at the moment I presume that anybody new coming to Unity cannot build to Android on a Windows machine.
     
  36. Chris-Clark

    Chris-Clark

    Joined:
    Jan 16, 2012
    Posts:
    130
    Remove any environment variables that look like: _JAVA_OPTIONS -Xms512m

    I may finally have a solution for those who still can't fix it.

    I tried everything else mentioned that worked for others, but nothing ever fixed it. I removed that environment variable above and it finally fixed building with SDK R22.
     
  37. fanjules

    fanjules

    Joined:
    Nov 9, 2011
    Posts:
    167
    I think I'm not alone having kept with SDK21 for a while now... we all had so much trouble with this few of us would want to experiment further having got it to work.

    However, I recently had a need to upgrade to the latest SDK due to requirements of an Asset Store purchase.

    I can confirm Chris Clark's solution above worked and I am now able to compile with the latest Android SDK. :)
     
  38. Oniony

    Oniony

    Joined:
    Aug 15, 2013
    Posts:
    31
    Just want to confirm, this solution also worked for me.
     
  39. janoonk

    janoonk

    Joined:
    Dec 3, 2008
    Posts:
    79
    I can also confirm that this worked for me also!
    Thanks!
     
  40. OKR

    OKR

    Joined:
    Mar 23, 2014
    Posts:
    1
    Thank you for the tip, removing _JAVA_OPTIONS -Xms512m variable fixed my problem too (4.3.4 build here).
    I am not sure but if I remember, I added this variable to fix a build issue with eclipse + android plugin past projects.
     
  41. zRedCode

    zRedCode

    Joined:
    Nov 11, 2013
    Posts:
    131
    Tried all suggested in this topic, nothing works... unity free. Windows 7 64bits, JDK 64Bit, JAVA_HOME C:\Program Files\Java\jdk1.8.0\
    SDK location: C:\Users\Samuele\AppData\Local\Android\android-sdk
    Any suggestion? tryng building for android 4.1.1 ARMV7
     
  42. matfrem

    matfrem

    Joined:
    Apr 17, 2012
    Posts:
    3
    Remove "_JAVA_OPTIONS" from environment variables.
    In my case i put "_JAVA_OPTIONS" a long time ago to get Minecraft running :)

    thanks to this guy:
    http://www.tallior.com/2014/02/08/b...-argumentexception-when-building-for-android/
     
  43. zRedCode

    zRedCode

    Joined:
    Nov 11, 2013
    Posts:
    131
    Already tried this. (Used to run minecraft... ;) )
     
  44. Spy-Shifty

    Spy-Shifty

    Joined:
    May 5, 2011
    Posts:
    546
    Last edited: Apr 9, 2014
  45. zRedCode

    zRedCode

    Joined:
    Nov 11, 2013
    Posts:
    131
    Deleted SDK and installed api levels 14, works, finally! (i have jdk 64bits, and i not have problems)
     
  46. ruininglin

    ruininglin

    Joined:
    May 12, 2014
    Posts:
    1
    I can also confirm that this worked for me!
    Thank you very much!!!
     
    Last edited: May 12, 2014
  47. stummark

    stummark

    Joined:
    Nov 5, 2014
    Posts:
    4
    Hi, I am trying to build for windows universal apps and am getting //error building player argumentexception illegal characters in path//