iOS native self-hosted plugin build error

Computer: Mac M3 Pro
OS: macOS Sequoia 15.4.1
Xcode version: 16.3
Solar2D build: 3720

I’m running into an issue when trying to build .a files for self-hosting a native iOS plugin. I’m unable even to build the plugin for the unmodified Project Template/App project. The Plugin and App Xcode projects build successfully in Xcode but the App/ios/build.sh script fails when I run it. It’s telling me that I didn’t run the native setup program, but I did and verified that the Native symbolic link has been created and is pointing to /Applications/Corona-3720/Native/. The following is the output I get when running build.sh:

Command line invocation:
/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -project <Projects_Root>/App/ios/Plugin.xcodeproj -configuration Release clean

ComputePackagePrebuildTargetDependencyGraph

CreateBuildRequest

SendProjectDescription

CreateBuildOperation

** CLEAN SUCCEEDED **

Command line invocation:
/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -project <Projects_Root>/App/ios/Plugin.xcodeproj -configuration Release -sdk iphoneos

Build settings from command line:
SDKROOT = iphoneos18.4

ComputePackagePrebuildTargetDependencyGraph

Prepare packages

CreateBuildRequest

SendProjectDescription

CreateBuildOperation

ComputeTargetDependencyGraph
note: Building targets in dependency order
note: Target dependency graph (1 target)
Target ‘plugin_library’ in project ‘Plugin’ (no dependencies)

GatherProvisioningInputs

CreateBuildDescription

ExecuteExternalTool /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -v -E -dM -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS18.4.sdk -x c -c /dev/null

ExecuteExternalTool /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -v -E -dM -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS18.4.sdk -x objective-c++ -c /dev/null

ExecuteExternalTool /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -V

Build description signature: c9e0a2fbe2a6253fc78cd8bd69a92212
Build description path: <Projects_Root>/App/ios/build/XCBuildData/c9e0a2fbe2a6253fc78cd8bd69a92212.xcbuilddata
CreateBuildDirectory <Projects_Root>/App/ios/build
cd <Projects_Root>/App/ios/Plugin.xcodeproj
builtin-create-build-directory <Projects_Root>/App/ios/build

ClangStatCache /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang-stat-cache /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS18.4.sdk /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/C/com.apple.DeveloperTools/16.3-16E140/Xcode/SDKStatCaches.noindex/iphoneos18.4-22E235-a09501eccf75f892bc376f81961b27ba.sdkstatcache
cd <Projects_Root>/App/ios/Plugin.xcodeproj
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang-stat-cache /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS18.4.sdk -o /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/C/com.apple.DeveloperTools/16.3-16E140/Xcode/SDKStatCaches.noindex/iphoneos18.4-22E235-a09501eccf75f892bc376f81961b27ba.sdkstatcache

CreateBuildDirectory <Projects_Root>/App/ios/build/Release-iphoneos
cd <Projects_Root>/App/ios/Plugin.xcodeproj
builtin-create-build-directory <Projects_Root>/App/ios/build/Release-iphoneos

CreateBuildDirectory <Projects_Root>/App/ios/build/EagerLinkingTBDs/Release-iphoneos
cd <Projects_Root>/App/ios/Plugin.xcodeproj
builtin-create-build-directory <Projects_Root>/App/ios/build/EagerLinkingTBDs/Release-iphoneos

WriteAuxiliaryFile <Projects_Root>/App/ios/build/Plugin.build/Release-iphoneos/Plugin-bfce2ec43813e4e137a803f5da10293c-VFS-iphoneos/all-product-headers.yaml
cd <Projects_Root>/App/ios/Plugin.xcodeproj
write-file <Projects_Root>/App/ios/build/Plugin.build/Release-iphoneos/Plugin-bfce2ec43813e4e137a803f5da10293c-VFS-iphoneos/all-product-headers.yaml

WriteAuxiliaryFile <Projects_Root>/App/ios/build/Plugin.build/Release-iphoneos/plugin_library.build/plugin_library-own-target-headers.hmap (in target ‘plugin_library’ from project ‘Plugin’)
cd <Projects_Root>/App/ios
write-file <Projects_Root>/App/ios/build/Plugin.build/Release-iphoneos/plugin_library.build/plugin_library-own-target-headers.hmap

WriteAuxiliaryFile <Projects_Root>/App/ios/build/Plugin.build/Release-iphoneos/plugin_library.build/plugin_library.DependencyMetadataFileList (in target ‘plugin_library’ from project ‘Plugin’)
cd <Projects_Root>/App/ios
write-file <Projects_Root>/App/ios/build/Plugin.build/Release-iphoneos/plugin_library.build/plugin_library.DependencyMetadataFileList

WriteAuxiliaryFile <Projects_Root>/App/ios/build/Plugin.build/Release-iphoneos/plugin_library.build/plugin_library-all-non-framework-target-headers.hmap (in target ‘plugin_library’ from project ‘Plugin’)
cd <Projects_Root>/App/ios
write-file <Projects_Root>/App/ios/build/Plugin.build/Release-iphoneos/plugin_library.build/plugin_library-all-non-framework-target-headers.hmap

WriteAuxiliaryFile <Projects_Root>/App/ios/build/Plugin.build/Release-iphoneos/plugin_library.build/plugin_library-all-target-headers.hmap (in target ‘plugin_library’ from project ‘Plugin’)
cd <Projects_Root>/App/ios
write-file <Projects_Root>/App/ios/build/Plugin.build/Release-iphoneos/plugin_library.build/plugin_library-all-target-headers.hmap

WriteAuxiliaryFile <Projects_Root>/App/ios/build/Plugin.build/Release-iphoneos/plugin_library.build/plugin_library-project-headers.hmap (in target ‘plugin_library’ from project ‘Plugin’)
cd <Projects_Root>/App/ios
write-file <Projects_Root>/App/ios/build/Plugin.build/Release-iphoneos/plugin_library.build/plugin_library-project-headers.hmap

WriteAuxiliaryFile <Projects_Root>/App/ios/build/Plugin.build/Release-iphoneos/plugin_library.build/plugin_library-generated-files.hmap (in target ‘plugin_library’ from project ‘Plugin’)
cd <Projects_Root>/App/ios
write-file <Projects_Root>/App/ios/build/Plugin.build/Release-iphoneos/plugin_library.build/plugin_library-generated-files.hmap

WriteAuxiliaryFile <Projects_Root>/App/ios/build/Plugin.build/Release-iphoneos/plugin_library.build/Script-C2E70B581EE9F110006E4570.sh (in target ‘plugin_library’ from project ‘Plugin’)
cd <Projects_Root>/App/ios
write-file <Projects_Root>/App/ios/build/Plugin.build/Release-iphoneos/plugin_library.build/Script-C2E70B581EE9F110006E4570.sh

WriteAuxiliaryFile <Projects_Root>/App/ios/build/Plugin.build/Release-iphoneos/plugin_library.build/plugin_library.hmap (in target ‘plugin_library’ from project ‘Plugin’)
cd <Projects_Root>/App/ios
write-file <Projects_Root>/App/ios/build/Plugin.build/Release-iphoneos/plugin_library.build/plugin_library.hmap

WriteAuxiliaryFile <Projects_Root>/App/ios/build/Plugin.build/Release-iphoneos/plugin_library.build/plugin_library.DependencyStaticMetadataFileList (in target ‘plugin_library’ from project ‘Plugin’)
cd <Projects_Root>/App/ios
write-file <Projects_Root>/App/ios/build/Plugin.build/Release-iphoneos/plugin_library.build/plugin_library.DependencyStaticMetadataFileList

WriteAuxiliaryFile <Projects_Root>/App/ios/build/Plugin.build/Release-iphoneos/plugin_library.build/Objects-normal/arm64/plugin_library.LinkFileList (in target ‘plugin_library’ from project ‘Plugin’)
cd <Projects_Root>/App/ios
write-file <Projects_Root>/App/ios/build/Plugin.build/Release-iphoneos/plugin_library.build/Objects-normal/arm64/plugin_library.LinkFileList

WriteAuxiliaryFile <Projects_Root>/App/ios/build/Plugin.build/Release-iphoneos/plugin_library.build/Objects-normal/arm64/af3fcb34312c57c0f52879cdce924b91-common-args.resp (in target ‘plugin_library’ from project ‘Plugin’)
cd <Projects_Root>/App/ios
write-file <Projects_Root>/App/ios/build/Plugin.build/Release-iphoneos/plugin_library.build/Objects-normal/arm64/af3fcb34312c57c0f52879cdce924b91-common-args.resp
-target arm64-apple-ios11.0 ‘-std=c++11’ ‘-stdlib=libc++’ -fpascal-strings -Os -fno-common ‘-DOBJC_OLD_DISPATCH_PROTOTYPES=0’ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS18.4.sdk -g -iquote <Projects_Root>/App/ios/build/Plugin.build/Release-iphoneos/plugin_library.build/plugin_library-generated-files.hmap -I<Projects_Root>/App/ios/build/Plugin.build/Release-iphoneos/plugin_library.build/plugin_library-own-target-headers.hmap -I<Projects_Root>/App/ios/build/Plugin.build/Release-iphoneos/plugin_library.build/plugin_library-all-target-headers.hmap -iquote <Projects_Root>/App/ios/build/Plugin.build/Release-iphoneos/plugin_library.build/plugin_library-project-headers.hmap -I<Projects_Root>/App/ios/build/Release-iphoneos/include ‘-I/var/root/Library/Application Support/Corona/Native/Corona/shared/include/Corona’ ‘-I/var/root/Library/Application Support/Corona/Native/Corona/shared/include/lua’ ‘-I/var/root/Library/Application Support/Corona/Native/Corona/ios/include/Corona’ -I<Projects_Root>/App/ios/build/Plugin.build/Release-iphoneos/plugin_library.build/DerivedSources-normal/arm64 -I<Projects_Root>/App/ios/build/Plugin.build/Release-iphoneos/plugin_library.build/DerivedSources/arm64 -I<Projects_Root>/App/ios/build/Plugin.build/Release-iphoneos/plugin_library.build/DerivedSources -F<Projects_Root>/App/ios/build/Release-iphoneos ‘-F/var/root/Library/Application Support/Corona/Native/Corona/ios/lib’ -F<Projects_Root>/App/ios/EmbeddedFrameworks ‘-DNS_BLOCK_ASSERTIONS=1’

PhaseScriptExecution Corona\ Native <Projects_Root>/App/ios/build/Plugin.build/Release-iphoneos/plugin_library.build/Script-C2E70B581EE9F110006E4570.sh (in target ‘plugin_library’ from project ‘Plugin’)
cd <Projects_Root>/App/ios
/bin/sh -c <Projects_Root>/App/ios/build/Plugin.build/Release-iphoneos/plugin_library.build/Script-C2E70B581EE9F110006E4570.sh
error: Corona Native has not been setup. Run ‘Native/SetupCoronaNative.app’ in your Corona install to set it up

<Projects_Root>/App/ios/Plugin.xcodeproj: warning: The iOS deployment target ‘IPHONEOS_DEPLOYMENT_TARGET’ is set to 11.0, but the range of supported deployment target versions is 12.0 to 18.4.99. (in target ‘plugin_library’ from project ‘Plugin’)
warning: Run script build phase ‘Corona Native’ will be run during every build because it does not specify any outputs. To address this issue, either add output dependencies to the script phase, or configure it to run in every build by unchecking “Based on dependency analysis” in the script phase. (in target ‘plugin_library’ from project ‘Plugin’)
** BUILD FAILED **

The following build commands failed:
PhaseScriptExecution Corona\ Native <Projects_Root>/App/ios/build/Plugin.build/Release-iphoneos/plugin_library.build/Script-C2E70B581EE9F110006E4570.sh (in target ‘plugin_library’ from project ‘Plugin’)
(1 failure)

Does anyone know how to fix this?

Looks like you need to run the setup Corona Native

“Corona Native has not been setup. Run ‘Native/SetupCoronaNative.app’ in your Corona install to set it up”

this is under you applications folder/Corona-37xx/Native, then click on
“Setup Corona Native”

Hi Scott,

Thanks for responding. I actually already ran Native/SetupCoronaNative.app and verified that it created the symbolic link pointing to “/Applications/Corona-3720/Native/”. But for some reason, the CORONA_ROOT environment variable isn’t getting set during the build process.