I set up multiple environments for my app by creating multiple configurations, with multiple schemes for each configuration (Article Describes in more detail my set up). Therefore I only have to have one target. This works fine for the actual app itself but I'm having trouble doing the same setup within an app widget extension. The production scheme works fine but when trying to build the dev side scheme I'm receiving this error.
/Users/ss/Library/Developer/Xcode/DerivedData/appName-hdbxzenesdshvnfgnywdjhuifcbu/Build/Products/Debug Development-iphoneos/AppNameWidgetExtension.appex error build: : No such file or directory
When I look through the derived data I can see the dev versions .appex. AppNameWidgetExtension-dev.appex
but it seems to be looking for the none dev versions .appex. I would like to be able to continue to use one app target and one extension target but not sure how to get the dev widget extension to refer to the correct .appex file.
I noticed that embedded foundation extensions within the app target only referes to the dubug Production .appex. How could I change this .appex based on current scheme? Screen shot below
Scheme setup (The same setup as article I've attached)
Ive seen similar problems here but most are referring to having multiple targets and id much rather keep my current environment only using one target for multiple configurations.
Update:
So I think my issue was renaming the product name in packaging (within the build settings of app target) which would change the product module name too. Instead, I put it back to $(TARGET_NAME)
. I was changing the product module name to change the app display name on phone so instead I added Bundle Display name
key and set the value to $(APP_NAME)
(app name is from config files) to app targets plist. I also moved all my configuration settings into config files and added config files to project configurations. I used this tutorial to help me set up my project with xcconfig files.