I added a unit test target to an existing project that use Cocoapods.
When I started the tests it runs the iOS simulator and I had a bunch of warning on the Xcode's console:
Class PodsDummy_Pods is implemented in both /Users/me/Library/Developer/CoreSimulator/Devices/604372F1-E934-445C-B8F6-3D8C86AA8E41/data/Containers/Bundle/Application/2A1BCAE6-5127-4288-B0E7-15588A1C09D1/MyAPP..app/MyApp. and /Users/me/Library/Developer/Xcode/DerivedData/MyApp-fzjqljiyaapspvaylhszcbkhtijd/Build/Products/Debug-iphonesimulator/MyAppTests.xctest/MyAppTests. One of the two will be used. Which one is undefined.
This error message appears for each class contained in the pod used by my project.
At the end the project throws an EXC_BAD_ACCESS
When I typed bt
in the Xcode's console, there is like an infinite loop on this error:
frame #130498: 0x000000012626e897 MyAppTests`___lldb_unnamed_function42$$MyAppTests + 135
Any suggestion?
Finally found the solution to this problem ! On my side, I had this issue with my swift framework unit tests. My Podfile was looking like that :
def import_gtm
send :pod, 'GoogleTagManager', '~> 5.0.8'
end
target 'MyFramework' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for MyFramework
import_gtm
end
target 'MyFrameworkTests' do
use_frameworks!
# Pods for testing
end
Eventhough my tests were executing correctly, I had tons of logs, just like OP. After reading on this Github issue, I changed my Podfile for the following :
def import_gtm
send :pod, 'GoogleTagManager', '~> 5.0.8'
end
target 'MyFramework' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for MyFramework
import_gtm
target 'MyFrameworkTests' do
inherit! :search_paths
end
end
I'm finally rid of all these warning logs ! Try to clean before rebuilding (cmd + alt + shift + K) or delete the DerivedData folder content :
rm -rf ~/Library/Developer/Xcode/DerivedData/*
I hope this helps !
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With