Can't find module iOS Native build

I have had this problem off and on with every Native build app. Things are going well, and then suddenly the build cannot find one of my require lua files – my own files in the Corona directory. It is usually the first of my require files, but if I skip it, it might load 1 or 2 others and then find another that it cannot find – all in the same directory.

I try adding the file to the project, no effect. Clean Build Folder, no effect.

I have not found a way to break this, I usually end up starting over from the template. There must be some setting I am accidentally touching? I really have no idea, but it must be simple. But frustrating.

ERROR: Runtime error
module ‘app_vars’ not found:resource (app_vars.lu) does not exist in archive
no field package.preload[‘app_vars’]
no file ‘/private/var/containers/Bundle/Application/A7AD611E-B44C-4FB9-A6AA-0F3FEB88AA68/SoundScape.app/corona-plugins/app_vars.lua’
no file ‘/private/var/containers/Bundle/Application/A7AD611E-B44C-4FB9-A6AA-0F3FEB88AA68/SoundScape.app/app_vars.lua’
no file ‘/private/var/containers/Bundle/Application/A7AD611E-B44C-4FB9-A6AA-0F3FEB88AA68/SoundScape.app/app_vars.lua’
no file ‘/private/var/containers/Bundle/Application/A7AD611E-B44C-4FB9-A6AA-0F3FEB88AA68/SoundScape.app/corona-plugins/app_vars.so’
no file ‘./app_vars.so’
no file '/private/var/containers/Bundle/Application/A7AD611E-B44C-4FB9-A6AA-0F3FEB88AA68/SoundScape.app/app_vars.so’app_varsluaopen_app_vars
stack traceback:
[C]: in function ‘require’
?: in function ‘require’
/Users/Shared/Mobile/SScapeN/ios/…/Corona/main.lua:56: in main chunk

But I still cannot solve the can’t find module problem. I have rebuilt from scratch the project several times, and cannot get it to go away.

I managed to fix it, but I still don’t understand what happened. I added each file that it could not find, and then inspected the file to be sure the “Target membership” button was selected. It always was, but I noted that if I don’t check, then it doesn’t find the file, so checking must force something. Of my ‘require’ files, about half needed this prompt. For some odd reason, the other files were included without being prompted.

I guess that is success, but kind of random and unexplained.