Git Product home page Git Product logo

Comments (26)

martindufort avatar martindufort commented on April 28, 2024 2

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.

shoumikhin avatar shoumikhin commented on April 28, 2024

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.

rajesht1989 avatar rajesht1989 commented on April 28, 2024

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.

DazChong avatar DazChong commented on April 28, 2024

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.

shoumikhin avatar shoumikhin commented on April 28, 2024

@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.

rajesht1989 avatar rajesht1989 commented on April 28, 2024

@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.

shoumikhin avatar shoumikhin commented on April 28, 2024

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.

rajesht1989 avatar rajesht1989 commented on April 28, 2024

@shoumikhin I have tried giving @objcspecifier 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.

shoumikhin avatar shoumikhin commented on April 28, 2024

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.

Kishimotovn avatar Kishimotovn commented on April 28, 2024

@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.

Kishimotovn avatar Kishimotovn commented on April 28, 2024

This problem is resolved by removing Promises from pod file and reinstall...

from promises.

shoumikhin avatar shoumikhin commented on April 28, 2024

@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.

Kishimotovn avatar Kishimotovn commented on April 28, 2024

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.

malaratn avatar malaratn commented on April 28, 2024

Just turn on Xcode Server. It's good for me.

from promises.

martindufort avatar martindufort commented on April 28, 2024

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.

shoumikhin avatar shoumikhin commented on April 28, 2024

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.

martindufort avatar martindufort commented on April 28, 2024

Followed instructions... Same issue.
screen shot 2018-08-27 at 4 48 51 pm

Deployment target : MacOS 10.12
Swift Version : 4.1

from promises.

shoumikhin avatar shoumikhin commented on April 28, 2024

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.

martindufort avatar martindufort commented on April 28, 2024

screen shot 2018-08-27 at 4 52 59 pm

from promises.

martindufort avatar martindufort commented on April 28, 2024

Will do and report here.

from promises.

martindufort avatar martindufort commented on April 28, 2024

Weird. I created a new project; installed and compiled the Promises pod without any issues.
Will investigate my current project structure.

from promises.

martindufort avatar martindufort commented on April 28, 2024

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.

shoumikhin avatar shoumikhin commented on April 28, 2024

Thank you for experimenting, Martin!
How do you normally clean the project?

There're basically two standard options via Xcode:

screen shot 2018-08-29 at 8 56 16 am

Wonder if both of them fail to clean DerivedData properly?

from promises.

nitishmaropost avatar nitishmaropost commented on April 28, 2024

Getting the same issue. I read somewhere that might be because of low memory. But that doesn't help as well.

from promises.

martindufort avatar martindufort commented on April 28, 2024

from promises.

ItsEcholot avatar ItsEcholot commented on April 28, 2024

This randomly happened while adding another library as a pod. Like @martindufort said deleting DerivedData folder fixed it!

from promises.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.