XcodeEditor icon indicating copy to clipboard operation
XcodeEditor copied to clipboard

how can i remove an existing xxx.framework(not imported from apple's libraries) from my project

Open a83988029 opened this issue 8 years ago • 4 comments

my project AAA.xcodeproj contains bbb.framework which is added to ccc.target. and i want to remove bbb.framework how can i make it

a83988029 avatar Jan 08 '16 03:01 a83988029

i tried this:

XCProject *asProject = [[XCProject alloc] initWithFilePath:@"/Users/xxx/Desktop/project/test/testXCodeConfig/AAA.xcodeproj"];
        XCTarget *aTarget = [asProject targetWithName:@"ccc"];
        XCSourceFile *file = [asProject fileWithName:@"bbb.framework"];
        NSLog(@"%d",originTarget.members.count);
        [aTarget removeMemberWithKey:file.key];
        NSLog(@"%d",aTarget.members.count);
        [asProject save];

but it didnt work.

a83988029 avatar Jan 08 '16 10:01 a83988029

1.Find your framework group 2.Use XCGroup memberWithDisplayName function 3.target removeMemberWithKey:file.key

AkameGaKill avatar Jan 17 '16 13:01 AkameGaKill

Actually, i made it a couple days after i post this issue.

But i got this issue on the very condition that i duplicate my target. So this is still a bug, when i duplicate a target and i will fail to remove a source file on the original target.

a83988029 avatar Jan 17 '16 13:01 a83988029

Yes, duplicate a target have some bug,So i remove file first, and then duplicate target.......

akame avatar Jan 17 '16 14:01 akame