2017-07-11 1 views
0

J'utilise rea-natif seulement dans target3 qui, en tant que framework appartenant à target1, contient une copie target2 par target1. puis, comment partager cible3 à la fois cible1 &. le soufflé est PODFILE erreur avec The target 'target3' is declared twice for the project 'Target3/Target3.xcodeproj'.Cocoapodes comment partager la même cible avec d'autres cibles multiples

target 'target1' do 
    use_frameworks! 

    target 'target3' do 
    use_frameworks! 

    react_native_path = 'node_modules/react-native/' 
    pod 'React', :path => react_native_path, :subspecs => [ 
    'Core', 
    'BatchedBridge', 
    ] 
    end 
end 

target 'target2' do 
    use_frameworks! 

    target 'target3' do 
    use_frameworks! 

    react_native_path = 'node_modules/react-native/' 
    pod 'React', :path => react_native_path, :subspecs => [ 
    'Core', 
    'BatchedBridge', 
    ] 
    end 
end 

Répondre

0

Impressionnant! J'ai eu l'inspiration par inadvertance quand j'ai cherché une autre question de Cocoapodes.

// with your own workspace 
workspace 'myApp.xcworkspace' 

// declare the project path you will add blew 
project 'Project1.xcodeproj' 
project 'Project2.xcodeproj' 

// abstract_target with any target name as you like 
abstract_target 'target' do 

    target 'Project1' do 
    use_frameworks! 
    project 'LessChat-iOS.xcodeproj' 
    pod 'Alamofire' 
end 

target 'Project2' do 
    use_frameworks! 
    project 'Project2.xcodeproj' 
    pod 'SwiftyJSON' 
    end 
end 

Tout ce qui précède, l'espoir peut vous aider = =

plus en détail ou d'une situation similaire voir: https://stackoverflow.com/a/43739900/5557953

grâce @Johannes Fahrenkrug