ss-abramchuk / OpenVPNAdapter

Objective-C wrapper for OpenVPN library. Compatible with iOS and macOS.
GNU Affero General Public License v3.0
482 stars 215 forks source link

Unable to build with OpenVPNAdapter due to shared error #177

Closed houmie closed 4 years ago

houmie commented 4 years ago

I'm not using any app extension. The moment I install this pod, every shared part of the code throws an error: UIApplication.shared.keyWindow

def shared_pods
  pod 'SSZipArchive'
  pod 'KeychainAccess'
  pod 'SwiftyBeaver'
end

target 'tproject' do
  # Comment the next line if you don't want to use dynamic frameworks
  platform :ios, '11.0'
  use_frameworks!
  shared_pods

  pod 'IQKeyboardManagerSwift'
  pod 'OpenVPNAdapter', :git => 'https://github.com/ss-abramchuk/OpenVPNAdapter.git', :tag => '0.6.0'

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

  target 'tprojectUITests' do
    # Pods for testing
  end
end

target 'tprojectMac' do
  # Comment the next line if you don't want to use dynamic frameworks
  platform :macos, '10.12'
  use_frameworks!
  shared_pods
  pod 'AppCenter'

  target 'tproject-macTests' do
    inherit! :search_paths
    # Pods for testing
  end
  target 'tproject-macUITests' do
    # Pods for testing
  end
end

What am I missing please?

ss-abramchuk commented 4 years ago

Hi @houmie,

Find APPLICATION_EXTENSION_API_ONLY in the build settings of your target and set it to No

houmie commented 4 years ago

Hi @ss-abramchuk

It worked! Thank you so much.