QField error msg: "The following layers could not be loaded, please review those and reconfigure the QGIS project."

This doesn’t seem to have been resolved. I packaged the project using the QField plugin in QGIS and got this error message:

Layer “DMJ contacts”

The layer is not configured with neither cable, nor cloud action yet. Default action will be selected only for this time. Please select and save appropriate layer action in “Layer Properties → QField”.

That is not true. This is what is in the QField tab for Layer Properties:

This is exactly the same as the other layers that the plugin didn’t complain about.

If I close down the plugin and restart it to package the project, this error message goes away.

BUT, when I copy the packaged project folder across to my tablet and open the project in QField, I get this error message:

The following layers could not be loaded, please review those and reconfigure the QGIS project.

DMJ contacts

../../../Documents/DMJ contacts.shp

That folder name is NOT where I had the shapefile stored. There is no “Documents” in that path. That is NOT where I opened the shapefile layer from in QGIS when I created the project. Somehow or other, I’m ending up with an incorrect path to one of my layers being stored in the project. And that is upsetting QField, of course.

Now, I went ahead and removed the layer from my project, added it back and saved the project, then packaged it again for QField.

Same issue.

Deleted the project and started again from scratch. Deleted the offending shapefile and created it again from scratch. Rebuilt the whole thing. Then I tried to package it and got a bunch of these errors:

The layer is not configured with neither cable, nor cloud action yet. Default action will be selected only for this time. Please select and save appropriate layer action in “Layer Properties → QField”.

I went into the Properties for all of the layers it was complaining about and in every case the QField packaging action was set to Offline editing, and the Cable packaging action was set to Copy. All correct.

Went back to the QField packaging plugin and got the error message above about a raster layer. Checked its properties:

QFieldCloud packaging action: Directly access data source

Cable packaging action: Copy

This is correct, right?

Went back into the packaging plugin and got no error messages this time, despite the fact that I had changed nothing.

Created a new packaged project and copied it across to the tablet. Opened it and got the same error message as before about the “DMJ contacts.shp” layer not loading into QField.

What the heck? This shapefile is sitting in the same folder as all of the others. Nothing about it is different. Why is QField not seeing it?

Suspecting that there could be some kind of issue going on with syncing between the OneDrive cloud and my PC, I moved the whole folder with this project onto my hard drive. Same issue with that shapefile.

By the way, all of the paths in the project are RELATIVE in the settings.

In desperation, I deleted the shapefile “DMJ contacts.shp” and made a new one called “contacts.shp” with the same structure and loaded it as a layer in the project. Ran the plugin to package the project and got the same bunch of error messages as before about the packaging actions. Ignored them and went ahead to package the project.

This time, the project loaded in QField just fine. No issue with any of the layers the plugin complained about. No issues with the new “contacts.shp” layer.

Hallelujah.

Why is the packaging plugin getting confused about a layer simply because of its name? When I created a new layer from a shapefile that sat in the same folder and just had a different name and added it to the project, it loaded without problems. Removing the “DMJ contacts.shp” layer, deleting the shapefile, creating it again with the same name, adding it as a layer and saving the project before packaging it and importing the project into QField resulted in a failure to load the layer. This doesn’t make any sense.

Is QField having problems because I have layer names with spaces in them?

Hi @davidziongeophysics - one thing. It is not recommended to work with shp files. I would recommend you to transfer the file to a gpkg instead.

Furthermore, by what I could see is that you had a SPACE between ‘DMJ and ‘contacts’. I am not saying that this is the reason but the fact that you were able to load the project afterward suggests that it could have something to do with it.

Good feedback. Thanks.