2017-07-11 17 views
0

私はtarget3にのみ反応ネイティブを使用します。これは、フレームワークがtarget1に属しているので、target1によってtarget2のコピーがあります。次に、target1を両方のtarget1に共有する方法& target2。 PodfileがThe target 'target3' is declared twice for the project 'Target3/Target3.xcodeproj'.Cocoapods他の複数のターゲットと同じターゲットを共有する方法

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 

答えて

0

素晴らしいとエラーになります!吹きました別のCocoapodsの質問を検索すると、私は誤ってインスピレーションを受けました。 https://stackoverflow.com/a/43739900/5557953

おかげ@Johannes Fahrenkrug

:上記のすべての

// 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 

は、

詳細や似状況がを参照してください= =それはあなたを助けることを願って

関連する問題