Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot Open Project the length of the project file exceeds the limit of 100 characters

I am using Android Studio 3.1 Preview and get an error when I attempt to import some projects:

Cannot Open Project The length of the project file exceeds the limit of 100 characters

This error occurs whether I am importing cloned projects from github or old projects I have saved with Eclipse. Is there a way to import these projects?

like image 513
Carlton McDonald Avatar asked Nov 08 '17 03:11

Carlton McDonald


2 Answers

In Android 3.1, if you are running up against the 100 character limit, instead of using Import project (File>New>Import Project), use File>Open, select your project, and then select the OK button.

I am not sure whether import offers some additional functionality beyond forcing you to rethink using long paths of > 100 characters. For my purposes, using the File>Open method allows the selection of projects with long paths and preserves existing directory structures.

like image 103
Eric H. Avatar answered Sep 30 '22 05:09

Eric H.


With Windows environment you could try to create a virtual driver as I'm doing. Use the subst command. For example I have the following giant path:

C:\Users\MyUser\Source\Demos\Android\ud851-exercises\Lesson02-GitHub-Repo-Search\T02.05-Exercise-CreateAsyncTask

Using the command subst E: "C:\Users\MyUser\Source\Demos\Android\ud851-exercises" I can then import into Android Studio using the virtual path

E:\Lesson02-GitHub-Repo-Search\T02.05-Exercise-CreateAsyncTask

It worked for me since I don't want to change anything in the repository's path.

like image 20
Filipe Bezerra de Sousa Avatar answered Sep 30 '22 04:09

Filipe Bezerra de Sousa