Comments (26)
OK, after some tests, even the Clean Build Folder.... does not prevent the compilation failure.
I have to moved the "DerivedData" folder to the trash to allow my project to build cleanly.
Weird !!!
Will have to try with XCode 10 to see if this is a bug that is now resolved...
from promises.
Hi Rajesh, thank you for the heads up!
Could you provide some code snippets or a small test project that fails for you on Xcode 10, please?
Can you also open Promises.xcworkspace on your side and confirm all tests pass?
Thanks.
from promises.
Objc code
[Test callMeObjc].then(^id(NSNumber *number) {
NSLog(@"%@",number);
return nil;
});
Swift class
class Test : NSObject {
static func callMeObjc() - Promise<Bool.ObjCPromise<NSNumber {
return callMe().then({ (value) in
return NSNumber(value: value)
}).asObjCPromise()
}
static func callMe() - Promise<Bool {
return Promise<Bool.init(true)
}
}
This is the simple use case. The application fails to compile.
I m unable test because it throws an error.
Tests in the target “PromisesTests” can’t be run because “PromisesTests” isn’t a member of the active scheme.
from promises.
Tested Pod with XCode 10 beta with new blank Cocoa app,
result in Swift Compiler Error
> Include of non-modular header inside framework module 'FBLPromises'...
And then open project back in XCode 9 will remain to have this error. Clean project, pod remove and add didnt help.
If creating a blank new project with in XCode 9, it works. But broken once opened it with XCode 10 beta.
from promises.
@rajesht1989 I just ran the following code successfully in a new 1-view template project set up with Cococapods in Xcode 10 beta:
# Podfile
target 'TestPromisesCocoapods' do
use_frameworks!
pod 'PromisesSwift', '~> 1.2.2'
end
// TestObject.h
#import <FBLPromises/FBLPromises.h>
@interface TestObject : NSObject
- (void)test;
@end
// TestObject.m
#import "TestPromisesCocoapods-Swift.h"
@implementation TestObject
- (void)test {
[Test callMeObjc].then(^id(NSNumber *number) {
NSLog(@"%@",number);
return nil;
});
}
@end
// TestPromisesCocoapods-Bridging-Header.h
#import "TestObject.h"
// ViewController.swift
import Promises
import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
TestObject().test()
}
}
// Test.swift
import Promises
class Test : NSObject {
@objc
static func callMeObjc() -> Promise<Bool>.ObjCPromise<NSNumber> {
return callMe().then { value in
NSNumber(value: value)
}.asObjCPromise()
}
static func callMe() -> Promise<Bool> {
return Promise(true)
}
}
Let me know if it works on your side.
from promises.
@shoumikhin We had the same sort of code but It was not working. Now we are able to fix the issue by making return type FBLPromise like this.
new working code
static func callMeObjc() -> FBLPromise<NSNumber> {
return callMe().asObjCPromise()
}
Instead of
static func callMeObjc() -> Promise<Bool>.ObjCPromise<NSNumber> {
return callMe().asObjCPromise()
}
Can you let me know if this is fine and let me know the causes and consequences of this ?
from promises.
Do you also have an @objc
specifier for the function returning ObjCPromise
and used from Objective-C?
I'd highly appreciate if you packed a simple test project in zip and attached here, so that we could reproduce your error.
Thanks!
from promises.
@shoumikhin I have tried giving @objc
specifier but still helpless. When I try the same in the sample project, It compiled without any issues.
So, I feel the problem is in the configuration of my project which I could not identify. :(
from promises.
Sorry to hear that. Hoped we could help to resolve your issue. Anyhow, feel free to close this issue and follow up with any other related findings in future.
from promises.
@shoumikhin I'm having the same problem with promises and Xcode 10 beta.
Couldn't build FBLPromises:
Include non-modular header inside framework module 'FBLPromises'
The project builds fine with Xcode 9.3 :( and I'm using PromisesSwift
from promises.
This problem is resolved by removing Promises from pod file and reinstall...
from promises.
@Kishimotovn just to clarify, do you say the issue has gone when you re-run pod update
? Were you able to successfully build Promises with Xcode 10 eventually? Would appreciate any reproduction steps that lead to the issue.
from promises.
Hi @shoumikhin,
Here is what I did:
- remove the pod from the podfile
- run apod install to remove those pod from the project.
- do a clean build with xcode
- add the pod again to the podfile and install
It seems that this problem only happens when you open an existing project with xcode 10. Projects that are created with xcode 10 won’t have this problem :-?
from promises.
Just turn on Xcode Server. It's good for me.
from promises.
Got that same error under XCode 9.4.1 with version 1.2.3.
Include of non-modular header inside framework module 'FBLPromises'
..../Sources/Promises/Promise+Await.swift:15:8: Could not build Objective-C module 'FBLPromises'
And I tried the remove / reinstall trick but still same problem.
And this is being added to an existing XCode 9 project.
from promises.
Hi Martin, thank you for reporting that!
Are you using CocoaPods?
Wonder if the following would work for you:
pod cache clean PromisesObjC
pod cache clean PromisesSwift
cd <your_project_dir>
rm -rf Pods/
rm Podfile.lock
pod update
from promises.
Followed instructions... Same issue.
Deployment target : MacOS 10.12
Swift Version : 4.1
from promises.
Do you mind to make a small test project and check if it reproduces on it, and if so, share the project here with some instructions on how to break it? Many thanks!
from promises.
from promises.
Will do and report here.
from promises.
Weird. I created a new project; installed and compiled the Promises pod without any issues.
Will investigate my current project structure.
from promises.
Here's my latest finding:
-
Cleaning the project and removing the XCode "DerivedData" folder and then rebuilding works correctly.
-
However If I clean the project but not do remove the "DerivedData" folder then it fails with the "non-modular error".
Not sure where to go from here.
from promises.
Thank you for experimenting, Martin!
How do you normally clean the project?
There're basically two standard options via Xcode:
Wonder if both of them fail to clean DerivedData
properly?
from promises.
Getting the same issue. I read somewhere that might be because of low memory. But that doesn't help as well.
from promises.
from promises.
This randomly happened while adding another library as a pod. Like @martindufort said deleting DerivedData folder fixed it!
from promises.
Related Issues (20)
- Contextual type for closure argument list expects 1 argument, which cannot be implicitly ignored
- Objective-C Promises crashes in SwiftUI previews HOT 3
- ios 16 strings convertible to NSError HOT 1
- FBLPromises fails to load building macos flutter app HOT 2
- 'NSInvalidArgumentException', reason: '-[FBLPromise HTTPBody]: unrecognized selector sent to instance HOT 1
- Confused when retry a Promise variable
- type(of: value) is NSError.Type HOT 1
- Bitcode Issue on Xcode 13 when disable it. HOT 1
- Question regarding implementation HOT 3
- Ignore a certain Error and terminate Promise HOT 5
- Please release a new version of promises that includes latest changes for Firebase HOT 4
- Builds including PromisesSwift failing on CI
- Build fails for macOS with Xcode 14.3
- Create releases for new versions HOT 1
- The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 12.0 to 17.0.99.
- Privacy manifest for sensitive APIs HOT 6
- Version 2.4.0 not compiling HOT 15
- iOS build issue with 2.4.0 HOT 5
- PrivacyInfo.xcprivacy is not included in the framework output built by Carthage HOT 1
- FBLPromises.xcframework missing mac_catalyst support HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from promises.