Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to build iOS project #59

Closed
markddaa opened this issue Jun 15, 2015 · 10 comments
Closed

Failed to build iOS project #59

markddaa opened this issue Jun 15, 2015 · 10 comments
Assignees

Comments

@markddaa
Copy link

What I use:
infer --incremental -- xcodebuild -workspace Training.xcworkspace -scheme 'Training' -configuration Debug -sdk iphonesimulator

What I got:

** BUILD FAILED **

The following build commands failed:
CompileC /Users/markddaa/Library/Developer/Xcode/DerivedData/Training-fexrtaxksrhecgdraobzsohhrqly/Build/Intermediates/Training.build/Debug-iphonesimulator/Training.build/Objects-normal/i386/NATViewController.o Training/NATViewController.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
None

=====UPDATED====
I clean every time before build like this:

xcodebuild -workspace Training.xcworkspace -scheme 'Training' -configuration Debug -sdk iphonesimulator clean

@Xuyuanp
Copy link

Xuyuanp commented Jun 15, 2015

same error

@markddaa
Copy link
Author

I assume it's caused by some third part libraries? I use Cocoapods in most of my projects, some run ok some fail when using Infer, but all of them run build fine will xcodebuild tool directly in command line, which makes me thinking it might be a bug in Infer

@martinoluca
Copy link
Contributor

Please try cleaning your builds first with a command like this:
xcodebuild -workspace <your_workspace> -scheme <your_scheme> -configuration Debug -sdk iphonesimulator clean

@markddaa
Copy link
Author

I clean every time before build

@martinoluca
Copy link
Contributor

The detailed error message should be few lines above the one you reported. Could you please paste it if possible?

@markddaa
Copy link
Author

In file included from /Users/markddaa/Temp/training_ios/Training/NATViewController.m:27:
/Users/markddaa/Temp/training_ios/Training/NATViewController.h:27:1: error: use
      of '@import' when modules are disabled
@import CoreLocation;
^
/Users/markddaa/Temp/training_ios/Training/NATViewController.h:28:1: error: use
      of '@import' when modules are disabled
@import CoreBluetooth;
^
/Users/markddaa/Temp/training_ios/Training/NATViewController.h:30:50: error: 
      cannot find protocol declaration for 'CLLocationManagerDelegate'; did you
      mean 'NSLayoutManagerDelegate'?
  ...NATViewController : UIViewController <CLLocationManagerDelegate, CBPerip...
                                           ^~~~~~~~~~~~~~~~~~~~~~~~~
                                           NSLayoutManagerDelegate
In file included from /Users/markddaa/Temp/training_ios/Training/NATViewController.m:1:
In file included from /Users/markddaa/Temp/training_ios/Training/Training-Prefix.pch:14:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.3.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h:130:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.3.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSLayoutManager.h:277:11: note: 
      'NSLayoutManagerDelegate' declared here
@protocol NSLayoutManagerDelegate
          ^
In file included from /Users/markddaa/Temp/training_ios/Training/NATViewController.m:27:
/Users/markddaa/Temp/training_ios/Training/NATViewController.h:30:77: error: 
      cannot find protocol declaration for 'CBPeripheralManagerDelegate'
  ...NATViewController : UIViewController <CLLocationManagerDelegate, CBPerip...
                                                                      ^
/Users/markddaa/Temp/training_ios/Training/NATViewController.m:62:31: error: 
      unknown type name 'CLLocationManager'
@Property (nonatomic, strong) CLLocationManager *locationManager;
                              ^
/Users/markddaa/Temp/training_ios/Training/NATViewController.m:62:1: error: 
      property with 'retain (or strong)' attribute must be of object type
@Property (nonatomic, strong) CLLocationManager *locationManager;
^
/Users/markddaa/Temp/training_ios/Training/NATViewController.m:63:31: error: 
      unknown type name 'CLBeaconRegion'
@Property (nonatomic, strong) CLBeaconRegion *beaconRegion;
                              ^
/Users/markddaa/Temp/training_ios/Training/NATViewController.m:63:1: error: 
      property with 'retain (or strong)' attribute must be of object type
@Property (nonatomic, strong) CLBeaconRegion *beaconRegion;
^
/Users/markddaa/Temp/training_ios/Training/NATViewController.m:64:31: error: 
      unknown type name 'CBPeripheralManager'
@Property (nonatomic, strong) CBPeripheralManager *peripheralManager;
                              ^
/Users/markddaa/Temp/training_ios/Training/NATViewController.m:64:1: error: 
      property with 'retain (or strong)' attribute must be of object type
@Property (nonatomic, strong) CBPeripheralManager *peripheralManager;
^
/Users/markddaa/Temp/training_ios/Training/NATViewController.m:176:39: error: 
      expected a type

  • (NSString *)detailsStringForBeacon:(CLBeacon *)beacon
                                          ^
    /Users/markddaa/Temp/training_ios/Training/NATViewController.m:439:26: error: 
          expected a type
  • (void)locationManager:(CLLocationManager )manager didChangeAuthorizat...
                             ^
    /Users/markddaa/Temp/training_ios/Training/NATViewController.m:439:84: error: 
          expected a type
      ...
    )manager didChangeAuthorizationStatus:(CLAuthorizationStatus)status
                                                 ^
    /Users/markddaa/Temp/training_ios/Training/NATViewController.m:486:26: error: 
          expected a type
  • (void)locationManager:(CLLocationManager *)manager
                             ^
    /Users/markddaa/Temp/training_ios/Training/NATViewController.m:488:26: error: 
          expected a type
                   inRegion:(CLBeaconRegion *)region {
                             ^
    /Users/markddaa/Temp/training_ios/Training/NATViewController.m:522:26: error: 
          expected a type
  • (void)locationManager:(CLLocationManager *)manager didEnterRegion:(CLR...
                             ^
    /Users/markddaa/Temp/training_ios/Training/NATViewController.m:529:26: error: 
          expected a type
  • (void)locationManager:(CLLocationManager *)manager didExitRegion:(CLRe...
                             ^
    /Users/markddaa/Temp/training_ios/Training/NATViewController.m:534:26: error: 
          expected a type
  • (void)locationManager:(CLLocationManager )manager didDetermineState:(...
                             ^
    /Users/markddaa/Temp/training_ios/Training/NATViewController.m:534:73: error: 
          expected a type
      ...
    )manager didDetermineState:(CLRegionState)state forRegion:(CLRegion *)r...
                                      ^
    fatal error: too many errors emitted, stopping now [-ferror-limit=]
    20 errors generated.

@markddaa
Copy link
Author

looks like it caused by beacon functions somehow, I use CoreLocation and CoreBluetooth inside my project.

@martinoluca
Copy link
Contributor

Thank you @markddaa for reporting the entire error message, the cause of your issue is this:
error: use of '@import' when modules are disabled
It is a known issue and there's a task open for that here #2

@jvillard jvillard self-assigned this Jun 15, 2015
@muzixiaowu
Copy link

what I use:
infer -- xcodebuild -workspace ~/Downloads/workspace/iOSWorkspace/BaiduBoxApp.xcworkspace -scheme BaiduBoxApp -configuration Debug -sdk iphonesimulator

what I got:
In file included from /Users/liguang/Documents/infer/facebook-clang-plugins/clang/bin/../include/c++/v1/cstddef:43:
/Users/liguang/Documents/infer/facebook-clang-plugins/clang/bin/../include/c++/v1/stddef.h:46:15: fatal error:
cyclic dependency in module 'Darwin': Darwin -> std -> Darwin
#include_next <stddef.h>
^
1 error generated.
While building module 'Darwin' imported from /Users/liguang/Downloads/workspace/iOSWorkspace/BaiduBoxApp/BoxCore/BoxCore-Prefix.pch:5:
In file included from :86:
In file included from /Users/liguang/Documents/infer/facebook-clang-plugins/clang/bin/../lib/clang/3.8.0/include/tgmath.h:29:
/Users/liguang/Documents/infer/facebook-clang-plugins/clang/bin/../include/c++/v1/math.h:309:10: fatal error:
could not build module 'std'
#include <type_traits>

2 errors generated.
In file included from <built-in>:363:
In file included from <command line>:21:
/Users/liguang/Downloads/workspace/iOSWorkspace/BaiduBoxApp/BoxCore/BoxCore-Prefix.pch:5:9: fatal error: 
      could not build module 'Darwin'
#import <Availability.h>
 ~~~~~~~^
While building module 'UIKit' imported from /Users/liguang/Downloads/workspace/iOSWorkspace/BaiduBoxApp/BoxCore/BoxCore-Prefix.pch:15:
In file included from <module-includes>:2:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h:8:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKitDefines.h:8:9: fatal error: 
      could not build module 'Darwin'
#import <Availability.h>
 ~~~~~~~^
While building module 'UIKit' imported from /Users/liguang/Downloads/workspace/iOSWorkspace/BaiduBoxApp/BoxCore/BoxCore-Prefix.pch:15:
While building module 'Foundation' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccelerometer.h:8:
While building module 'CoreFoundation' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:
In file included from <module-includes>:2:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:11:10: fatal error: 
      could not build module 'Darwin'
#include <sys/types.h>
 ~~~~~~~~^
1 error generated.
While building module 'UIKit' imported from /Users/liguang/Downloads/workspace/iOSWorkspace/BaiduBoxApp/BoxCore/BoxCore-Prefix.pch:15:
***
***
** BUILD FAILED **


The following build commands failed:
    CompileC /Users/liguang/Library/Developer/Xcode/DerivedData/BaiduBoxApp-etvhlrqpeligjvfqjifuyfqdjgca/Build/Intermediates/BaiduBoxApp.build/Debug-iphonesimulator/BoxCore.build/Objects-normal/i386/BBAVoiceRecognitionViewController.o BoxCore/Classes/UI/View/BBAVoiceRecognitionViewController.mm normal i386 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
None

Anyone know what should I do to solve this problem?
thanks~

@martinoluca
Copy link
Contributor

Hello @markddaa,
This issue has already been discussed in #232 (comment) please try adding that argument to your build command and see if it helps.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants