it doesn't seem like anyone has had this issue before but I'm using Xcode 7.3.1 and started adding some UI Test Cases with swift. When I use swift there are no compile errors or warnings that show up. So when I do something wrong it just says "Build Failed" but doesn't say why. Nothing shows up anywhere.
Yet when I make the tests in objective C it works just fine with the compile errors and warnings and NSLocalizedString works too...
Does anyone know how to make Xcode show the compile errors and warnings on tests that use swift?
I was facing the same issue. What fixed the problem on my side was to make sure that my Schema included "Analize" or "Test" for the UI Test Target. Like so:
Only then warnings and errors messages started popping up in my UI test classes:
Related
I'm working on getting an iOS project ready for Xcode 10 and Swift 4.2. So far I can build and use the app. UI Tests also run properly.
However, I'm having trouble running Unit Tests, getting the following error:
MyApp.app (37040) encountered an error (Early unexpected exit, operation never finished bootstrapping - no restart will be attempted. Underlying error: Test session exited(1) without checking in.)
I've seen the "Early unexpected exit" error before, specially when working on CI and iOS Simulator fails to launch. But I believe this is the first time I see the "Test session exited(1) without checking in" part.
I would like to add that we are getting this error only when running tests from the Xcode IDE. All tests pass properly when run from the command line with xcodebuild.
Deleting and adding Unit tests target worked for me. Don't forget to check new target in "Target Membership" for tests files.
If anybody still experience this issue this answer helped me. Set Always Embed Swift Standard Libraries to No in the projects settings. I did it for the UI test target.
I am getting an error which I shouldn't get according to this and this.
My library does exist though (here is the proof):
./Users/igorkorot/dbhandler/dbhandler/Build/Products/Debug/liblibdatabaseview.dylib
./Users/igorkorot/dbhandler/dbhandler/Build/Products/Debug/liblibdbloader.dylib
./Users/igorkorot/dbhandler/dbhandler/Build/Products/Debug/liblibdialogs.dylib
./Users/igorkorot/dbhandler/dbhandler/Build/Products/Debug/liblibodbc.dylib
./Users/igorkorot/dbhandler/dbhandler/Build/Products/Debug/liblibshapeframework.dylib
./Users/igorkorot/dbhandler/dbhandler/Build/Products/Debug/liblibsqlite.dylib
./Users/igorkorot/dbhandler/dbhandler/Build/Products/Debug/libodbc_lib.dylib
./Users/igorkorot/dbhandler/dbhandler/Build/Products/Debug/libsqlite_lib.dylib
How do I fix the error?
I refactored the code to get rid of the circular dependency and it's now compiling fine on all 3 platforms.
Its still weird though that only OSX Xcode didn't compile the code.
An attempt to print object (po command) in xcode 6 beta 6 OSX Swift project results in this error message:
(lldb) po managedObject
error: Error in auto-import:
failed to get module '__ObjC' from AST context
In this case the object in question is an instance of NSManagedObject.
Any advice on how to help auto-import in getting __ObjC module into LLVM Abstract Syntax Tree context?
As of Xcode 6.1 if you attempt the po command twice it will work on the second attempt. The first po command will always fail for each new debugging session but subsequent calls work.
Have same issue in xcode 7.3.1:
error: Error in auto-import:
failed to get module 'Touch' from AST context:
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include/libxml2/libxml/tree.h"
^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include/libxml2/libxml/tree.h:17:10: error: 'libxml/xmlversion.h' file not found
#include <libxml/xmlversion.h>
^
could not build Objective-C module 'LibXML2'
But you can use fr v managedObject instead of po managedObject.
I'd recommend double-checking that you have the
-D DEBUG
flag set under 'Other Swift Flags' for the scheme that you're using to debug. I experienced similar issues when I'd accidentally deleted it.
A clean of my project and deleting DerivedData worked for me.
I discussed a similar error message with an Apple engineer at WWDC2017. It seems like this issue can have many causes, and I am aware that mine is slightly different than the one described above.
My team spent weeks trying to figure this out, and it ended up being a bug on Apple's compiler, which we could never have figured out by ourselves. Also, it has a VERY easy workaround.
So, this is just me posting the fix here, in order to maximize the probability that someone else does a search for this confusing error message, and finds this answer.
So, here it is. In our case, we had an Objective-C project using a mix of Swift and Objective-C frameworks. This fix might apply in slightly different contexts, just try it.
There happens to be a bug with the way the compiling flags get aggregated from the frameworks and the project, and the "pure Objective-C" project "activates" it.
Solution: add one single, empty Swift file ("Whatever.swift", or whatever) in your Objective-C project, making it not-pure-objective-c any more (new->file->Swift file, don't create the bridging header. The file will only contain the import of Foundation).
I know this is some typical beginner question to use Xcode, but it's just confusing.
Basically, I git cloned a project from github.
https://github.com/gandg/webrtc-ios
https://github.com/soulfly/webrtc-ios (forked)
Both projects are updated fairly recently,
AppRTCDemo.xcodeproj some refactoring 18 hours ago
and the readme says:
To build XCode iOS app only:
project location: webrtc-ios/ios-example/AppRTCDemo.xcodeproj
Open the XCode project and set target for iPad
Build and run
Should work without changes
but, end up with many warning and errors.
Yes, I understand Apple Mach-O Linker Error typically occurs when *.m files are not added to Compile Sources of Build Phases, so I confirmed that.
It looks like the whole *.m files are included there (see the last attached image), so I know nothing to do more.
Can anyone give advice on this issue? Thanks in advance.
As I understand you are trying to build app to the iPad simulator.
Seems like this project doesn't work in iOS simulator, only on real device
Here is how Xcode looks like when I use real device - no errors:
Here is how Xcode looks like when I use iOS simulator - lots of errors like in your question:
For the purposes of testing ,I have tried building a win32 console project (empty project) so as to compile make sure that the kinect sdk would work.
On building i got hundreds of errors in NuiApi.h
All I have done was to include NuiApi.h in my source code i did nothing else.
here is the project
https://dl.dropbox.com/u/4740547/ConsoleApplication1.zip
Try to building it and you will see all the errors pop up. I would be really grateful if anyone can tell me where im going wrong.
Figured out what the problem was - All I needed to do was Add #include and more importantly uncheck the precompiled libraries option when creating the project.