Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-14264

The file “embedded.mobileprovision” couldn’t be opened because there is no such file.

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: cordova-ios@5.0.0
    • Component/s: cordova-ios
    • Labels:
      None

      Description

      The widely used plugin `phonegap-plugin-push` includes the Firebase iOS SDK for push messaging with iOS through FCM. But if you want to use a debug build which using the development certificates it currently thows the following error:

      2018-08-09 11:05:48.622602+0200 MyApp[760:240424] 4.13.0 - [Firebase/InstanceID][I-IID003014] Error while reading embedded mobileprovision Error Domain=NSCocoaErrorDomain Code=260 "The file “embedded.mobileprovision” couldn’t be opened because there is no such file." UserInfo={NSFilePath=/var/containers/Bundle/Application/F8B23BB0-4A1E-42AA-9430-47867B80827A/MyApp.app/embedded.mobileprovision, NSUnderlyingError=0x2811b29a0 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}
      

      This error is thrown by Firebase here.

      This is because this file is removed by the file `copy-www-build-step.js`on line 56. If we comment out this line, al works like a charm and we can use the debug release to test push messages through FCM.

      If we take a look at Firebase iOS SDK it states `If the app does not contain the embedded.mobileprovision which is stripped out by Apple when the app is submitted to store, then it is highly likely that it is from Apple Store.`.
      Which means that if `cordova-ios` removes this file as it does Firebase expects it to be a release build, which is incorrect and the error is thrown and you will not receive a correct FCM token for debug purposes.

      So for the moment we created a hook that comments out the removal of `embedded.mobileprovision` after platform add. Now all works like a charm. But the main question is, should it be removed? Or how can we make sure Firebase iOS SDK will not mark it as production without that file?

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              markdark Mark Veenstra
            • Votes:
              7 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: