strings command in command line tool is not doing anything - ios

I'm trying to push my code to apple. I am at the stage of validating my code in Xcode.
I am following along this post:
http://developer.xamarin.com/guides/ios/deployment,_testing,_and_metrics/app_distribution_overview/publishing_to_the_app_store/
But I receive an error saying "The app reference non-public selectors /myproject/path:artwork, command, finished, initWithSendPort
I have read that some says to run the command line tool in xcode against the dll to find the culprit like so:
strings /path/to/dllfolder.dll | grep artwork
but my app doesn't have any dll in it. After doing build against my configuration in Xamarin, the receiving folder only has myapp, myapp.dsym, myapp.exe, my app.xcent and the resources folder which is empty.
I'm stuck. What should I do?
SOLUTION:
#Rolf, I will mark your answer as the solution because part of it is what I did to solve the problem. I downloaded the latest Xamarin update, version 3.0 and then did "link all assemblies" and it worked right away.

These selectors most likely show up inside monotouch.dll. However most of these selectors are in fact documented publicly [1], those that aren't have been removed (from your list I believe initWithSendPort:receivePort:components is the only one) from future versions of Xamarin.iOS.
The current workaround is to enable the managed linker in the project's iOS Build options (set "Linker Behavior" to "Link all assemblies" or "Link SDK assemblies only"). This will remove unused code from monotouch.dll, and unless you actually use the API in question, the usage of these selectors will be removed.
[1] http://forums.xamarin.com/discussion/comment/59264/#Comment_59264

Use this option to strings:
´´´
-a
--all
- Do not scan only the initialized and loaded sections of object
files; scan the whole files.
´´´
http://www.freebsd.org/cgi/man.cgi?query=strings&sektion=1&n=1

Related

UnityFramework-Swift.h file not found

I have an error 'Lexical or Preprocessor Issue Group' with building xcode project after have built from Unity.
'UnityFramework/UnityFramework-Swift.h file not found'
I have Nice Vibration asset and FB SDK in my project. So I tried to follow this instructions in 'Building for iOS' section, but have no result https://nice-vibrations-docs.moremountains.com/platform-specifics.html#building-for-ios
I makes it with .xcworkspace, not .xcodeproj file. I have read it's right way because of FB SDK needs CocoaPods build pipeline and I should use .xcworkspace. And it's happens in XCode 12, if it matters.
What could be wrong? I spent a few hours and so still there, where I have been :(
I also ran into this issue today (although because of the Firebase SDK, not FB).
The problems seems to be with the post-build processor, which modifies the output XCode project. The NiceVibrations implementation currently only copies a single file (module.modulemap) to the build directory. Instead, we need the entire NiceVibrations/Common/Plugins/iOS/Swift directory to be copied over.
While I can't publish the entire file, I will share my modifications with you for automating this process.
Open the following file:
NiceVibrations/Common/Scripts/Editor/MMNVBuildPostProcessor.cs
Locate the WritePropertiesToFramework function and replace:
System.IO.File.Copy(privateModuleFilepath, destination);
With this:
DirectoryCopy(Path.GetDirectoryName(privateModuleFilepath), Path.GetDirectoryName(destination), true);
You can find the source code for the DirectoryCopy function from the Microsoft dotnet docs here
Edit: You will have to change the second argument of file.CopyTo to true to allow for subsequent rebuilding atop the same directory to avoid runtime errors
Additionally, I have increased the callbackOrder to 60 to ensure that this hook runs last.
I am personally using .xcodeproj instead of workspaces, but it should work fine with workspaces as well. (Firebase uses something called External dependency manager which allows you to configure your project generation preference)
After making these changes, trigger a build from unity and "replace" the target folder to update your XCode files!

Build error Xcode 10 - Multiple commands produce

I just upgraded to Xcode 10, and I suddenly face this error when I try to build, any ideas how to fix it? I tried cleaning derived data, but without any luck.
If you use CocoaPods, click Xcode menu file -> Workspace Settings , And click Build system choice Legacy Build System
If you not use CocoaPods, same of top , select Project Settings
If your app is generating the error related to the multiple .app files just like mentioned above in question then removing the .plist files from "Copy bundle Resources" WILL NOT WORK.
If the error is related to .app file then follow the following steps.
Select the Target.
Go to Build Phases tab.
Remove the items listed in Output Files
Compile the code if it compiles successfully then not follow the next steps.
If code does not compile successfully and Xcode may give you an error related to "Library not found". Then add the missing library in General Tab in Linked Frameworks and Libraries that Xcode mentioned in the error.
Keep adding these libraries (that Xcode ask through compile errors) in Linked Frameworks and Libraries until the code compiles successfully.
Hope this helps.
You can try to change the build system to Legacy,
File > Workspace Settings > Build System > Legacy Build System.
I also faced this issue in xcode 10 but it was because of adding the same framework in main project + other extensions (watchkit or siri extension etc).
I added ObjectMapper in podfile for my main project + for my extensions. When I compiled it gave me an error that multiple command produce and also shows me which framework is causing this issue. Now its working fine for me as I've removed it from my extensions I wasn't using it in my extensions.
Don't know about your issue may be you can check your podfile.
If this is CoreData related. The issue is that you are trying to generate the NSManagedObject subclass but you need to set the 'CodeGen' option to Manual/None. This option is defaulted to Class definition and this would regenerate the code thus creating this issue.
i encountered this issue as well while working with CoreData.
in my .xcdatamodeld file, it came down to the fact that, during the creation of my various Entities, i had copy and pasted one multiple times (thinking i was saving time because various properties were similar enough that i thought this was a good idea).
the resulting Build error Xcode 10 - 'Multiple commands produce' occurred because i forgot to check and make sure the new Entities were set to their own unique corresponding class to match the new Entity in the Data Model Inspector pane.
unfortunately, it took me two days to figure out the original Entity's Class Name was still in place.
so lesson: careful when you copy/paste/duplicate Entities in CoreData.
(... i guess :0} )
some time saver. oops! hope this helps someone.
I had this same issue with Core Data entity class. I had forgotten to select Codegen Manual / None because I do not allow mine to be autogenerated. So I had a class in place and also it was trying to generate one.

Undefined symbol "_OBJC_CLASS_$_CkoFtp2" link error with chilikat

When I'm writing simple code in ViewController, I wanted to run it and boom. Apple Mach-O linker error as shown. I don't know what is the problem. Then, I've made a quick research, according to research; I deleted Derived Data folder, I deleted Derived Data folder contents, I deleted test hosts in build settings(it is already empty), I cleaned the build folder and I applied clean action. But nothing changed same errors. Is there any specific solution of this error depends on app and what is that solution?
EDIT:
I moved the codes to a new xode project and I noticed that when I add the line let ftp = CkoFtp2(), the error occurs otherwise it compiles. But it is coloring the CkoFtp() part of line and I'm not getting any specific errors there. Just Match-O and linker command.You can see the CkoFtp2 code here.
I had the same issue. Please make sure to follow the directions on chilkat's site, particularly the following:
Add libChilkatCocoa.a to your list of libs for linking. In your project build settings, find Build Phases, Link Binary with Libraries, select Add Other, navigate to the libChilkatCocoa.a, and add it.
The Chilkat library internals are written in C++. Therefore, your Swift application will need to link against the C++ runtime libraries. In your Build Settings, go to the Linking section and add -lstdc++ to the Other Linker Flags.
https://www.chilkatsoft.com/chilkatSwiftCocoa.asp
I also ran into trouble because the libChilkatCocoa.a library resided in a folder that had a space in its name. Avoid that, or make sure it is correctly escaped under Build Settings.
Looks like you've got a reference to a framework located in your Downloads folder. Chances are you moved that somewhere else, yes? Remove the SimpleUnzipper framework from the project and re-add it from wherever you moved it to.
After the edits, this is clearly not the problem...
It's hard to tell from just the error message, but it appears that you're using a library that you downloaded from another developer. Are you sure you followed their instructions for setting things up? The linker error means that you're not linking your program with the library, though it looks like you've managed to set up a bridging header so that you can call the function without getting a compiler error.

XCode won't use the latest version of my framework

I have a framework which is consumed by a DYLIB, and even though I have updated the framework XCode is still looking at an older version.
I have verified the framework being referred to by XCode is correct, and can use a hex editor to see the version string inside it is correct (.32). I have made a separate test app (that does not use a DYLIB) and I can consume the same framework (in the same location) without any issue.
I can even build my DYLIB fine w/o issue, and can see it is using the latest header files. However at run time I can see it is using an older version of the framework (.31) due to the logging used. I can also look inside the binary of the linked DYLIB and see this old string.
The funny thing is if I rename the framework binary, the DYLIB will still build (the test program will fail to link which is what expected), so it is used an older version somewhere.
I have tried regular Clean, "clean build folder", and also deleting the derived data directory (rm -rf ~/library/Developer/Xcode/DerivedData/*). I've also restarted XCode and my machine, and still getting this problem.
I've also tried deleting the library reference and re-adding it, which didn't help either. I've verified the directory is correct by looking at the build line used by clang.
I can't figure out where the heck XCode is reading the old version of the framework from.
If you check "frameworks search paths" under your target settings, do you see any paths you have not checked? Searching framework across OS returns only one possible reference?

Weird Xcode linker error

I'm getting this Xcode error:
ld: warning: directory not found for option '-L/Volumes/Macintosh HD2/Users/dgd/Dropbox/Websites/iCalTools.com/CalendarFilter/iCal'
ld: warning: directory not found for option '-LFilter/TestFlightSDK3.0.0'
ld: library not found for -lTestFlight
clang: error: linker command failed with exit code 1 (use -v to see invocation)
My code is at this path:
/Volumes/Macintosh HD2/Users/dgd/Dropbox/Websites/iCalTools.com/CalendarFilter/iCal Filter
and it appears Xcode is choking on the 2nd blank for some reason and incorrectly splitting the path to TestFlight.
The really strange part is if I delete the TestFlight API and it's Library Search Paths, then add it back in, it compiles and runs fine, even though the library search paths appear to be broken at the space still:
Everything continues to work until I close the project and reopen it. Then I have to remove and readd TestFlight again.
(One more note, I tried to remove the blank from the directory but ran into so many more Xcode and git problems trying to rename it that I gave up and reverted back. At some point during that process I ended up with exactly the same problem with Xcode choking on the blank in "Macintosh HD2" instead)
EDIT
I emailed TestFlight support about this issue and received the response below which fixed the problem. I had tried most of these steps before except for deleting the files from disk (I did have several old copies of TestFlight on disk, but not in the project) and possibly checking the Copy Items box. I still don't know what the problem really was and consider this a workaround, so I'm not adding this as an answer. Maybe someone will be able to explain what's going on here.
Sorry for the trouble.
These errors usually come up if there are issues with the Library Search Paths. Please remove the "Filter/TestFlightSDK3.0.0" line and then do the following:
Open Xcode and select all the TestFlight SDK files in your project (libTestFlight.a, TestFlight.h, TestFlight+AsyncLogging.h, TestFlight+ManualSessions.h)
Delete all the selected files by choosing the move to trash option
Open your project in Finder (Right click the main project folder and select show in finder)
Double check for TestFlight SDK files and delete any found.
Download the TestFlight SDK v3 again and extract the zip
Drag and drop the contents of the SDK folder into your project. At the adding files prompt, check off the defaults (Copy items, Create groups, add target)
Clean the build and attempt to create a new IPA
Try using quotation marks to separate items in the path.
$(inherited) "$(SRCROOT)" "$(SRCROOT)/../Dependencies/Frameworks"/** "$(SRCROOT)/MobileAppTracking-ios" "$(SYSTEM_APPS_DIR)/Reveal.app/Contents/SharedSupport/iOS-Libraries"
I have a project where our Framework search path looks like the above. That may help with paths that have spaces. If all else fails, can you try escaping spaces or moving your libraries to a path that does not include a space?
For paths in Xcode containing blanks just put quotes around the path (same for all settings that take paths: includes, search paths, etc.
"/Volumes/Mac HD/Users/The Count of Tuscany/Source/My Stuff/"
I got the same type of issues with it.
Just go to Build Settings. Type "search path" in the search box provided. Then see the references for your third party library. Delete the values.
Now go to your project file menu which displays your program files. Then delete the third party libraries for which you have linker errors. Make sure to backup these, as you'll need them in next step.
Now drag the same libraries you have in other folder or backup folder into your xcode project.
Now build.
I solved the same by the above steps. It usually happens when you move your xcode project from from one user/ mac to another. Or else if the libraries are missing as per the references.

Resources