apache / apache/cordova-ios

Embedding an external Xcode project in plugin.xml is broken

Open
#994 3 comments 0 reactions 0 assignees View on GitHub
info-needed
Dominant language
JavaScript
Stars
2.2k
Forks
1k
Avg merge
12h 11m
Merged PRs (30d)
18

Description

# Bug Report

## Problem

In cordova-ios v5.1.1, the below snippet can be used in `plugin.xml` to embed, in the generated Xcode project of the final app, a reference to an external Xcode project used by the plugin adding a list of its targets as dependencies for the final app:

```xml





```

"`_build/MySubLib.xcodeproj`" is inside the plugin source directory (specifically generated by a CMake-project, but this is not relevant).

The above is broken in cordova-ios v6.1.1.

### What is expected to happen?

The above snippet should work the same as before in cordova-ios v6.1.1.

### What does actually happen?

The project file (`project.pbxproj`) generated with v6.1.1 doesn't include all the correct information from the embedded project (it did it with v5.1.1). In the generated Xcode project are inserted both the reference to the external project and the list of dependencies, but not including all the embedded information from the external project the used UUIDs of the targets are missing/wrong, resulting in the final dependencies invalid.

If you take a snapshot of the generated `project.pbxproj` during each steps of its generation, and at the end you open it with Xcode, you can notice that Xcode "fixes" the project file adding all the missing references (but it's unable to fix the dependencies, as their UUIDs are missing/wrong). The result is a broken project that can't be built, neither with `cordova build ios` nor from Xcode.

Taking the same snapshots with cordova-ios v5.1.1, shows that the project was correctly generated in the first step. Resulting in a valid and buildable project.

Contributor guide

Open the contributing guide

Research direction

Start by comparing how plugin.xml framework entries with custom="true" and type="projectReference" are processed in cordova-ios v5.1.1 and v6.1.1. Inspect snapshots of the generated project.pbxproj, then reproduce the issue with cordova build ios; done means the embedded target UUIDs and dependencies are present and the project builds in Cordova and Xcode.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
build-system, mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.