Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CocoaPods test target Library not loaded exit code 82

This appears to be an issue with CocoaPods, asking here first as per the guidelines.

Using Xcode 7.3.1, CocoaPods 1.0.1, 1.0.0-beta6 and 1.1.0-beta1

Create a new pod project using pod lib create SwiftTest

  • Language? Swift
  • Demo? Yes
  • Test frameworks? None
  • View based testing? No

Add a single class function to the auto-generated ReplaceMe.swift file to test the projects integration.

Calling the function from the example project works as expected.

Calling the function from the test project fails with the following error:

The bundle “SwiftTest_Tests” couldn’t be loaded because it is damaged or missing necessary resources. Try reinstalling the bundle.
(dlopen_preflight(/...): Library not loaded: @rpath/SwiftTest.framework/SwiftTest ... Reason: image not found)
Program ended with exit code: 82

Example project: https://github.com/NextFaze/SwiftTest

like image 268
Ric Santos Avatar asked Aug 15 '16 06:08

Ric Santos


1 Answers

Issue can be fixed by changing the Podfile to:

use_frameworks!

def standard_pods
    pod 'SwiftTest', :path => '../'
end

target 'SwiftTest_Example' do
  standard_pods
end

target 'SwiftTest_Tests' do
  standard_pods
end
like image 60
Ric Santos Avatar answered Nov 15 '22 18:11

Ric Santos