"PRODUCT_NAME was misdefined
hrabkin opened this issue · 17 comments
"PRODUCT_NAME was misdefined: MySDK
. Please, provide :product_name option"
Error
Hi @GRyabkin,
could you please provide your project, including the fastlane setup, e.g. in form of a zip?
Thanks
@bielikb I don't think it's required. The error I receive happens inside fastlane action. I duplicated my issue in their repository
I have set Product name in build settings, here's my fastlane config:
desc "Export xcframework"
lane :export_xcframework do
create_xcframework(
workspace: 'MySDK.xcworkspace',
scheme: 'MySDK',
include_bitcode: false,
destinations: ['iOS'],
product_name: "MySDK",
xcframework_output_directory: 'artifacts/MySDK'
)
end
Ohh, this action builds my xcframework
in a folder where the action invoked ignoring xcframework_output_directory
. That's bad
Im owner of both repos, thanks for bringing your issue up. To proceed further I might need to know a little more about your setup.
You can try out the running example right on this repo.
Here's the lane that creates the xcframework and exports it in the dedicated export folder
@bielikb sorry, I can't send you my setup, but I can give you answers to questions if you have them. It's cool that the action works for some basic case
I have my Bundle name set as $(PRODUCT_NAME) maybe hardcoding this param helps but it's strange that it's not taken into account.
Is it hard to reproduce your setup in form of a dummy project?
In terms of details, let's step back.
- What version of the fastlane plugin are you currently using?
- What version of Xcode IDE are you using?
- Is the target name that builds your dynamic framework the same as the "product name"?
- Have you tried to not include the product_name parameter in your lane?
- Does the fastlane plugin run fine from the terminal?
- Could you share the dump of the logs/any additional useful info?
Additionally you're welcome to adjust the functionality of the open sourced plugin, in that case, please follow the contribution guideline
@bielikb yes, this is a production setup which has many third-party-dependencies, also I have signed NDA.
- 2.160.0
- Version 12.0 (12A7209)
- Yes
- Yes (the same error)
- I run it from the terminal always
- The end looks like this (names are removed):
[20:35:17]: --------------------------------
[20:35:17]: --- Step: create_xcframework ---
[20:35:17]: --------------------------------
[20:35:17]: Overwriting SKIP_INSTALL and BUILD_LIBRARY_FOR_DISTRIBUTION options
[20:35:17]: For a more detailed xcodebuild log open /Users/mypc/Library/Logs/fastlane/xcbuild/2020-11-02/70589/xcodebuild.log
[20:35:17]: $ set -o pipefail && xcodebuild -workspace "MySDK.xcworkspace" -scheme "MySDK" SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES -destination "generic/platform=iOS" -archivePath "0_MySDK.xcarchive" archive | tee '/Users/mypc/Library/Logs/fastlane/xcbuild/2020-11-02/70589/xcodebuild.log' | xcpretty --color --simple
...
[20:40:10]: ▸ Archive Succeeded
[20:40:10]: For a more detailed xcodebuild log open /Users/mypc/Library/Logs/fastlane/xcbuild/2020-11-02/70589/xcodebuild.log
[20:40:10]: $ set -o pipefail && xcodebuild -workspace "MySDK.xcworkspace" -scheme "MySDK" SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES -destination "generic/platform=iOS Simulator" -archivePath "1_MySDK.xcarchive" archive | tee '/Users/mypc/Library/Logs/fastlane/xcbuild/2020-11-02/70589/xcodebuild.log' | xcpretty --color --simple
....
[20:45:21]: ▸ Archive Succeeded
+------------------------------+------------------------+
| Lane Context |
+------------------------------+------------------------+
| DEFAULT_PLATFORM | ios |
| PLATFORM_NAME | ios |
| LANE_NAME | ios export_xcframework |
| XCODEBUILD_DERIVED_DATA_PATH | |
| XCODEBUILD_ARCHIVE | 1_MySDK.xcarchive |
+------------------------------+------------------------+
[20:45:21]: ▸ PRODUCT_NAME was misdefined: `MySDK`. Please, provide :product_name option
+------+-------------------------------------+-------------+
| fastlane summary |
+------+-------------------------------------+-------------+
| Step | Action | Time (in s) |
+------+-------------------------------------+-------------+
| 1 | Verifying fastlane version | 0 |
| 2 | default_platform | 0 |
| 3 | update_fastlane | 0 |
| 4 | Switch to ios preconditions lane | 0 |
| 5 | cocoapods | 22 |
| 6 | (cd ../../custom && ./custom_script.sh) | 8 |
| 💥 | create_xcframework | 603 |
+------+-------------------------------------+-------------+
[20:45:21]: fastlane finished with errors
[!] ▸ PRODUCT_NAME was misdefined: `MySDK`. Please, provide :product_name option
@bielikb also looks like -archivePath
for xcodebuild
command doesn't have xcframework_output_directory
appended
@bielikb the error was generated by line 28 in the following file
@bielikb I would like to contribute. Do you happen to share some guides on how to test the action without deploying to the Fastlane repository?
@bielikb today I had more time to test out your sample and compare the build settings of your sample and my framework. Well, I have figured out what was the cause of the problem. Installation directory
of the framework I build was set to /Applications
but in your sample $(LOCAL_LIBRARY_DIR)/Frameworks
. This path used by xcodebuild create_xcframework
to search for resulting binaries for combining.
I am happy I have resolved the issue, I should start to investigate your sample before digging into your code. Sorry, I did it in the late evening.
Also, your script has a small issue: it places xcarchives
at building time in the root project directory
instead of output directory
, and when the script succeeds copies them but if it fails they are left in the root directory.
@GRyabkin Grand! Happy to hear your issue got resolved.
Ill cover the issue around xcarchives in one of the following releases ;)