Xcode Error When Building - iphone

Whenever I compile something in Xcode, I get 3 errors. One is under "Checking dependencies" and says "Unable to create directory /var/folders/zZ/string of letters/more directories/more letters." What is wrong with Xcode/my computer? I switched to the Xcode 4 preview and that works fine, but is not stable. Yes, I have tried restarting. This has been going on for weeks. Thanks for the help.

I had a similar issue, which showed up after switching to xcode 4. The error was:
error: unable to create '/build' (Permission denied)
The solution was to change '/build' to 'build' in the project configuration under Intermediate Build File Path.
In your case I would guess the pch file has a path that starts with '/'.

Related

Error Module 'flutter_secure_storage' not found when try Product ->Build for -> Profiling

well this error occurs to me when I try to make my app in production.
The app is created with flutter and I was able to create the apk for android, but when I try to do it for ios it won't let me.
The file that I am opening is Runner.xcworkspace and the problem is the import of a flutter library, it seems to me that I have to make some kind of connection with the pods.
here is the error, I want to tell you that I do not want to run the app, but to make an installer
The error that occurs when building a release (ie. flutter build ipa) and not when running a debug build is:
/[REDACTED]/ios/Runner/GeneratedPluginRegistrant.m:48:9: fatal error: module
'flutter_secure_storage' not found
#import flutter_secure_storage;
~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
1 error generated.
note: Using new build system
For me regenerating Podfile in the following way solved the issue:
rm ios/Podfile && flutter build ios
See Closed [ios][release] GeneratedPluginRegistrant.m Module not found
#43986

Tried archiving flutter project with no disc space left, can't fix errors

Question upfront: How can I thoroughly clean/repair my flutter project to allow it to run/build again?
I had been building and archiving (in Xcode) flutter projects without issue until just now.
My computer ran out of disc space mid archive and forced it to stop with "nonzero exit code".
I deleted a bunch of things on the computer to make space, and now it says there is >100gb left.
I was due for a flutter upgrade, so I ran flutter upgrade, which completed without error.
I closed android studio and Xcode and restarted my computer.
I ran flutter clean as well as clean within Xcode.
I can no longer run the app within flutter or run/archive within Xcode.
The exact errors seem variable, but here are some of them that I see:
Running from Xcode:
.../ios/Flutter/Flutter.framework/Headers/FlutterPlugin.h:292:13: Cannot find protocol declaration for 'FlutterTextureRegistry'; did you mean 'FlutterPluginRegistry'?
.../ios/Flutter/Flutter.framework/Headers/FlutterEngine.h:54:38: Cannot find protocol declaration for 'FlutterTextureRegistry'; did you mean 'FlutterPluginRegistry'?
.../.pub-cache/hosted/pub.dartlang.org/in_app_purchase-0.3.1+2/ios/Classes/FIAPReceiptManager.m:13:9: Could not build module 'Flutter'
Running from Flutter (I can't paste all of the errors... way too long):
^~~~~~~~~~~~~~~~~~~~~~
FlutterPluginRegistry
While building module 'Flutter' imported from .../.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.5/ios/Classes/FLTPathProviderPlugin.h:5:
In file included from :1:
In file included from .../Documents/Flutter/patient_medical_record/ios/Pods/../Flutter/Flutter.framework/Headers/Flutter.h:54:
In file included from .../Documents/Flutter/patient_medical_record/ios/Pods/../Flutter/Flutter.framework/Headers/FlutterAppDelegate.h:11:
.../Documents/Flutter/patient_medical_record/ios/Pods/../Flutter/Flutter.framework/Headers/FlutterPlugin.h:395:11: note: 'FlutterPluginRegistry' declared here
#protocol FlutterPluginRegistry
^
3 errors generated.
In file included from .../.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.5/ios/Classes/FLTPathProviderPlugin.m:5:
.../.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.5/ios/Classes/FLTPathProviderPlugin.h:5:9: fatal error: could not build module 'Flutter'
#import
~~~~~~~^
4 errors generated.
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
Well this is a bummer because I can't find a clean solution, but for now I did fix it with the following:
Create a new flutter project
Copied over the lib files
Copied over other setup in random places (i.e. google services, android changes)
Copied over pubspec.yaml and ran packages get
It now works again. Clearly something went wrong in the Flutter-managed files that I don't understand. If someone else can think of a better solution to effectively reset the project, please share.

Xcode 8.2, Swift Compiler Error: error: unexpected input file

After updating from Xcode 8.1 to 8.2, I am facing a Swift Compiler Error in my project. I am using the latest Swift version and Carthage for dependency management. It worked perfectly fine with Xcode 8.1, and now I have tried for hours to fix it by cleaning DerivedData and Simulator data, cleaning in Xcode and deleting the Build folder but nothing seems to help. I only have one Xcode version installed.
I get the following compile error:
CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler
cd <ProjectSource>
export DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
export SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.2.sdk
export TOOLCHAINS=com.apple.dt.toolchain.XcodeDefault
-- all files to compile --
unknown>:0: error: unexpected input file: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.2.sdk
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc failed with exit code
The folder that it is referring to looks like this:
It is actually there so I have no clue about what is going on...
Help is much appreciated! :)
I had the same kind of issue and the comments helped me figure out my problem.
Indeed, this error occurs when there is a typo or an error with the "Other Swift Flag" option. In my case, this option was passed empty by my CI engine causing an error to the generated command line leading to the error :
"error: unexpected input file: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.2.sdk"
As suggested in the comment, remove all Other Swift Tag except "$(inherited)" and check it works back as expected
Answering the question instead of commenting may help people straight forward :)
In my case it was simply because I had a file called .Swift (mind the capital S!). I renamed it correctly to .swift and all went fine.

Strange compiler warning when precompiling prefix.pch

When I want to start my app, I get this:
clang: error: invalid version number in '-mios-simulator-version-min= '
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1
What's going on? When I google this error, I'm getting ZERO. This seems to be a very strange failure.
Please apologize, that I can't give more information. It's because I'm completely clueless.
Help!
OK, I've found the solution:
.xcodeproj > General > Deployment Target ----> was empty!
This is not allowed.
Try cleaning your project and/or quitting and relaunching Xcode. I've had various odd problems with Xcode that require one or the other of those things.
In my case there is a space after 8.0 like "8.0 ". When I remove space and re-build error disappears.

error in compiling .xcdatamodel

i have xcode 4.3 with ios 5.1 and trying to compile and run the project, but it gives error:
Command /Applications/Xcode.app/Contents/Developer/usr/bin/momc failed with exit code 6
i found something in "Data Model Version Compile".. error after upgrading to Lion (Xcode4.1) but it doesn't provide me any suitable solution. It say's to delete unnecessary .xcdatamodel-directories and i did, but i still stuck up there with same issue. Other thing i found that the extension is changed in new xcode its '.xcdatamodeld' instead of '.xcdatamodel'. I copied content content of '.xcdatamodel' file and put in to '.xcdatamodeld' and added to xcode but it gave error at some where else that persistence store might exist. what should i do to run this project..
thanks in advance!!!