grab / cocoapods-binary-cache

MIT License
474 stars 69 forks source link

Duplicate resource bundles with xcframework: true param #69

Closed ilia3546 closed 3 years ago

ilia3546 commented 3 years ago

Checklist

Issue Description

When I prebuild some frameworks with bundle resources, they have duplicate resource bundles.

Example: the framework has the following resource description in the .podspec file:

s.resource_bundle = { 
    "OmnicaAPI-Localizations" => ["API/Framework/Resources/*.lproj/*.strings"] 
}

After prebuild Pods with xcframework: true param, the plugin will compile the following bundles:

  1. ./Pods/%FRAMEWORK%/_Prebuilt/%BUNLE%.bundle This bundle has Info.plist file with the following key DTPlatformName: iphonesimulator

  2. ./Pods/%FRAMEWORK%/_Prebuilt/%FRAMEWORK%.xcframework/ios-arm64/%FRAMEWORK%.framework/%BUNLE%.bundle This bundle has Info.plist file with the following key DTPlatformName: iphoneos

  3. ./Pods/%FRAMEWORK%/_Prebuilt/%FRAMEWORK%.xcframework/ios-arm64_x86_64-simulator/%FRAMEWORK%.framework/%BUNLE%.bundle This bundle has Info.plist file with the following key DTPlatformName: iphonesimulator

After the pod install command build phase [CP] Copy Pods Resources install bundle №1 by the following command in Pods-RetailCRM-resources.sh:

install_resource "${PODS_ROOT}/%FRAMEWORK%/_Prebuilt/%BUNLE%.bundle"

When I tried to upload my project to the AppStore, I got the following error:

Invalid CFBundleSupportedPlatforms value. The key 'CFBundleSupportedPlatforms' in the Info.plist file in bundle 'Payload/App.app/%BUNDLE%.bundle' contains an invalid value '[iPhoneSimulator]'. Consider removing the CFBundleSupportedPlatforms key from the Info.plist. If this bundle is part of a third-party framework, consider contacting the developer of the framework for an update to address this issue.

Here is my config:

config_cocoapods_binary_cache(
    cache_repo: {
        "Debug" => {
            "local" => "~/.cocoapods-binary-cache/prebuilt-frameworks-debug-config"
        },
        "Release" => {
            "local" => "~/.cocoapods-binary-cache/prebuilt-frameworks-release-config"
        }
    },
    build_args: {
        :simulator => [
            "ARCHS='x86_64 arm64'"
        ]
    },
    prebuild_sandbox_path: ".prebuild_sandbox",
    xcframework: true,
    device_build_enabled: true,
    bitcode_enabled: true,
    disable_dsym: false
)
trinhngocthuyen commented 3 years ago

Thanks for reaching out! We will look into the issue.

trinhngocthuyen commented 3 years ago

Kindly check out the latest (including https://github.com/grab/cocoapods-binary-cache/commit/66f73ee98de1345895d2a44d899f0d71cfd33b55) for the fix. Thanks for reporting the issue!