question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Swift Static Libraries causing build error only with cordova build command (works fine in Xcode UI)

See original GitHub issue

Bug Report

Problem

Can’t compile a project which has Pod distributed as Swift Static Library.

What is expected to happen?

The Project should compile without any errors

What does actually happen?

The Project compiles with the below error:

<unknown>:0: error: module map file '/Users/sachinvas/Library/Developer/Xcode/DerivedData/MyApp-djlbvgkjcelsaocynsvraskofynn/Build/Products/Debug-iphonesimulator/Starscream/Starscream.modulemap' not found
<unknown>:0: error: module map file '/Users/sachinvas/Library/Developer/Xcode/DerivedData/MyApp-djlbvgkjcelsaocynsvraskofynn/Build/Products/Debug-iphonesimulator/Starscream/Starscream.modulemap' not found
<unknown>:0: error: underlying Objective-C module 'SocketIO' not found
/Users/sachinvas/Projects/Private/myapp/platforms/ios/Pods/Socket.IO-Client-Swift/Source/SocketIO/Engine/SocketEngine.swift:27:8: error: cannot load underlying module for 'Starscream'
import Starscream

Information

I am trying to run the example app in here.

The -fmodule-map-file flag has two different path’s

xcodebuild

-fmodule-map-file=/Users/sachinvas/Library/Developer/Xcode/DerivedData/MyApp-djlbvgkjcelsaocynsvraskofynn/Build/Products/Debug-iphonesimulator/Starscream/Starscream.modulemap

Xcode UI

-fmodule-map-file=/Users/sachinvas/Projects/Private/myapp/platforms/ios/Pods/Headers/Public/Starscream/Starscream.modulemap

Command or Code

cordova platforms add ios
cordova build ios (Device Only)

Environment, Platform, Device

iOS 10.0 or higher iPhone 7

Version information

cordova-ios 5.0.1 cordova-cli latest

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
sachinmobstaccommented, May 23, 2019

@janpio, I have updated the issue which reflects the error which I am facing and added additional information.

0reactions
breautekcommented, Oct 19, 2022

A workaround would be to run xcodebuild without a CONFIGURATION_BUILD_DIR. Would that be possible?

Not sure how far this will get you, or if you can unset CONFIGURATION_BUILD_DIR, but you should be able to configure it via buildFlags which can set in either build.json or via –buildFlag CLI argument.

So if something expects a specific build directory, then in theory you should be able to set it to the expected value. I don’t know if this will cause any other unwanted side effects however.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting error "No such module" using Xcode, but the ...
I have an xcworkspace with a framework project and an app project. The problem was that in the Archive scheme for my app,...
Read more >
App Won't Compile with Embedded Third Party Framework
So, I'm getting this error when trying to run the app. "Build succeeds" but the app won't run and Xcode spits out an...
Read more >
Xcode Build Settings
A convenient reference of available build settings for Xcode projects.
Read more >
Untitled
The application was running fine initially however after adding SUP static library it is taking very long time to build. 2 is what...
Read more >
Blog - Apache Cordova
This is one of Cordova's supported platforms for building Android ... The error was caused by the build process reading a bad variable...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found