Invalid library found

Hello Yesterdey I bought my first arduino with the book and the whole kit. I started with the spaceship project but had a problem with uploading (I guess) Selected the right model (Genuino uno) and the right port. when it comes to upload I keep receiving the same message Invalid library found in /Users/ and so on. I've been looking on forums but didn't find anything that solve the problem I tried to upload both from my imac and macbook (last os x version) Even with resetting button nothing changed As last I tested the connection in firmware/Certificate Updater and the message was: Programmer not responding

It might be something that I forgot, or a stupid error. It is my first approach after all.. but it's very frustrating

someone can help? thank you

totokkor:
Invalid library found in /Users/ and so on.

Welcome to the forum. Here’s a little hint: If you actually want to get any help here you have to provide us with real information, not some paraphrased fragment of a warning message.

At the top of every forum section there’s this helpful little thing one of the admins wrote: How to use this forum - please read. Read it, read every word, understand every word, remember every word, it’s for your own good.

When you encounter an error you should see a button on the right side of the orange bar “Copy error message”. Click that button then paste the error in a message here using code tags(</> button on the toolbar).

Hello Pert thank you very much for your answer and for your suggestions here the complete message I get

Sketch uses 1,220 bytes (3%) of program storage space. Maximum is 32,256 bytes. Global variables use 11 bytes (0%) of dynamic memory, leaving 2,037 bytes for local variables. Maximum is 2,048 bytes. Invalid library found in /Users/totokkor/Documents/Arduino/libraries/spaceship: /Users/totokkor/Documents/Arduino/libraries/spaceship

I couldn't find any 'Copy error message' button though (Doesn't look like a code error)

Hope this is a more accurate information

/Users/totokkor/Documents/Arduino/libraries/spaceship is not a valid library. All the folders inside of /Users/totokkor/Documents/Arduino/libraries must be valid libraries and must be installed directly under that folder. For example the folder structure:

totokkor |_Documents |_Arduino |_libraries |_MyLibraries |_MyLibrary1 |_MyLibrary2

is not allowed. You would need to change it to:

totokkor |_Documents |_Arduino |_libraries |_MyLibrary1 |_MyLibrary2

So if there is a library inside of the spaceship folder you need to move it directly under the libraries folder. If the spaceship folder doesn't contain any libraries then you need to move it out of the libraries folder. If the spaceship folder contains a sketch(spaceship.ino) then you should move it to your sketchbook folder, /Users/totokkor/Documents/Arduino.

The invalid library thing should only be a warning, it should not be preventing you from uploading. If there is another problem other than the invalid library thing I might be able to help you but I need more information on what problem you're having. The output:

Sketch uses 1,220 bytes (3%) of program storage space. Maximum is 32,256 bytes.
Global variables use 11 bytes (0%) of dynamic memory, leaving 2,037 bytes for local variables. Maximum is 2,048 bytes.

Tells me that your program successfully compiled so it is valid code.

Thank you again Pert I deleted the spaceship folder after moving the library file back in the libraries folder

When i tried to upload i got the following message: The file "spaceship.ino" needs to be inside a sketch folder named "spaceship". Create this folder, move the file, and continue?

Is that strange?

totokkor: I deleted the spaceship folder after moving the library file back in the libraries folder

Which file did you move?

totokkor: When i tried to upload i got the following message: The file "spaceship.ino" needs to be inside a sketch folder named "spaceship". Create this folder, move the file, and continue?

Is that strange?

No, that's just how the Arduino IDE works. Sketches always need to be inside of a folder with the same name. If you click "OK" on that dialog it will do this for you. The only time this could cause a problem is if you have multiple sketch files in the same folder that are all necessary for the project, like spaceship.ino, spaceship.h, spaceship.c. The Arduino IDE will only move spaceship.ino to the new folder so if that's the case you have to do it manually.

I moved the file spaceship.ino from the folder named spaceship to the folder libraries. From what you write next I assume wasn't the right move as the library file needs to be in a folder with the same name.

I thought library files have to be directly in the libraries folder: totokkor

|_Documents |_Arduino |_libraries |_MyLibrary1 |_MyLibrary2

I am a bit confused now

Two misunderstandings here:

spaceship.ino is not a library, it's a sketch. You need to understand the difference between the two. Sketches are the programs you write in the Arduino IDE and upload to your Arduino. Libraries are collections of code that you can access from any sketch, kind of like super powers for your programs. You can store your sketches anywhere on your computer except in the /Users/totokkor/Documents/Arduino/libraries folder(actually there are a couple of other libraries folders in other locations but don't worry about that). It's convenient to store your sketches in the sketchbook folder, /Users/totokkor/Documents/ because then you can easily access them in the File > Sketchbook menu. As I said previously, sketches have to be inside of a folder with the same name.

In the folder structure above MyLibrary1 and MyLibrary2 are folders, not files. The library folder has to be directly under the libraries folder but libraries will almost always have multiple files, these files are all stored inside of the library folder so when we talk about a library we actually mean a folder of files, not a single file.

So I'm guessing what you had was this:

totokkor |_Documents |_Arduino |_libraries |_spaceship |_spaceship.ino

This was causing the invalid library warning because spaceship is a sketch, not a library. You misunderstood my instructions and did this:

totokkor |_Documents |_Arduino |_libraries |_spaceship.ino

but the correct thing to do would have been this:

totokkor |_Documents |_Arduino |_libraries |_spaceship |_spaceship.ino

when you clicked "OK" the Arduino IDE created the spaceship folder and put spaceship.ino in it so now you're right back where you started:

totokkor |_Documents |_Arduino |_libraries |_spaceship |_spaceship.ino

So just move the spaceship folder to /Users/totokkor/Documents/Arduino and don't put any more sketches in your libraries folder and that issue is solved.

After that if you are having a different issue let me know and I'll try to help you with that one too.

That's so kind that you take all this time after people troubles :) thank you very much, I actually misunderstand the difference between libraries and sketches I did as you wrote and now that message doesn't come up anymore.. solved! Now the circuit doesn't work anyway though, but i will spend a moment on it before to ask thank you Pert