【问题标题】:Alamofire does not work on Mobile after archive created swift 3 xcode 8归档创建 swift 3 xcode 8 后,Alamofire 无法在移动设备上运行
【发布时间】:2018-04-06 13:15:00
【问题描述】:

我在 XCode 8 上使用 Alamofire 4.5

当我在模拟器上工作时,alamofire 工作正常,当我通过电缆将我的设备连接到 xcode 时,它​​再次工作正常。

当我创建该特定构建的存档并在我的设备上运行 Diawi url 链接以安装它已安装的应用程序但 alamofire 开始给出错误

I am not able to get the root cause of the problem

我已经尝试了几件事,但对我没有任何帮助,有人可以帮助我吗? 我的 Pod 文件

# Uncomment this line to define a global platform for your project
# platform :ios, '8.0'
# Uncomment this line if you're using Swift
 use_frameworks!

target 'smartBrokerSuite' do
  # pod “CryptoSwift”
  pod ‘Google/Analytics’
pod ‘Alamofire', '~> 4.5'
pod 'CryptoSwift', :git => "https://github.com/krzyzanowskim/CryptoSwift", :branch => “swift3”
pod 'Charts'
pod 'DKImagePickerController'
pod 'IQKeyboardManagerSwift', '5.0.0'

end

target 'smartBrokerSuiteTests' do

end

target 'smartBrokerSuiteUITests' do

end

提前致谢!

【问题讨论】:

    标签: swift3 alamofire


    【解决方案1】:
    source 'https://github.com/CocoaPods/Specs.git'
    platform :ios, '10.0'
    use_frameworks!
    
    
    target 'smartBrokerSuite' do
      # pod “CryptoSwift”
      pod ‘Google/Analytics’
    pod ‘Alamofire', '~> 4.5'
    pod 'CryptoSwift', :git => 
    "https://github.com/krzyzanowskim/CryptoSwift", :branch => “swift3”
    pod 'Charts'
    pod 'DKImagePickerController'
    pod 'IQKeyboardManagerSwift', '5.0.0'
    end
    

    【讨论】:

    • 会尝试并会在第一时间回复您。
    【解决方案2】:

    如果 API 方法是 GET 则不要将 http 方法放在 Alamofier.request() 函数中

    Alamofire.request(Url,参数:args,编码:URLEncoding.default)

            .responseJSON { response in
                switch response.result {
                case .success(let JSON):
                    successCallback((), JSON as AnyObject)
    
                case .failure(let error):
                    print(error)
                }
        }
    

    希望对你有帮助。

    【讨论】:

      【解决方案3】:

      尝试清理 Cmd + Shift + Alt + K

      这会起作用

      【讨论】:

      • 我已经使用 pod 安装了
      • command + shift + 和 command +shift + alt + K .. 有什么区别?我正在尝试这会让你知道@enea
      • Cmd + Shift + Alt + K 就像清理派生数据一样。清理一切,任何数据
      • 你能告诉我区别吗?
      • 我也做了同样的事情并归档了构建,会告诉你
      猜你喜欢
      • 2017-06-14
      • 1970-01-01
      • 1970-01-01
      • 2022-06-20
      • 2014-08-30
      • 2017-01-28
      • 2016-08-17
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多