Inconsistent issues w/ Plugins and iOS
I've seen this a few times now and initially I thought it was a fluke, but as it just happened again, I thought I should file it.
From time to time when I add a plugin, I am unable to do ios builds. I get an error like so:
clang: error: no such file or directory: '/Users/ray/Dropbox/projects/crunchtime2/platforms/ios/crunchtime2/Plugins/org.apache.cordova.splashscreen/CDVSplashScreen.m' clang: error: no input files Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1
2014-09-09 09:38:42.444 xcodebuild[59445:4703] DVTAssertions: Warning in /SourceCache/IDEXcode3ProjectSupport/IDEXcode3ProjectSupport-5069/Xcode3Core/LegacyProjects/Frameworks/DevToolsCore/DevToolsCore/SpecificationTypes/BuiltInSpecifications/Compilers/XCGccMakefileDependencies.m:76 Details: Failed to load dependencies output contents from ``/Users/ray/Dropbox/projects/crunchtime2/platforms/ios/build/crunchtime2.build/Debug-iphonesimulator/crunchtime2.build/Objects-normal/i386/CDVSplashScreen.d''. Error: Error Domain=NSCocoaErrorDomain Code=260 "The file “CDVSplashScreen.d” couldn’t be opened because there is no such file." UserInfo=0x7fc50db6ed10 {NSFilePath=/Users/ray/Dropbox/projects/crunchtime2/platforms/ios/build/crunchtime2.build/Debug-iphonesimulator/crunchtime2.build/Objects-normal/i386/CDVSplashScreen.d, NSUnderlyingError=0x7fc50db6ec40 "The operation couldn’t be completed. No such file or directory"}. User info: { NSFilePath = "/Users/ray/Dropbox/projects/crunchtime2/platforms/ios/build/crunchtime2.build/Debug-iphonesimulator/crunchtime2.build/Objects-normal/i386/CDVSplashScreen.d"; NSUnderlyingError = "Error Domain=NSPOSIXErrorDomain Code=2 "The operation couldn\U2019t be completed. No such file or directory""; }. Function: void XCGccMakefileDependenciesParsePathsFromRuleFile(NSString ___strong, void (^__strong)(NSString *_strong)) Thread: <NSThread: 0x7fc50db6eca0>{name = (null), num = 9} Please file a bug at http://bugreport.apple.com with this warning message and any useful information you can provide. * BUILD FAILED **
The following build commands failed: CompileC build/crunchtime2.build/Debug-iphonesimulator/crunchtime2.build/Objects-normal/i386/CDVSplashScreen.o crunchtime2/Plugins/org.apache.cordova.splashscreen/CDVSplashScreen.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler (1 failure) Error: /Users/ray/Dropbox/projects/crunchtime2/platforms/ios/cordova/run: Command failed with exit code 65 at ChildProcess.whenDone (/Users/ray/npm/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:135:23) at ChildProcess.EventEmitter.emit (events.js:98:17) at maybeClose (child_process.js:753:16) at Process.ChildProcess._handle.onexit (child_process.js:820:5)
Note the mention of splashscreen. That is the plugin I just added. In previous encounters, if I removed the plugin, then re-added it, I was kosher. I just tried that and I still can't "ionic emulate ios."
cordova emulate ios fails too.
Cordova throws a bit more info I think, clang: error: no such file or directory: '/Users/ray/Dropbox/projects/crunchtime2/platforms/ios/crunchtime2/Plugins/org.apache.cordova.splashscreen/CDVSplashScreen.m'
I can confirm this file doesn't exist. This may be a Cordova issue, but in general, I've only seen this behavior over the past month or so and just with Ionic.
As an FYI, I just recreated this in a virgin project. 1.2.4-beta3.
And I just tried with a virgin Cordova project, no bug.
I compared the ios.json files from both projects, and the only real difference (outside of Ionic having more plugins) is the order of keys under config_munge. Here is the Ionic one:
https://gist.github.com/cfjedimaster/e3a72c88b3063ef4d226
And here is the Cordova one:
https://gist.github.com/cfjedimaster/5a92ca1769fe558da159
Ok, in a virgin project, if you FIRST add the plugin, THEN add the platform, it works with Ionic. I'm still stuck though with my older project being broke.
More news. I was wrong about remembering how I fixed this before. If I rm ios, and then add ios back in, it works, and I confirmed that fixed my older project.
I assume all this data is good - sorry if not. Another new project - and confirmed again. I forgot one plugin, just one, and added it after I added ios. Got the error as soon as I tried to emulate. rm/add ios and I was kosher.
But you've never had this error before? This is interesting because the code to create those files simply use cordova: https://github.com/driftyco/ionic-cli/blob/master/lib/ionic/start.js#L329-L346
So I'm curious what's different. And being that the commands are all put together with &&, it should go through each one synchronously. Is this always reproducible on your machine now with 1.2.4-beta3?
My gut says this behavior began about a month ago. I always used the latest Ionic until about 2 or 3 days ago when you had me go to beta for testing other things.
So how do I recreate this consistently like you can?
Make a virgin blank project. Add ios. Then add a plugin. Then emulate.
For me, this always does it. If I add my plugin and THEN add iOS, it doesn't throw the error.
ionic start tmp blank
cd tmp
ionic platform add ios
ionic plugin add org.apache.cordova.splashscreen
ionic emulate
When I run these commands in this order I'm still able to emulate. Am I interpreting it correctly?
Yep. What cordova version are you on? I'm 3.6.0-0.2.9.
Is 3.6 stable?
Well heck - npm info cordova version returns 3.5.0-0.2.7. I don't normally go to beta versions for Cordova. Let me roll back.
And boom. With the release version, I can't reproduce it. Want to close this or keep it open for when 3.6 does come out? I believe it is soon.
Yeah that's a strange one even if it is an unstable version, because the ionic-cli is using the same commands. So you'd "think" the exact same thing would happen. It could still be a bug in 3.6, so before investing too much time trying to solve it I'll just keep an eye out for it. Thanks for creating the issue though so we're aware.
I'm hitting the same issues and I'm on 3.5.0-0.2.7. @cfjedimaster - which version did you roll back to?
Whatever the main release was. Although 3.6 should be here very soon.