Swift Static Libraries causing build error only with cordova build command (works fine in Xcode UI)
See original GitHub issueBug 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:
- Created 4 years ago
- Comments:7 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@janpio, I have updated the issue which reflects the error which I am facing and added additional information.
Not sure how far this will get you, or if you can unset
CONFIGURATION_BUILD_DIR
, but you should be able to configure it viabuildFlags
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.