margelo / margelo/nitro

Bug: C++ types from imported module '__ObjC' do not support library evolution

Open
#696 25 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

build/setup
Dominant language
C++
Stars
1.9k
Forks
117
Avg merge
1d 8h
Merged PRs (30d)
44

Description

How were you trying to build the app?

Build Type

Xcode build (cmd+b)

I also tried running the project with the following command, similarly as the example app build:ios

xcodebuild -workspace SharedMobileModules.xcworkspace -scheme ReactSharedModules -skipPackagePluginValidation -skipMacroValidation -configuration Debug -sdk iphonesimulator CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ GCC_OPTIMIZATION_LEVEL=0 GCC_PRECOMPILE_PREFIX_HEADER=YES ASSETCATALOG_COMPILER_OPTIMIZATION=time DEBUG_INFORMATION_FORMAT=dwarf COMPILER_INDEX_STORE_ENABLE=NO

Project Context

Developing and building a Brownfield React Native Framework that is published through SPM and AAR Artifactory. The error happens when building the famework target on Xcode.

  • iOS Version: 16.6
  • Xcode version: 16.2

Debugging

I tried disabling the Xcode build setting Build Libraries for Distribution. This is already set to No on pods. However, this might not be ideal in our case because we distribute our Brownfield React Native setup as a SPM package.

Full build logs

Build ReactSharedModules_2025-06-13T14-38-50.txt

Update

I also checked the Swift Compiler - Language and changed it to be C++ / Objective-C++ instead of C / Objective-C. This helped. I have a different error output now:

log.txt

Image
Project dependencies

// Root package.json dependencies
"devDependencies": {
    "@actions/core": "^1.11.1",
    "@actions/github": "^5.1.1",
    "@eslint-react/eslint-plugin": "^1.40.1",
    "@graphql-codegen/cli": "^5.0.5",
    "@lodev09/react-native-true-sheet": "2.0.3",
    "@parcel/watcher": "^2.5.1",
    "@react-native-masked-view/masked-view": "0.3.2",
    "@react-native/eslint-config": "^0.73.1",
    "@react-navigation/native": "^7.0.13",
    "@react-navigation/native-stack": "^7.1.14",
    "@testing-library/react-native": "^12.9.0",
    "@types/jest": "^29.5.14",
    "@types/lodash": "^4",
    "@types/react": "^18.2.44",
    "@types/react-test-renderer": "^18",
    "@types/sanitize-html": "2",
    "@typescript-eslint/eslint-plugin": "^8.29.0",
    "@typescript-eslint/parser": "^8.29.0",
    "@zest/react-native": "0.0.49",
    "ajv-cli": "^5.0.0",
    "eslint": "^8.51.0",
    "eslint-config-prettier": "^9.0.0",
    "eslint-import-resolver-typescript": "^4.3.1",
    "eslint-plugin-custom-rules": "workspace:^",
    "eslint-plugin-design-system-tracker": "workspace:^",
    "eslint-plugin-filenames-simple": "^0.9.0",
    "eslint-plugin-import": "^2.31.0",
    "eslint-plugin-jest": "^28.9.0",
    "eslint-plugin-prefer-arrow": "^1.2.3",
    "eslint-plugin-prettier": "^5.0.1",
    "eslint-plugin-react": "^7.37.4",
    "eslint-plugin-react-native": "^5.0.0",
    "eslint-plugin-testing-library": "^7.0.0",
    "glob": "^11.0.0",
    "husky": "^9.1.7",
    "jest": "^29.7.0",
    "jest-environment-jsdom": "^29.7.0",
    "kleur": "^4.1.5",
    "lint-staged": "^15.2.10",
    "nitro-codegen": "^0.26.2",
    "plop": "^4.0.1",
    "prettier": "^3.0.3",
    "quicktype": "^23.0.170",
    "react": "18.3.1",
    "react-native": "0.75.4",
    "react-native-builder-bob": "^0.30.2",
    "react-native-nitro-modules": "^0.26.2",
    "react-native-pager-view": "6.7.0",
    "react-native-reanimated": "3.16.7",
    "react-native-restart": "^0.0.27",
    "react-native-safe-area-context": "4.14.1",
    "react-native-screens": "^4.3.0",
    "react-native-svg": "15.10.0",
    "react-test-renderer": "18.3.1",
    "ts-node": "^10.9.2",
    "typescript": "5.1.6"
},
"dependencies": {
    "@apollo/client": "^3.13.6",
    "@lokalise/node-api": "^14.0.0",
    "@opentelemetry/core": "2.0.1",
    "@opentelemetry/exporter-trace-otlp-http": "0.201.1",
    "@opentelemetry/instrumentation-fetch": "0.201.1",
    "@opentelemetry/instrumentation-xml-http-request": "0.201.1",
    "@opentelemetry/otlp-exporter-base": "0.201.1",
    "@opentelemetry/resources": "2.0.1",
    "@opentelemetry/sdk-trace-base": "2.0.1",
    "@opentelemetry/sdk-trace-web": "2.0.1",
    "@opentelemetry/semantic-conventions": "1.33.1",
    "@tanstack/react-query": "^5.59.16",
    "date-fns": "4.1.0",
    "graphql": "^16.10.0",
    "i18next": "24.2.1",
    "lodash": "^4.17.21",
    "react-i18next": "15.4.0",
    "react-native-device-info": "14.0.4",
    "react-native-render-html": "6.3.4",
    "react-native-url-polyfill": "2.0.0",
    "sanitize-html": "2.17.0",
    "zod": "^3.23.8",
    "zustand": "^5.0.3",
    "zx": "^8.4.0"
  }

//  App/Framework package dependencies

"dependencies": {
    "@lodev09/react-native-true-sheet": "*",
    "@react-native-masked-view/masked-view": "*",
    "@react-navigation/native": "*",
    "@react-navigation/native-stack": "*",
    "@zest/react-native": "*",
    "react": "*",
    "react-native": "*",
    "react-native-device-info": "*",
    "react-native-nitro-modules": "*",
    "react-native-pager-view": "*",
    "react-native-reanimated": "*",
    "react-native-restart": "*",
    "react-native-safe-area-context": "*",
    "react-native-screens": "*",
    "react-native-svg": "*"
  },
  "devDependencies": {
    "@babel/core": "^7.20.0",
    "@babel/preset-env": "^7.20.0",
    "@babel/runtime": "^7.20.0",
    "@react-native/babel-preset": "0.75.4",
    "@react-native/metro-config": "0.75.4",
    "@react-native/typescript-config": "0.75.4",
    "react-native-builder-bob": "^0.30.2"
  }
Nitro Modules Version

^0.26.2

Nitrogen Version

^0.26.2

Target platforms

iOS

Operating system

MacOS

Can you build the Nitro Modules Example app?

No, I cannot build the Example app either

I tried running in the example app, but ran into issues with React Codegen failing. I spent too much time on trying to get the example app also working.

Additional information

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the supplied xcodebuild command for the ReactSharedModules scheme and compare it with the Nitro Modules Example app. Review the reported library-evolution and React Codegen failures together with the Build Libraries for Distribution and Swift Compiler settings. Done means the iOS framework and the example app build successfully without the reported errors; no source file or test is identified in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, react-native, swift
Domain
build-system, mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.