Error in func(fname, ...) : app.R did not return a shiny.appobj object.

There is no restriction for that, you just have to do it the right way, here is how to do it.

The error message suggests you have a coding problem, and without seeing your actual code, there is little we can do to help you. To help us help you, could you please prepare a reproducible example (reprex) illustrating your issue? Please have a look at these resources, to see how to create one for a shiny app