Xcode distribution build missing some modules

When I build my product for the simulator or for direct install from Xcode to my device, all works fine.

When I archive>distribute, the app is missing modules when it starts. "Runtime error module 'network' not found:resource (network.lu) does not exist in archive...

And then a list of al the places it looked.

Xcode 15.3 Solar2d 2024.3706 (latest) Macbook Pro M3 Sonoma 14.4.1

Programming in Lua on Solar2d "native" (includes Objective-C and Swift code)

I have had a related (I think) problem with the simulator and device builds missing other modules (all includes) -- but only after working fine for maybe a dozen builds. I then explicitly add them in, one by one. There is no way I can manually add in network, because it is built into the Solar2d environment. I am pretty sure this is an Xcode bug, not a Solar2d bug. But also likely I have a setting wrong.

  • I have made a zip of the project if you want to see what is happening. You can install but not actually use the app because the content is subscription content, but it should start without an error. The zip file is SScape3.zip. it is at ideategames.org but I cannot put the link because " is not a permitted domain on this forums" (I assume because the word game is in the title, even though almost all my apps are educational).

  • Sorry, to be more precise, you will see an access error, but not a system network error if it builds properly.

  • The problem is real, either a configuration error or an Xcode bug. I have tried different versions of Xcode (15.1 and 15.4 RC) to no effect.

    I don’t know how to resolve this.

    Again, please note the very important distinction: Everything works fine on direct Xcode->device build/install. Everything works fine on Xcode->iphone simulator. Only the archive build is leaving out the network.

Add a Comment

Replies

This was fixed by setting Dead code Stripping to no. Thanks to the Solar2d team for finding this.