Android Studio 3.1.1 CreateProcess error=206, The filename or extension is too long

前端 未结 5 1779
难免孤独
难免孤独 2021-02-05 12:01

I am getting the below exception when building the app from Android Studio It says

CreateProcess error=206, The filename or extension is too long at

相关标签:
5条回答
  • 2021-02-05 12:21

    I guess you are the windows user, there is a file path limit of 8191 in Windows XP and above.

    http://support.microsoft.com/kb/830473/en-us

    The simplest way this shorten the file path, like change the project folder into D:\, and refact your project path, and always use ASCII chars for the folder name. UTF-8 chars use 2-3 bytes. or move useless dependency. or change to MAC platform. ;)

    The reason is at the compile step, there is a command like javac xxxx, combine all dependences's path in one line.

    0 讨论(0)
  • 2021-02-05 12:32

    If you are using intellij idea you can shorten command line by doing the following:

    1. go to Run/Debug Configuration
    2. pick classpath file in Shorten command line drop box. Example below.

    0 讨论(0)
  • 2021-02-05 12:35

    For me this worked.

    1. Go to Build -> Clean.
    2. File -> Invalidate Cache and Restart

    Or

    It might be due to network issue. Please check connectivity.

    0 讨论(0)
  • 2021-02-05 12:37

    In my case all I had to do was move the project folder from it's original location to the desktop. The new project location became - C:\Users\YourPCName\Desktop\YourProjectName

    0 讨论(0)
  • 2021-02-05 12:39

    Stumbled upon this recently as well. This worked for me:

    1. subst X: C:\Users$PATH_TO_YOUR_PROJECT to create a virtual mount
    2. Open cmd
      • Type gpedit.msc
      • Local Computer Policy > Computer Configuration > Administrative Templates > System > Filesystem
      • enable Win32 long paths
      • reboot
    0 讨论(0)
提交回复
热议问题