Opening import file for module 'XCTest': Not a directory - swift

I'm experiencing this issue on a brand new Sierra setup, with Xcode 8.1.
I have a framework target for iOS, the target builds fine, but when I try to build for test the build fails with this error:
Opening import file for module 'XCTest': Not a directory
I looked at these questions already, but their suggestions are not useful for us:
Opening import file for module 'Swift': Not a directory
<unknown>:0: error: Opening import file for module 'Swift': Not a directory
All the settings in the project are pretty standard.

The cause of this issue was quite bizarre.
It was happening in a CI box on which I had installed Xcode 8.1 via the MAS. In our company we provision CI boxes using xcode-install, but for some reason that I don't remember I wasn't able to do so on this one.
To mimic xcode-install's behaviour I renamed Xcode.app into Xcode-8.1.app, and created an alias of it called Xcode.app.
This is where the issue was. The alias I created wasn't a proper symbolic link. Xcode.app wasn't actually a folder.
I realised this when trying to perform a command line build that referenced some system framework other than Foundation/UIKit... It failed saying that it couldn't find the framework inside Xcode.app/....
Once I made Xcode.app into a proper symlink everything worked.

Related

Opening import file for module 'GoogleMaps': Not a file directory

I'm experiencing this issue with Xcode 8.2.
I'm using Google Maps, but when I try to build for test, the build fails with this error:
Opening import file for module 'GoogleMaps': Not a file directory
I've update my pods, use_frameworks!, tried re-installing the pod, removed the cache, cleaned the project, and most all other relative suggestions regarding :Not a file directory issues.

<unknown>:0: error: Opening import file for module 'Swift': Not a directory

After changing my framework search path to $(inherited) so that the cocoapods framework search path could be used I came up with this error. I also recently changed the name of my project to try to keep things more organized. I am fairly new to Xcode and have no clue how to even approach this problem.

Upgrading to a newer version of Cocos2dx

I've been running cocos2dx version 1.0.1-x-0.11.0 till now and have a small project working fine. I need to upgrade to the latest version, cocos2d-2.0-x-2.0.4. What would be the correct way to do this? I don't want to
A. Mess up my project.
B. End up with 2 different versions of cocos2dx
Can I just download and replace the old cocos2dx folder with the new one? Any help appreciated.
Thanks.
Edit:
I actually downloaded the latest version and tried to set it up separately. I ran the build_win32.bat and after running for a while it opened the test application. Then I opened the vs2010.sln and tried adding a new project, but it throws include errors.
Error 3 error C1083: Cannot open include file: 'CCApplication.h': No such file or directory c:\cocos2d-2.0-x-2.0.4\chilra\classes\appdelegate.h 4 1 Chilra.win32
Error 2 error C1083: Cannot open include file: 'CCPlatformDefine.h': No such file or directory c:\cocos2d-2.0-x-2.0.4\cocos2dx\platform\ccplatformmacros.h 32 1 Chilra.win32
Error 1 error C1083: Cannot open include file: 'CCStdC.h': No such file or directory c:\cocos2d-2.0-x-2.0.4\chilra\win32\main.h 11 1 Chilra.win32
X:\CC2Dx (where my source is, unzipped the entire source file into this folder)
Open the cocs2d-Win32.sln. Run it in Debug mode and Release mode, You should find Debug.win32, Release.win32 folder inside your cocos2d-x
(Now here you can test, Make TestCpp as startupProject by RightClicking on the folder TestCpp ..then Run)
Now Run build_win32.bat (It will copy some files in to your Debug.win32 and Release.win32
This is where it created the solution, Debug.win32 & Release.win32.
After running build_win32.bat now either you can create your new project using VS 2008 template because Vs2012 has some script error I have solution for that also
But I suggest you to copy the HelloWorldProject and replace it with your files
Always Remember whenever you get some cocos2d file error like you have got in your above procedure then just copy those .lib file and .dll files from the Debug.win32 and Release.win32
and then run ......
This works fine
Any queries please feel free to ask
I've added cocos2dx to the upstream tracker for analysis and seems there some API/ABI changes made between 0.11.0 and 2.0.4: http://upstream.rosalinux.ru/versions/cocos2d-x.html
You can use japi-compliance-checker tool to generate such reports.

Xcode 4.2: Build for Archive is good, but Archive fails with errors

I am trying to build my app and submit it to the App Store but Xcode keeps giving me errors when trying to do that.
When I build and run in the simulator it works, when I build and run for a device it works, when I try to use the build for archive option it works, when I actually try to archive it it will fail with 9 or 11 errors depending on (IMHO) what time of day it is.
Anyone have any idea why? I tried following some other tips such as deleting the project folder in ~/Library/Developer/Xcode/DerivedData
And another user said to clean the build folder but that option is grayed out in the menu bar.
Anyone know of any other solutions?
All my errors are file not found errors, I am using Three20 so the errors are:
'Three20Core/TTCorePreprocessorMacros.h' file not found
'Three20Core/TTDebug.h' file not found
'Three20Core/TTCorePreprocessorMacros.h' file not found
'Three20Core/TTGlobalCore.h' file not found
../scripts/Protect.command: line 23: cd: /Users/[username]/Library/Developer/Xcode/DerivedData/TTCatalog-gcnbfpwscygfrmdhcfiahsatpdba/ArchiveIntermediates/pr/BuildProductsPath/Release-iphoneos/../three20/Three20Network: No such file or directory
'Three20UICommon/private/UIViewControllerGarbageCollection.h' file not found
'Three20Core/TTGlobalCoreLocale.h' file not found
'Three20UICommon/private/UIViewControllerGarbageCollection.h' file not found
../scripts/Protect.command: line 23: cd: /Users/[username]/Library/Developer/Xcode/DerivedData/TTCatalog-gcnbfpwscygfrmdhcfiahsatpdba/ArchiveIntermediates/pr/BuildProductsPath/Release-iphoneos/../three20/Three20UICommon: No such file or directory
The error seems to be path issue in environment variables.
Just carefully follow the steps mentioned in integrating Three20 library # https://github.com/facebook/three20
( use The Second option to add it to your project manually)
Make sure the configuration added to All Configuration (Debug, Release, Distribution(if exists).
Also Make sure your Xcode preference are as below
xcode->preferences->locations
Select Derived Data->relative
Select Advanced -> Legacy

Boost.python failed with libboost_python.so.1.41.0: cannot open shared object file

I have already installed Boost.Python. There were no erros during instalation, but I have a problem. When I try to build my project ererything is OK, but when I run my wrapped project there is an error:
import wrraped_project
ImportError: libboost_python.so.1.41.0: cannot open shared object file: No such file or directory
I tried to copy the project to libboost_python.so.1.41.0 also the lib to the project etc. But every time I have the sme error.
Check if the boost library files are in LD_LIBRARY_PATH.
If that doesn't help, check if the filename is correct, and create a symlink if different.
Can you give us the relevant content of your /usr/lib directory? I'm assuming you're on Linux, right? And did you install Boost.Python with a package manager?