Xamarin.iOS- ProjectDir:No such file or directory (appName.iOS) - ios

Getting compilation error in xamarin.iOS project-
/Users/gsps/Desktop/MyFolder/projectName/iOS/bin/iPhoneSimulator/Debug/device-builds/iphone10.3-11.3/projectName.iOS.app:
Error: ${ProjectDir}: No such file or directory (projectName.iOS)
I have Cleaned, Rebuild & Restarted machine but this didn't solved my problem. When I am going to the given location finding the same file that looks like deleted or corrupted(See screenshot). I have recently updated Xamarin & xCode to latest version.
Error screenshot below:
File/Directory screenshot below:

I am answering my question. After searching a lot I found that In iOS Bundle Signing, I have declared Additional Argument as ${ProjectDir}. When I removed It, I have compiled my project successfully.

Related

xcode 13 executable file not found

I've an error with xcode 13. When i try to run my app on a real device (arm64 architecture) i got the following error:
Executable Not Found
Domain: DVTMachOErrorDomain
Code: 5
Recovery Suggestion: /path/to/file/MyApp.app is not a valid path to an executable file. Please rebuild the project to ensure that all required executables are created. Check your project setting to ensure that a valida executable will be built.
has anyone ever had this problem? The build process finish without errors. Right now i've excluded x86_64 architecture from "Excluded Architectures" option and set the parameter "Architectures" to "Standard Architectures (arm64, armv7)".
TARGET -> Build Settings, search 'VALID'.
Set VALID_ARCHS, add if run with a simulator, else set arm64.
I faced the same problem and resolved it by deleting files and folders below,
Pods ,
Podfile.lock and
mme.xcworkspace
And running pod install
This Error occur because there was a missing file.
Click on the Error icon on the top header and you redirect to errors there you notice there are some files that are not there or missing.
Added the file and run your project again working correctly.
I got the same error and it was just because I didn't change the build settings correctly after I renamed the folder where Info.plist belongs to.
So I needed to change this setting so that it was the same with the actual path of Info.plist:
Did you make sure that the executable file MyApp located in your folder /path/to/file/MyApp.app/ matches the value of the Executable file attribute in your Info project file?
On my machine, the executable path is : /Users/.../DerivedData/Debug-iphonesimulator/Runner.app/Runner. I noticed that the executable name (Runner in my case) was wrong in the Info file. Correcting it fixed the issue for me.
See the the screenshot below :
Check if there are any deleted files(which happens when you pull the code from Git) and add those files back, Close Xcode, Restart the system, Clean the Project and Run the Project this Worked for me.
I had this error as well.
This is not a blanked solution fix.
For me Xcode had some broken references to files, so I had to connect them and set the file location to be "relative to group" vs "relative to project"
The error was being incorrectly reported as "Executable not found" when building the error was more clear.
Build input file cannot be found: '/Users/MY_USER_NAME/Programs/ios/PROJECT_DIR/SRC/file.xib' is not found.
Some file is missing, you just have to add from project folder. Just restart your Mac and open XCode with your project, you will see the missing file.
I have previously tried every possible solution like cleaning derived data, running pod install but nothing worked. Try above solution
Perhaps the executable file entry is wrong in your Info.plist?
The entry Executable file should be set to $(EXECUTABLE_NAME).
Targets -> Build Settings, search plist
Set Generate Info.plist File to No, set Info.plist File with your info.plist file path.
That's works for me.
I encountered this issue just now after setting up a new prefix header to my product target with a wrong file path:
$(SRCROOT)/$(PROJECT_NAME)/PrefixHeader.h
Correct it to
$(SRCROOT)/$(PROJECT_NAME)/PrefixHeader.pch
resolved my issue. What a stupid Xcode!
pod install or pod install --repo-update should work !
For me, I removed the files in Recovered Reference folder. Then this error gone.
Fast forward to 2022, I got this error after having installed a TestFlight version and was trying to run from Xcode. I deleted the app off my phone, ran again, and was able to install successfully. I hope this helps someone!

Info.plist not copied to DerivedData causes compilation error in Xcode

I have a problem that cropped up quite recently with a project that has otherwise compiled and built just fine for over a year.
The error I receive is this:
Showing All Issues
Unable to load contents of file list: '/Users/julian/Library/Developer/Xcode/DerivedData/xxxxxxxxx/Build/Products/Debug-iphoneos/OmataRx.app/Info.plist'
There are a couple of peculiar things here.
First, my Info.plist is not named Info.plist. It is named RxInfo.plist and is indicated as such in the Build Settings Info plist File section.
Second, if I go to this directory path, there are no files there whatsoever. Empty directory. So, whatever build phase was attempting to copy the file there, did not do so. But, there is no error or warning of such a step failing.
Third, if I copy my named plist file to that directory, change the name to Info.plist, everything works fine.
Bonkers, eh?
I've tried a variety of things. I've rebuilt after cleaning, I've deintegrated and then re-installed and re-built the Pods. I've gone to Legacy Build System and attempted that. I had a colleague attempt to build from scratch on their system and they had the precise same error. This all happens on Xcode 11.6. On a whim, I tried building with Xcode 12 beta and had the precise same results.
I'm not sure what to attempt next, to be honest. And dragging-and-dropping and renaming the plist file to that Derived Data directory goes against against everything I believe. 🤣
Suggestions are greatly appreciated!

Unknown folder generated in Derived data

I have a project which was working fine till I was working on my older MacBook. I am now working on new MacBook and the same project gives me build error. My friend also works on the new MacBook with same configuration and os but he is able to build it successfully.
Error on my system is :
<unknown>:0: error: no such file or directory: '/Users/myuser/Library/Developer/Xcode/DerivedData/MyProject-dlhksnilacudcebpmorlzpzlkbid/Build/Intermediates.noindex/MyProject.build/Debug-iphoneos/MyProject.build/DerivedSources/CoreDataGenerated/Model/Model+CoreDataModel.swift'
Command CompileSwiftSources failed with a nonzero exit code
I have navigated to the path
'/Users/myuser/Library/Developer/Xcode/DerivedData/MyProject-dlhksnilacudcebpmorlzpzlkbid/Build/Intermediates.noindex/MyProject.build/Debug-iphoneos/MyProject.build/DerivedSources/CoreDataGenerated/Model'
There I found an unknown folder named "emplate" under which the required file exists.
I have searched the whole project, build settings, build phases, scripts but nowhere I found "emplate".
The CoreData entity Codegen has been specified as "Category/Extension".
Its better if you can install new version xcode or use same version of xcode which your friend is using, i think some path issues with your current xcode
I have got the solution for this. Renamed and Moved Xcode from Desktop to Applications folder, clean the project , removed DerivedData folder. And it works.

expected identifier or '(' after zipping on a windows machine

Background
I brought a project down from a GIT repository to a windows machine, zipped it up, and put it on a Google drive.
I then pulled it down to my Mac, unzipped it and where it worked before on my other Mac, I am now getting the following error.
/Users/myname/Desktop/cmh.pubweb.theapp/TheApp/TheApp-Bridging-Header.h:1:9: note: in file included from /Users/myname/Desktop/cmh.pubweb.theapp/TheApp/TheApp-Bridging-Header.h:1:
#import <Google/Analytics.h>
^
/Users/myname/Desktop/cmh.pubweb.theapp/Pods/Headers/Public/Google/Google/Analytics.h:1:1: error: expected identifier or '('
../../../../Google/Headers/Analytics.h
^
<unknown>:0: error: failed to import bridging header '/Users/myname/Desktop/cmh.pubweb.theapp/TheApp/TheApp-Bridging-Header.h'
Notables
- I am running this on xcode 9.1 whereas my other Mac had an earlier version.
- It was written in Swift 3.
What I have done
Read just about every example of this error on Stackoverflow and applied suggestions without success.
Hit google and found one example where someone had an issue with windows doing something to one of the files. I didn't quite understand what they were getting at and applying the suggested fix didn't work out.
I have deleted the entire build folder.
I have performed "Clean Build Folder" without success.
I hesitate to post this as it seems to be a very vague error that has been tackled from a dozen different directions but I am at a loss after a day of trying to hunt this down.
Any suggestions are greatly appreciated.
The general practice is to only commit the Podfile to the repository and not the Pod folder. If that is the case, you will need to setup Pods on your new mac. Make sure you have cocoapods installed and setup on your new mac and then run pod install in your project directory
Based partially on the answer posted by #Malik
Deleted the POD directory in the root of the project folder
Deleted the Podfile.lock file. (left Podfile in place)
Downloaded CocoaPods App https://cocoapods.org/app (this was due to running into cert expiration issues even though all expired certs had been removed. Seems the app deals with it.)
Installed CocoaPods to the target app.
Also changed the project explicite location in the PodFile to reflect the current location in my system.
This resolved the current issues.

Too many semantic issues. Xcode 8.2.1

I was working on a project before in Xcode 7, it perfectly compiled and ran. When I copied the entire project onto a fresh installed macOS and tried to compile in Xcode 8.2.1 I get these errors. I tried all these links listed below, none of them helped. Is there a fix to this?
Tried Solutions:
Thread 1
Thread 2
Errors:
I was working on a project before in Xcode 7, it perfectly compiled and ran. When I copied the entire project onto a fresh installed macOS and tried to compile in Xcode 8.2.1 I get these errors.
It appears that your project has external dependencies that you haven't accounted for. It's hard to say what those are without a look at the project, but the header files that Xcode is complaining about (e.g. L2SDKIPCamViewer.h, DGActivityIndicatorView.h, etc.) should provide some clues. Check the original machine to see whether it has a package manager like CocoaPods installed, and if so, which packages are installed. The project's dependencies should be documented in a README file somewhere near the top of the project's file hierarchy, but if the project was developed by you or someone in your organization, or if the developer was just too busy to bother, that might not be the case and you'll have to find and fix the dependencies one at a time.

Resources