xUnique icon indicating copy to clipboard operation
xUnique copied to clipboard

KeyError: 'productName'

Open Merlini93 opened this issue 4 years ago • 3 comments

Uniquify and Sort done Uniquify and Sort Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.7/bin/xunique", line 8, in sys.exit(main()) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/xUnique.py", line 546, in main xunique.unique_project() File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/xUnique.py", line 188, in unique_project self.__unique_project(self.root_hex) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/xUnique.py", line 365, in __unique_project self.__set_to_result(project_hex, target_hex, cur_path_key) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/xUnique.py", line 141, in __set_to_result current_path = '/'.join([str(current_node[i]) for i in current_path_key]) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/xUnique.py", line 141, in current_path = '/'.join([str(current_node[i]) for i in current_path_key]) KeyError: 'productName'

Merlini93 avatar Apr 03 '20 01:04 Merlini93

it seems your project has no productName?

truebit avatar Apr 26 '20 09:04 truebit

The PBXAggregateTarget section appears to contain objects with a name and optionally a productName. If a PBXAggregateTarget object omits the productName key the error occurs, I found an example in the SwiftCoroutines project.

dnicolson avatar Jan 28 '21 12:01 dnicolson

this issue has already been mentioned in PR #49 , but this change would break the project file. Using the SwiftCoroutines project mentioned above, xunique it with the PR twice, the project file breaks. Commands below:

xunique -v SwiftCoroutines/ios/Pods/Pods.xcodeproj

truebit avatar May 18 '21 04:05 truebit