-
Notifications
You must be signed in to change notification settings - Fork 463
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix crash when adding sub project. #762
base: master
Are you sure you want to change the base?
Conversation
@dnkoutso Hi, I resubmitted my PR, everything is ok now. I'm waiting for a review. 😄 |
Clear commit history. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😄
@dnkoutso I'm waiting for a review. |
I am still trying to understand the fix and the issue. It also seems like a duplicate PR to #728. I want to ensure this is not a breaking change for anyone. |
@dnkoutso Fix the same problem in that PR. but that PR didn't work as same as |
@HDB-Li does this fix also fix this old issue CocoaPods/CocoaPods#7728? |
@dnkoutso No. |
@dnkoutso Do I need to provide a demo to describe what issue I had modified? |
@HDB-Li apologies for this taking too long. I am uncertain whether this ends up being a breaking change for folks or not. Might not be but I want to somehow verify that. Can you post screenshots of what Xcode does manually? |
@dnkoutso Hi, I've been working a lot recently, and I've been responding late. I have provided you with a set of demos. You can compare and see how the Demo : https://github.com/HDB-Li/XCodeProjDemos Look forward to your reply. |
I also provided a screenshot in demo. |
@dnkoutso Hi |
@dnkoutso Hi, Is there no reply to this question? |
Did this problem fixed? |
@dnkoutso hi |
@dnkoutso Hello, this crashing is causing a lot of issues for our mobile development team at MX Technologies. Is there any intent to fix it? If not, we will consider forking and maintaining a separate version of xcodeproj internally so we can fix the problem for our team, but would prefer not to if this can be fixed somehow. Would love to hear back. Thanks! |
hey @avetiso this PR needs a rebase and potentially an additional test? We can see if we can get it merged but its relatively old now and needs a rebase at least. |
Okay. Let me see if I can find one of our devs that are most familiar with Xcode and our build system to take a look at this, as it's not my area of expertise. |
FWIW cocoapods does offer multiple project generation for its projects so it must be getting the sub-project references right. I saw similar code in cocoapods here https://github.com/CocoaPods/CocoaPods/blob/master/lib/cocoapods/native_target_extension.rb |
@@ -180,15 +180,16 @@ def new_subproject(group, path, source_tree) | |||
ref = new_file_reference(group, path, source_tree) | |||
ref.include_in_index = nil | |||
|
|||
product_group_ref = find_products_group_ref(group, true) | |||
product_group_ref = group.project.new(PBXGroup) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does Xcode keep adding a new "Products" group for each subproject?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, Xcode does add a "Products" group for every subproject.
I'd love to see this merged! |
@dnkoutso just FYI regarding this issue, we were able to find a way to fix the linker phase with this patch. We've pulled xcodeproj internal to apply this patch anyways, but it may be that the error with adding libraries to linker phase may have simply been use misusing other xcodeproj functionality. |
Ugh... I noticed xcode crashes after adding a subproject, and my investigation took me exactly to this point. We need one 'Product' group per subproject. These groups are referenced nowhere but in the |
I once mentioned a PR, but that branch was deleted by me, so I proposed a new one.
745 PR
In the current version(1.16.0), if you add a sub project to the project, the application will be crash when running, because the sub project will be added to the original Products PBXGroup, that's why it crashed. After manually adding the sub project through analysis, Apple will create a new Products PBXGroup, and add the sub project to the newly created Products PBXGroup, so we can do the same thing as Apple.
Another small problem, the remotoInfo of PBXContainerItemProxy should be the name of the project, but now is 'Subproject'.