Unexpected '#' in program Xcode 7 and Receigen - xcode

I just updated to Xcode 7.0 last night and it seems to have broken Receigen's generated code.
CFStringRef ReceiptValidation_str1 = #obfuscateCF#("");
Unexpected '#' in program
Receigen hasn't been updated since 2014, so this is almost certainly an Xcode 7 issue.
I reached out to the developer of Receigen and haven't heard back yet (it has only been a few hours). Any help would be appreciated.

In your Xcode Target, tab "Build Phases", edit your Receigen shell script. Replace the declaration EXPANDED_BUNDLE_ID that looked like:
EXPANDED_BUNDLE_ID=`eval \"echo $BUNDLE_ID\"
simply by the variable PRODUCT_BUNDLE_IDENTIFIER (introduced in Xcode 7)
EXPANDED_BUNDLE_ID=$PRODUCT_BUNDLE_IDENTIFIER
(you can also delete the old, now needless, declaration of BUNDLE_ID)
Your script should look like this:
# Receigen binary
RECEIGEN="/Applications/Receigen.app/Contents/MacOS/Receigen"
# Extract Info.plist information
INPUT="$INFOPLIST_FILE"
BUNDLE_VERSION=`/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" "$INPUT"`
# Expand information if needed
EXPANDED_BUNDLE_ID=$PRODUCT_BUNDLE_IDENTIFIER
EXPANDED_BUNDLE_VERSION=`eval "echo $BUNDLE_VERSION"`
# ...etc...
Note: found this thanks to #mcgyver42's answer and this question

See "Get Bundle ID from build settings instead of info.plist". I think it's the same issue, and I posted a work-around.
Xcode Script - Get Bundle ID from build settings instead of info.plist

Related

Throwing error while debug and run PO command in Xcode 12

When I am running application on simulator or device and try to use PO command during debug. Xcode is throwing error instead of printing value. It is happening after I have updated Xcode 12.
error: virtual filesystem overlay file
/all-product-headers.yaml' not found
error: couldn't IRGen expression. Please check the above error messages for possible root causes.
What is the solution for this ?
Any help would be appreciated.
Go to /Users/<YOUR_USER>/Library/Developer/Xcode/ and delete "DerivedData" folder.
If in the path of the missing file is the name of a framework e.g. Usabilla.build/Release-iphonesimulator/Usabilla.build/all-product-headers.yaml
Try using an older version, using version 6.4.7 of Usabilla fixed the issue for me.
If the above fixes don't work, here are some info that might help:
https://steipete.com/posts/couldnt-irgen-expression/

Xcode 9.3 Playground - diagnosticd

I noticed every time I launch a Playground in Xcode (version 9.3) a daemon starts in the background and uses more that 100% of my CPU!
I deleted Xcode's cache and its DerivedData folder but no change.
Does anyone know how to resolve this problem?
diagnosticd is a daemon you need to stop/kill with launchctl. The daemon you most likely need to stop has 'SimDevice' in its name. To get the exact name do:
/bin/launchctl list | grep SimDevice
Then with the appropriate name(s) (there could be more than 1) do:
/bin/launchctl stop 'name'
In my case 'name' was: com.apple.CoreSimulator.SimDevice.380EFF06-B636-49CD-851E-5DB4890641AE
If you use Playground a lot and you usually have more than 1 simulator eating your CPU run this script instead:
/bin/launchctl list | grep SimDevice | awk '{print $3}' | xargs -I %s /bin/launchctl stop %s
Oh, and dont forget to file a bug report with apple here: https://bugreport.apple.com/web/
Btw, its kinda fun to see playground/diagnosticd struggle with your code; if you create a bug or some other elaborate syntax, cpu goes up. If you clear it, cpu goes down (just a bit). Almost hilarious how Apple implemented this...
As a temporary workaround, I run this script after starting up a playground to kill the rogue diagnosticd and homed processes:
#!/bin/bash
kill $(ps -ef | grep Xcode.app | egrep "diagnosticd|homed" | awk '{ print $2 }')
Edit: This seems to be a problem with iOS playgrounds only, so another (less drastic) workaround is to use a macOS playgrounds for those cases where no UIKit components are needed.
2nd Edit: This bug appears to be fixed in Xcode 9.3.1 (available via MAS or direct download from developer.apple.com)
3rd Edit: 9.3.1 doesn't fully fix this, despite what the Release Notes say. According to the comments in my bug report, this is only be fully fixed in 9.4.
Get Xcode 9.4 Beta. It resolved my issue.
killing homed is not good solution and playground is not acting correctly anyway.
Had same issue and there was no way around it. People filed bugs as far back as April 8th.
Best solution is to download Xcode 9.4 Beta from Apple Developer Page.
This worked for me and CPU usage is low and Xcode doesn't crash on playgrounds anymore.
I also had the same issue with Xcode v 11.2.1(11B53)
It seems the issue happened after updating Mac OS and Xcode.
I found out that diagnosticd has something to do with Xcode simulators.
So I tried to Erase All Content and Settings... in Simulator menu.
Please refer to above picture.
After erasing all content and settings the issue was resolved. :D
This is a known bug, attributed by Apple to “over-enthusiastic logging by the MediaRemote subsystem”. There is no official workaround at this time.
See https://forums.developer.apple.com/message/305885
Same problem here, the only temporary solution I found was to kill 'homed', which was flooding the system with errors like
MediaRemote reply error: <error: 0x11162ed20> { count = 1, transaction: 0, voucher = 0x0, contents =
"XPCErrorDescription" => <string: 0x11162efc8> { length = 18, contents = "Connection invalid" }
}
I suppose diagnosticd, designed to report errors automatically, simply went in overdrive mode.
That's all I have for now...

xcodebuild (XCode 7.1) - unexpected successful exit code from cancelled command

I'm getting the following during the bundle resources copying phase in xcodebuild (XCode 7.1):
2015-11-03 22:16:28.218 xcodebuild[28202:300463] DVTAssertions:
Warning in
/Library/Caches/com.apple.xbs/Sources/IDEXcode3ProjectSupport/IDEXcode3ProjectSupport-9061/Xcode3Core/LegacyProjects/Frameworks/DevToolsCore/DevToolsCore/BuildSystem/Runtime/PBXTargetBuildContext.mm:739
Details: unexpected successful exit code from cancelled command
<C0505:'CpResource Foo.json':P10> Object: <PBXTargetBuildContext:
0x7faec015a440> Method:
-createCommandInvocationRecordFromInvocation: Thread: <NSThread: 0x7faebc8cc070>{number = 10, name = (null)} Please file a bug at
http://bugreport.apple.com with this warning message and any useful
information you can provide.
I have ~170 items I'm copying, but for some reason a few of them give me this error.
EDIT - I just ran the command again and now it works, so it doesn't seem deterministic.
The issue was a duplicate folder in the Copy Bundle Resources section. It used to be two different files, but they were moved so XCode decided to change them both to the folder they got moved into. Go figure.
Had this issue a couple of months ago. Today that error made it's comback.
I have it only if I try to emulate from ionic (--livereload) on a iOS-Device. Seem like if you have Xcode running it occurs. Close Xcode. That fixes it.

Mac OS X 10.10 merge tool git bugs

When I am attempting to use git mergetool I get the following errors.
Normal merge conflict for 'application/language/dutch/config_lang.php':
{local}: modified file
{remote}: modified file
Hit return to start merge resolution tool (opendiff):
2014-10-16 16:30:02.996 FileMerge[42541:5140761] Failed to connect (delegate) outlet from (DiffController) to (DiffController): missing setter or instance variable
2014-10-16 16:30:02.997 FileMerge[42541:5140761] Failed to connect (mainPrefPane) outlet from (DiffController) to (NSBox): missing setter or instance variable
2014-10-16 16:30:03.071 FileMerge[42541:5140761] Unable to load platform at path /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform
2014-10-16 16:30:03.072 FileMerge[42541:5140761] Unable to load platform at path /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform
What can I do to fix this? The tool launches but I cannot continue after the first file.
NOTE: This error is intermittent, but happens most of the time.
cd /Applications/Xcode.app/Contents/Developer/Platforms
plutil -convert xml1 iPhoneOS.platform/Info.plist
plutil -convert xml1 iPhoneSimulator.platform/Info.plist
This fixes the 2nd set of warnings. This has been an issue since 10.8,
but apple ignores my bug report :)
I see the same behavior after upgrading from 10.9. According to this answer, delete both iPhoneOS.platform and iPhoneSimulator.platform. Or reinstall them properly from XCode if you need them. The former worked for me.

Resurrecting old PLT-Scheme project (pre-1999)

I'm trying to resurrect an old (1999 or earlier) project written in Scheme (PLT-Scheme, using the mzscheme interpreter (?) commandline tool). To make the matters worse, I don't know Scheme, or Lisp (in fact, I want to learn, but that's another story).
I have the source code of the project at:
github.com/akavel/sherman
Now, when running the code, it bails out with an error message like below:
Sherman runtime version 0.5
Hosted on MzScheme version 52, Copyright (c) 1995-98 PLT (Matthew Flatt)
reference to undefined identifier: list->block
(I've tried PLT-Scheme versions 52, 53, 103, 103p1. Earlier versions don't allow mzscheme -L option, which is referenced in the sherman.bat script used in the project. Later versions also have some more serious problems with the code or options.)
The difficulty is, that from what I see, list->block actually is defined - see: collects/sherman/BLOCK.SS line 48. So, what is wrong?
To run the code, I perform the following steps:
Download PLT-Scheme v. 103p1 (from the old versions download page - first closing the "PLT Scheme is now Racket" banner) - for Windows, use: mz-103p1-bin-i386-win32.zip.
Unzip (e.g. to directory c:\PLT).
Copy c:\sherman\collects\sherman directory with contents to: c:\PLT\collects\sherman (where c:\sherman contains the contents of the github repository).
Run cmd.exe, then cd c:\sherman.
set PATH=c:\PLT;%PATH%
sherman.bat run trivial.s
this command is in fact, from what I understand, equivalent to:
(require-library "runtime.ss" "sherman")
(parameterize ((current-namespace sherman-namespace)) (load "trivial.s"))
(current-namespace sherman-namespace)
After that, I get the error as described above (MzScheme version would be reported as 103p1 or whatever).
Could you help me solve the problem?
EDIT 2: SOLVED!
To whom it may concern, I've added a fully fledged "How to use this project" instruction on the project page, detailing the solution to the problem thanks to soegaard's help.
In short:
copy trivial.s trivial.rs
rem (the above is workaround for problems with 'r2s.exe < trivial.r > trivial.rs')
sherman.bat compile trivial.rs
sherman.bat run trivial.zo
rem (or: sherman.bat run trivial.ss)
Not an answer, but a few notes too big for a comment.
1. Sanity Check
The error message says list->block is undefined.
Make sure that the code in block.ss is run, by
inserting (display "block.ss is loaded!") in block.ss
just to make sure, the code is run.
2. Random Thoughts
The file blocks.ss begins with:
(require-library "functios.ss")
(require-library "synrule.ss")
(require-library "stream.ss" "sherman")
The file "sherman/stream.ss" is in the repository,
but where is "synrule.ss" and "functios.ss" ?
Ah... This code is old! Here is a description of
how require-library worked. It lists functios.ss
and synrule.ss as part of MzLib.
http://www.informatik.uni-kiel.de/~scheme/doc/mzscheme/node158.htm
Let's check out how require-library worked:
When require-library is used to load a file, the library name and the
resulting value(s) are recored in a table associated with the current
namespace. If require-library is evaluated for a library that is
already registered in the current namespace's load table, then the
library is not loaded again; the result(s) recorded in the load table
is returned, instead.
So when the code in block.ss is run, the names are stored in a namespace. If the current namespace is the wrong one, when the code in block.ss is evaluated, it would explain you error message of list->block being undefined.

Resources