2017-09-03 3 views
0

は、サンプルコード、文書化cocoapods Firebaseとポッドファイルの依存関係の問題、特にFirebaseUI

func setImage(_ picid: Int32){ 

     let imagesRefs = Constants.FirebaseConfig.storageRef.child("images/thumbs/\(getuid())/thumb_\(picid).jpg"); 
     let placeholderImage = UIImage(named: "placeholder.jpg") 

     profilePicIV.sd_setImage(with: imagesRefs, placeholderImage: placeholderImage) 
} 

が、方法をsd_setImage xcodeで見つからなかったので、私は自分のpodfileをFirebaseUI/Storageのポッドで更新しなければならないと思ったが、ポッドファイルを修正した後、私はこのエラーを受け取った。

pod update 
Update all pods 
Updating local specs repositories 
    $ /usr/bin/git -C /Users/myname/.cocoapods/repos/master fetch origin --progress 
    remote: Counting objects: 18, done.   
    remote: Compressing objects: 100% (14/14), done.   
    remote: Total 18 (delta 12), reused 7 (delta 4), pack-reused 0   
    From https://github.com/CocoaPods/Specs 
    24df16553de..7cae8225fce master  -> origin/master 
    $ /usr/bin/git -C /Users/myname/.cocoapods/repos/master rev-parse --abbrev-ref HEAD 
    master 
    $ /usr/bin/git -C /Users/myname/.cocoapods/repos/master reset --hard origin/master 
    HEAD is now at 7cae8225fce [Add] MixedRealityKit 0.1.6 
Analyzing dependencies 
[!] Unable to satisfy the following requirements: 

- `TwitterCore (~> 2.8.0)` required by `Podfile` 
- `TwitterCore (>= 3.0.0)` required by `TwitterKit (3.0.0)` 
- `FirebaseUI` required by `Podfile` 

Specs satisfying the `FirebaseUI` dependency were found, but they required a higher minimum deployment target. 

私は他のポッドの組み合わせを試してみましたが、同じまたはより悪い効果にいるのに私のポッドファイルはそうのようなものです:

# Uncomment the next line to define a global platform for your project 
platform :ios, '10.3' 

# Comment the next line if you're not using Swift and don't want to use dynamic frameworks 
use_frameworks! 
    target 'StrengthStandards' do 
    #Pods for StrengthStandards 
    pod 'Firebase' 
    pod 'Firebase/Core' 
    #pod 'Firebase/Auth' 
    #pod 'FirebaseUI/Google' 
    #pod 'Firebase/Crash' 
    #pod 'Firebase/RemoteConfig' 
    pod 'FirebaseUI' 
    pod 'Firebase/Database' 
    #pod 'FirebaseUI/Database' 
    #pod 'Firebase/Storage' 
    pod 'FirebaseUI/Storage' 
    pod 'TwitterCore', '~>2.8.0' 

    target 'StrengthStandardsTests' do 
    inherit! :search_paths 
    # Pods for testing 
    end 

    target 'StrengthStandardsUITests' do 
    inherit! :search_paths 
    # Pods for testing 
    end 

end 

は私が間違って何をしているのですか?また私のxcodeは私のimport FirebaseAuthUI行にエラーNo such module 'FirebaseAuthUI'を与えます。

この問題が発生する前は、FirebaseデータベースとFirebase認証が動作しました。

私はMacOSの10.12.6

おかげ

PSに、Xcodeの8.3.3およびスウィフト3を使用しています

:いくつかの進歩を遂げて - 今、私のpodfileは次のとおりです。

# Uncomment the next line to define a global platform for your project 
platform :ios, '10.3' 

# Comment the next line if you're not using Swift and don't want to use dynamic frameworks 

    target 'StrengthStandards' do 
    use_frameworks! 
    #Pods for StrengthStandards 
    #pod 'Firebase' 
    pod 'Firebase/Core' 
    #pod 'Firebase/Auth' 
    pod 'FirebaseUI/Auth' 

    pod 'FirebaseUI/Google' 
     #pod 'FirebaseUI/Google' 
    #pod 'Firebase/Crash' 
    #pod 'Firebase/RemoteConfig' 
    #pod 'FirebaseUI' 
     pod 'Firebase/Database' 
     #pod 'FirebaseUI/Database' 
    #pod 'Firebase/Storage' 
    pod 'FirebaseUI/Storage' 
    pod 'TwitterCore', '~>2.8.0' 
    target 'StrengthStandardsTests' do 
    inherit! :search_paths 
    # Pods for testing 
    end 

    target 'StrengthStandardsUITests' do 
    inherit! :search_paths 
    # Pods for testing 
    end 

end 

とIなししかし、依存関係の問題が発生すると、xcodeはメソッド呼び出しを教えてくれます。

profilePicIV.sd_setImage(with: imagesRefs, placeholderImage: placeholderImage) 

はw rong:

答えて

0

私はそれがまさにそれが行われることになっているかどうかはわかりませんが、私は認めていますが、今は動作するようです。ここに興味がある人々のために、私がこれまで持っているものです: Podfile:

# Uncomment the next line to define a global platform for your project 
platform :ios, '10.3' 

# Comment the next line if you're not using Swift and don't want to use dynamic frameworks 

    target 'StrengthStandards' do 
    use_frameworks! 
    pod 'Firebase/Core' 
    pod 'FirebaseUI/Auth' 
    pod 'FirebaseUI/Google' 
    pod 'Firebase/Database' 
    pod 'FirebaseUI/Storage' 
    pod 'TwitterCore', '~>2.8.0' 
    pod 'SDWebImage/Core' 
    target 'StrengthStandardsTests' do 
    inherit! :search_paths 
    # Pods for testing 
    end 

    target 'StrengthStandardsUITests' do 
    inherit! :search_paths 
    # Pods for testing 
    end 

end 

、ここでは私の関数である。

import SDWebImage 
func setImage(_ picid: Int32){ 

     let imagesRefs = Constants.FirebaseConfig.storageRef.child("images/thumbs/\(Constants.getUID())/thumb_\(picid).jpg"); 

     imagesRefs.downloadURL { url, error in 
      if let error = error { 
       // Handle any errors 
       print("Error getting url for profile pic: \(error)") 
      } else { 
       // Get the download URL for 'images/stars.jpg' 
       let placeholderImage = UIImage(named: "placeholder.jpg") 
       self.profilePicIV.sd_setImage(with: url, placeholderImage: placeholderImage) 
      } 
     } 
}