Mapbox-gl-native: Build Failed iOS due to duplicated symbol maps

Created on 12 Sep 2019  Ā·  18Comments  Ā·  Source: mapbox/mapbox-gl-native

Hello! My obj-c test files are failing to build.

The compiler is complaining about the Pods project:

ignoring duplicated output file: '/Users//Library/Developer/Xcode/DerivedData/x/Build/Products/Debug-iphoneos/3C37B131-DD4F-3BB9-A83C-83EE7CC444A6.bcsymbolmap' in shell script build phase '[CP] Embed Pods Frameworks'. This warning represents an extremely serious project misconfiguration and will likely cause some shell scripts in your project to be skipped entirely, leading to other build failures or missing files in the build directory. This will be a hard error in the future. (in target 'Tests')
-               39FF51B022730F2C002AF67D /* (null) in Sources */ = {isa = PBXBuildFile; };
+               39FF51B022730F2C002AF67D /* BuildFile in Sources */ = {isa = PBXBuildFile; };
-                               "${PODS_ROOT}/Mapbox-iOS-SDK/dynamic/1BF93521-4C77-3633-A539-01336F1D64E9.bcsymbolmap",
-                               "${PODS_ROOT}/Mapbox-iOS-SDK/dynamic/9D189C8A-78FE-3297-847F-34B05A3A6906.bcsymbolmap",
+                               "${PODS_ROOT}/Mapbox-iOS-SDK/dynamic/3C37B131-DD4F-3BB9-A83C-83EE7CC444A6.bcsymbolmap",
+                               "${PODS_ROOT}/Mapbox-iOS-SDK/dynamic/06669838-82B0-3595-976F-2071C1C51CA1.bcsymbolmap",

Configuration

Mapbox SDK versions: 5.2.0 and 5.3.0
iOS/macOS versions:
Device/simulator models:
Xcode version:

archived build high priority iOS

Most helpful comment

This happens to me too (cocoapods 1.8.4, XCode 11)

error: Multiple commands produce 'Build/Products/Debug-iphonesimulator/Instabug.framework.dSYM':

Unfortunately CI/CD setup does not let me manually delete the duplicate and it is not a good solutions.

@akashivskyy solution in the other thread worked for now.

adding disable_input_output_paths => true to the beginning of podfile

platform :ios, '10.0'
install! 'cocoapods', :disable_input_output_paths => true

I dont know what exactly that command is doing but it only added 15 seconds to build time, so not bad.

All 18 comments

Hi @racer1988 -

Thank you for the report! I haven't been able to replicate this issue using Xcode 11 GM and CocoaPods v1.7.5. There also don't seem to be any recent changes with how we generate the *.bcsymbolmap files.

Could you share which versions of CocoaPods and Xcode you are using? That would help us to investigate the issue.

EDIT: Mapbox is the only framework generatin symbolmaps i have


here is what I have

gem 'cocoapods', '1.7.5'
Xcode Version 10.3 (10G8)

Podfile

def mapBox
    pod 'Mapbox-iOS-SDK', '5.3.0'
end

target 'x' do
    project 'x'
    mapBox
end


target 'xTests' do
    project 'x'
    mapBox
end

post_install do |installer|

   installer.pods_project.build_configuration_list.build_configurations.each do |configuration|
      configuration.build_settings['CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES'] = 'YES'
      configuration.build_settings['ENABLE_BITCODE'] = 'NO'
    end

end

Screenshot of copy phases

Screenshot 2019-09-12 at 23 34 01

Screenshot 2019-09-12 at 23 34 21

CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/Mapbox-iOS-SDK
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Mapbox-iOS-SDK/dynamic"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_ROOT = ${SRCROOT}
PODS_TARGET_SRCROOT = ${PODS_ROOT}/Mapbox-iOS-SDK
PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
SKIP_INSTALL = YES

Update:

I tried with this simplified PodFile:

def mapBox
    pod 'Mapbox-iOS-SDK', '5.3.0'
end

target 'x' do
    project 'x'
    mapBox
end


target 'xTests' do
    project 'x'
    # Commented out
    #mapBox
end

# Commented out
#post_install do |installer|
   #installer.pods_project.build_configuration_list.build_configurations.each do |configuration|
      #configuration.build_settings['CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES'] = 'YES'
      #configuration.build_settings['ENABLE_BITCODE'] = 'NO'
    #end
#end

but I still get the same 4 PODS_ROOT generated with 2 symbols map

My project file gets this removed (from the test target):

-                               "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Mapbox.framework",
-                               "${DWARF_DSYM_FOLDER_PATH}/Mapbox.framework.dSYM",
-                               "${BUILT_PRODUCTS_DIR}/3C37B131-DD4F-3BB9-A83C-83EE7CC444A6.bcsymbolmap",
-                               "${BUILT_PRODUCTS_DIR}/06669838-82B0-3595-976F-2071C1C51CA1.bcsymbolmap",

Update 2:

Tried to pod install version 4.2.0.

The project diff is the following:

-                               "${PODS_ROOT}/Mapbox-iOS-SDK/dynamic/3C37B131-DD4F-3BB9-A83C-83EE7CC444A6.bcsymbolmap",
-                               "${PODS_ROOT}/Mapbox-iOS-SDK/dynamic/06669838-82B0-3595-976F-2071C1C51CA1.bcsymbolmap",
+                               "${PODS_ROOT}/Mapbox-iOS-SDK/dynamic/7153F022-4792-3200-B34D-702CFCED0163.bcsymbolmap",
+                               "${PODS_ROOT}/Mapbox-iOS-SDK/dynamic/97E55811-1447-3778-BB3F-428F5D52C17B.bcsymbolmap",

-                               "${BUILT_PRODUCTS_DIR}/3C37B131-DD4F-3BB9-A83C-83EE7CC444A6.bcsymbolmap",
-                               "${BUILT_PRODUCTS_DIR}/06669838-82B0-3595-976F-2071C1C51CA1.bcsymbolmap",
+                               "${BUILT_PRODUCTS_DIR}/7153F022-4792-3200-B34D-702CFCED0163.bcsymbolmap",
+                               "${BUILT_PRODUCTS_DIR}/97E55811-1447-3778-BB3F-428F5D52C17B.bcsymbolmap",

-                               "${PODS_ROOT}/Mapbox-iOS-SDK/dynamic/Mapbox.framework",
-                               "${PODS_ROOT}/Mapbox-iOS-SDK/dynamic/Mapbox.framework.dSYM",
-                               "${PODS_ROOT}/Mapbox-iOS-SDK/dynamic/3C37B131-DD4F-3BB9-A83C-83EE7CC444A6.bcsymbolmap",
-                               "${PODS_ROOT}/Mapbox-iOS-SDK/dynamic/06669838-82B0-3595-976F-2071C1C51CA1.bcsymbolmap",

-                               "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Mapbox.framework",
-                               "${DWARF_DSYM_FOLDER_PATH}/Mapbox.framework.dSYM",
-                               "${BUILT_PRODUCTS_DIR}/3C37B131-DD4F-3BB9-A83C-83EE7CC444A6.bcsymbolmap",
-                               "${BUILT_PRODUCTS_DIR}/06669838-82B0-3595-976F-2071C1C51CA1.bcsymbolmap",

BUT I still see the 4 of them in the copy phases

Hi @racer1988 can you provide a sample project that has this issue?

EDIT: In your diff above can you confirm that you see the symbol maps under PODS_ROOT in inputPaths and under BUILT_PRODUCTS_DIR in outputPaths?

There should be 2 bcsymbolmap files: 32bit & 64bit.

@julianrex Project file look like this:

/* [CP] Embed Pods Frameworks */ = {
            isa = PBXShellScriptBuildPhase;
            buildActionMask = 2147483647;
            files = (
            );
            inputPaths = (
                "${PODS_ROOT}/Mapbox-iOS-SDK/dynamic/Mapbox.framework",
                "${PODS_ROOT}/Mapbox-iOS-SDK/dynamic/Mapbox.framework.dSYM",
                "${PODS_ROOT}/Mapbox-iOS-SDK/dynamic/1BF93521-4C77-3633-A539-01336F1D64E9.bcsymbolmap",
                "${PODS_ROOT}/Mapbox-iOS-SDK/dynamic/9D189C8A-78FE-3297-847F-34B05A3A6906.bcsymbolmap",

            );
            name = "[CP] Embed Pods Frameworks";
            outputPaths = (

                "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Mapbox.framework",
                "${DWARF_DSYM_FOLDER_PATH}/Mapbox.framework.dSYM",
                "${BUILT_PRODUCTS_DIR}/1BF93521-4C77-3633-A539-01336F1D64E9.bcsymbolmap",
                "${BUILT_PRODUCTS_DIR}/9D189C8A-78FE-3297-847F-34B05A3A6906.bcsymbolmap",

            );

I see the same in main target and in test target

The issue I reported seem to happen only if I build also the TEST target (unit tests).
If I only run the main target the compiler issue is not appearing.

I will need more time to get an example project running.

In the meantime I could suggest to see if the TEST Target gives you some hints

Thanks @racer1988! We'll take a look

We did see this internally with one CocoaPods-using app that included Mapbox-iOS-SDK in both the main app target and a separate tests target — I ā€œsolvedā€ that by removing Mapbox from the tests target (since it was unused), but clearly that’s not a solution if you want to use our API in your tests.

I’m not sure why this began to fail recently, but it seems like CocoaPods’ generated build scripts probably shouldn’t try to re-copy bcsymbolmaps into the same folder (BUILT_PRODUCTS_DIR) from multiple targets.

@friedbunny @julianrex Agreed with the test target, I had the same issue at the beginning as I was including both.

Now my CocoaPod is not including Mapbox in the tests, however the CP phase is the same and the error in the test project stays

I'm having the same issue with Xcode 11. Cocoapods 1.8.0, Mapbox SDK 5.4.0.

@friedbunny @julianrex We now have the same issue popping up in
Xcode 11. Cocoapods 1.8.0, Mapbox SDK 5.4.0.

However now it is a Error and not a warning, so the Test Suite can't be compiled anymore 😢

BTW I found out I get the issue even without Mapbox Framework inside the Test Target because:

I have a mixed project and the OBJ-C Unit Tests are importing the Main Target Swift Header to initialize some test classes.
the Swift Header also contain a class using mapbox, hence mapbox is imported to the test project via the swift header

I have a mixed project and the OBJ-C Unit Tests are importing the Main Target Swift Header to initialize some test classes.
the Swift Header also contain a class using mapbox, hence mapbox is imported to the test project via the swift header

Thanks for the additional details!

Browsing issues in the CocoaPods repo, there appear to be a variety of problems where CocoaPods is unable to properly manage input/output files in script phases — https://github.com/CocoaPods/CocoaPods/issues/9185 being a recent, active example.

Until CocoaPods fixes this issue, I would expect the workarounds offered in the above issue to also apply here. Additionally, manually deleting the bcsymbolmap output files in the [CP] Embed Pods Frameworks script phase will also work, if you’re looking for something quick and dirty:

Screen Shot 2019-10-11 at 11 27 44 AM

This happens to me too (cocoapods 1.8.4, XCode 11)

error: Multiple commands produce 'Build/Products/Debug-iphonesimulator/Instabug.framework.dSYM':

Unfortunately CI/CD setup does not let me manually delete the duplicate and it is not a good solutions.

@akashivskyy solution in the other thread worked for now.

adding disable_input_output_paths => true to the beginning of podfile

platform :ios, '10.0'
install! 'cocoapods', :disable_input_output_paths => true

I dont know what exactly that command is doing but it only added 15 seconds to build time, so not bad.

Thanks, this fixed the build issue for me as well.

Also having an issue with this no longer compiling with Xcode 11.2 on Catalina

This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings