Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode found bundle with the same identifier using cocoapods frameworks

When I try to execute my app in the simulator or in my iPhone I get the next error:

App installation failed
This application or a bundle it contains has the same bundle identifier as this application or another bundle that it contains. Bundle identifiers must be unique.

enter image description here

When I look in the device's log I get thi detailed error message:

For the iPhone:

Feb 13 10:28:36 iPhone-de-P streaming_zip_conduit[240] <Warning>:     __dispatch_source_read_socket_block_invoke:274:
Failed to install application at file:///var/mobile/Media/PublicStaging/MyApp.app/ : 
Error Domain=LaunchServicesError Code=0 "(null)" UserInfo={Error=DuplicateIdentifier, 
ErrorDescription=Found bundle at /private/var/mobile/Library/Caches/com.apple.mobile.installd.staging/temp.3L3YM3/extracted/MyApp.app/Frameworks/SlideMenuControllerSwift.framework 
with the same identifier ($(PRODUCT_BUNDLE_IDENTIFIER)) as bundle at /private/var/mobile/Library/Caches/com.apple.mobile.installd.staging/temp.3L3YM3/extracted/MyApp.app/Frameworks/Serialize.framework}

For the Simulator:

12/2/16 20:40:34,408 com.apple.CoreSimulator.CoreSimulatorService[2426]:
Error Domain=LaunchServicesError Code=0 "(null)" UserInfo={Error=DuplicateIdentifier, 
ErrorDescription=Found bundle at /Users/myUserName/Library/Developer/CoreSimulator/Devices/78CD18E0-B8E1-4A95-9224-2EF3ABDE5585/data/Library/Caches/com.apple.mobile.installd.staging/temp.s9Kecf/extracted/MyApp.app/Frameworks/SlideMenuControllerSwift.framework 
with the same identifier ($(PRODUCT_BUNDLE_IDENTIFIER)) as bundle at 
/Users/myUserName/Library/Developer/CoreSimulator/Devices/78CD18E0-B8E1-4A95-9224-2EF3ABDE5585/data/Library/Caches/com.apple.mobile.installd.staging/temp.s9Kecf/extracted/MyApp.app/Frameworks/Serialize.framework}

It's the same error in both devices: 2 frameworks with the same bundle ID

Normally I solved this error by doing a "pod update" or "pod install" before each compilation, but this solution it's not working anymore.

My project contains 5 pods, and this is my podfile:

platform :ios, '8.0'
use_frameworks!

target 'MyApp' do
pod 'Alamofire', :git => 'https://github.com/Alamofire/Alamofire'
pod 'MBProgressHUD', '~> 0.9.1'
pod 'swift-serialize'
pod 'SwiftyJSON', :git => 'https://github.com/SwiftyJSON/SwiftyJSON.git'
pod 'SlideMenuControllerSwift'
end

target 'MyApp' do

end

target 'MyApp' do

end

I have not set any pods bundle IDs manually. All configuration of the pods are those that are set by default when you make a "pod install"

In addition, the two pods that give me the problem are configured with the following bundle:

SlideMenu Pod: enter image description here

Serialize Pod: enter image description here

And this is my project bundle configuration: enter image description here

I tried every posted solution: reset simulator, delete derived data, product clean, clean build folder, delete simulator and re-install it...

I searched in the cocoapods forums, GitHub and Google but I can't find any reference to this error with the bundle ID of the pods frameworks.

I really do not know why this error occurs...so any help will be appreciated mates.

like image 939
Adagio Avatar asked Feb 13 '16 10:02

Adagio


1 Answers

Finally the error was the PRODUCT_BUNDLE_IDENTIFIER field in the info.plist of each pod. Changing it to "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}" solved the problem (previously was "$(PRODUCT_BUNDLE_IDENTIFIER)").

like image 58
Adagio Avatar answered Nov 12 '22 15:11

Adagio