truebit / xUnique

merge Xcode project file is so easy
https://fclef.wordpress.com
Other
1.5k stars 117 forks source link

KeyError: 'productName' #54

Open Merlini93 opened 4 years ago

Merlini93 commented 4 years ago

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'

truebit commented 4 years ago

it seems your project has no productName?

dnicolson commented 3 years ago

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.

truebit commented 3 years ago

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