Lazarus

Programming => Operating Systems => Android => Topic started by: mpc823 on February 10, 2023, 11:02:41 am

Title: How to save project new without build error after saving
Post by: mpc823 on February 10, 2023, 11:02:41 am
I try to make a Android App (just4fun) for open my door by sending a request to a shelly uni device. So by learning with try & error , I program some code and want to try if this works fine for me.

So before I add some code and functions I save the project with the menu "Projekt -> Projekt speichern"

then I open the menu again and use the  function "Projekt -> Projekt speichern unter" , create a new folder in a new location then press save and erverything seems to be okay. But at this point I do not have make any changes inside the code but when I now try to build again the build process abort with the message
Quote
Fatal: [Exception] Failed: Cannot build project

How can I save a project with "save under ..." without the error ?

I do have a workaround for now by copying my projectfolder by hand with the explorer away, and after my testcode delete the modified folder an move the old folder back.

What I am doing wrong & sorry for my bad english ?

Thanks for help.

Martin
Title: Re: How to save project new without build error after saving
Post by: TRon on February 10, 2023, 12:57:02 pm
What I am doing wrong ...
In principle you are not doing anything wrong, you simply have a wrong expectation what the menu function "Save as.." actually entails/does.

Save as /only/ saves the project file (and it's settings) but not the units that are part of your project. If you wish to do it that way then you need to (re)save every individual unit that belongs to your project to the new location.

That is also why the compiler is unable to locate the unit, as that still resides in the old location on disk (and the compiler does not search for files in the old location, unless you specifically tell it to).

afaik you have two options:
1) use version control to safely store your current work in a repository (requires you to install/use/familiarize yourself with svn/git/mercurial/cvs/etc)
2) as a easy alternative you can use publish project, which will take all your files belonging to your project, compress them into a zip file and store the resulting zip file to a (preconfigured) publish directory.

Both methods allow for safekeeping all your files belonging to a project and in which case you do not change the location of your project. by using the menu-item save as.

If you wish to keep things /really simple/ then you can also copy your whole project directory to another location (you can use a proper file-manager for that)
Title: Re: How to save project new without build error after saving
Post by: mpc823 on February 10, 2023, 01:47:30 pm
Hello TRon,

Quote
you simply have a wrong expectation what the menu function "Save as.." actually entails/does.

You are totally right with that I misunderstood the behavior.

Thanks for making it clear to me.

Martin  :)
TinyPortal © 2005-2018