Failed to import project [SOLVED]

photon
Tags: #<Tag:0x00007f1c9e5bf880>

#1

I’m starting with Particle Workbench and I want to import an existing project but all I can get from the VS Code is an error message: Failed to import project and the source is: Workbench Core (Extension).

When I check the logs messages this is the output:

Directory `./lib` exists! cannot install libraries.

Error: Directory `./lib` exists! cannot install libraries.

at throwIfTrue (C:\Users\AIOTIK-005\.vscode\extensions\particle.particle-vscode-core-1.4.4\src\cli\index.js:251:9)

at _checkCanInstallLibraries.directoryExists.then (C:\Users\AIOTIK-005\.vscode\extensions\particle.particle-vscode-core-1.4.4\src\cli\index.js:90:75)

- - - -

I also tried opening the existing project into VS Code but I am getting the same results, this is my directory:

$ ls
.vscode/  lib/  project.properties  README.md  src/  target/

Is there something that I’m missing right now? Is there other procedure that I need to follow?

Any comment will be helpful, thanks!


#2

Can you elaborate how exactly you are importing the project and from where and where to?


#3

Well what I did was to:

  1. open VS Code without any workspace opened
  2. go to the Particle Workbench tool
  3. open the Command Palette and look for Particle: Import Project
  4. go to my project directory in this location C:\Users\user_ID\embedded_systems\particle\photon\project_directory_here
  5. Look for the project.properties project
  6. Click to open project.properties

And this is where I am getting this Failed to Import Project error.

,


#4

If the directory you are importing already has a lib folder you’ll get this error. Rename the lib folder to say “lib-old” and see if it will import.

Also, make sure you are logged into your particle account.

I was experiencing this when I was setting up my Github repositories.

Might be something different though…


#5

Hey! That was the problem!

I rename the file like you suggest and the project was able to be imported succesfully! That file was created because I cloned a repo with that file too, looks like for future usage, we should ignore the lib folder created to make easier for developers to reproduce easily a selected repository.

And yes I also verified that I was logged with my particle account. :slight_smile:


#6

@kenco Great advise. I too observed the same “import project” error as @fabocode. In addition to temporarily renaming the existing LIB folder of the project being imported, I also had to temporally delete the library file reference in the project.properties folder of the project being imported. Now Workbench is able to import and compile the imported code.


#7

After recently reading multiple reports of that, I think that this might be a “new” task for @m_m :wink: