Closed shinichy closed 1 year ago
Thanks, your analysis is very helpful. This may be something new to Xcode 14 or changes to the build system. Are you able to tell me what the fle /Users/shinichikatayama/Library/Developer/Xcode/DerivedData/Willow-fejpcchmllftwnfisuhvzbtspwue/Logs/Build/LogStoreManifest.plist contains or send it to me at github at johnholdsworth.com ? you should be able to "open" it in Xcode. There are no other files in that directory?
Sure. The content is below. And that's the only file in the directory.
❯ cat /Users/shinichikatayama/Library/Developer/Xcode/DerivedData/Willow-fejpcchmllftwnfisuhvzbtspwue/Logs/Build/LogStoreManifest.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>logFormatVersion</key>
<integer>10</integer>
<key>logs</key>
<dict/>
</dict>
</plist>
Interesting, that's not very useful at all about where the missing logs have gone! I notice, like the other times we've seen a similar problem you're running quite an old simulator OS. Is it possible to change the targeted iOS version to something more recent and see if that works? Otherwise I can take a look if you have, for example TeamView or hangouts.
Could you run this command?
find /Users/shinichikatayama/Library/Developer/Xcode/DerivedData/Willow-fejpcchmllftwnfisuhvzbtspwue -name '*.xcactivitylog' -print
find /Users/shinichikatayama/Library/Developer/Xcode/DerivedData/Willow-fejpcchmllftwnfisuhvzbtspwue -name '*.xcactivitylog' -print
doesn't output anything.
Surprisingly, it starts working well after I restart Xcode. I have no idea... Anyway, thanks for helping me! I'll reopen this issue when I hit this again.
Thanks for getting back, good that you're up and running. Newer versions of Xcode are more proactive about removing build logs and it seems you can get into a situation where your app runs but there are no build logs for Injection to use to work out how to recompile the updated source file. You should be able to get out of this state by making a change to a file to force a build and re-run.
Thanks also for opening this issue. It promoted me to go back and finally work out what was the cause (simulator < iOS14 on M1 Mac) of the other two issues I mentioned. I tightened up the code and put in new warnings to provide a hint for users when things are failing and rolled a new 4.4.1 release.
I'm still experiencing this using HotReloading 4.5.3. Based on an issue over there that links here, it seems like it supposedly happens:
occurs when you use a simulator < iOS14 on an M1/2 due to these simulators not having arm architecture available
I'm on an M1 Mac running on an iOS 16 simulator on Xcode 14, but I'm still getting this same error. Now, I was having some other issues with our dependencies not supporting the arm64 simulator -- I tried a few things like running with Rosetta and all, but I eventually just removed those and should be using the arm64 simulator like normal.
Following your instructions above, I am getting logs, and there does seem to be more information in the log store manifest.
I have gotten injection working on this project before. I'm trying to integrate HotReloading, though, so that developers on my team don't need to manually install the InjectionIII.app in order to use it. I'd like to get some setup where "it just works."
Hi, when you say "this" issue. What exactly do you mean? The generic "Can't locate compile command..." error which can have many causes including having () characters in the path to the project or case sensitivity in file paths for example. You're saying the injection app has worked on this same project in the past but HotReloading not? The code is the same except HotReloading works from inside the simulator which introduces case sensitivity in the simulator file system which is most likely the problem.
Right, "the issue" is the generic "Can't locate compile command..." error message with the multiple different options.
I thought it was the same because:
This could be due to one of the following:
- Injection does not work with Whole Module Optimization.
We're not doing this
- There are restrictions on characters allowed in paths.
As far as I can tell there shouldn't be any non-ascii characters in our paths
- File paths in the simulator are case sensitive.
Seems like this is the one you are suspecting? Should everything be lowercase, or...? I'm not sure how filenames/paths would change case in the simulator to cause issues here. I know nothing of the process, so maybe this is the issue, but nothing seemed immediately obvious to me.
- The modified source file is not in the current project.
Nope.
- The source file is an XCTest that has not been run yet.
Nope
- Xcode has removed the build logs. Edit a file and re-run.
Seemingly not? The logs appear up there, as I've posted.
So maybe you're right, maybe it is the case issue. I'm not sure what I need to change to fix it, though?
You're saying the injection app has worked on this same project in the past but HotReloading not? The code is the same except HotReloading works from inside the simulator which introduces case sensitivity in the simulator file system which is most likely the problem.
Yes exactly, the Injection app has worked beautifully, and so I was hoping to get HotReloading working in the project so "it just works" for everyone else without manual setup.
Thanks for the insight that this probably points to a case sensitivity issue.
You can chase it down by running the command.sh from the command line using $ bash Githubissues.
Hi, I'm trying to run InjectionIII, but I can't make it work in my iOS UIKit project. I keep getting
Could not locate compile command
error. I tried cleaning and rebuilding, but it didn't work. I checked that Whole Module Optimization is turned off. It would be great if I could borrow someone's help. Thanks.The content of the command.sh.
When I run the command.sh, it fails with the following error.
There's no xcactivitylog file in the directory. Is this an issue?
My environment.
I confirmed that the Getting Started project works. So I'll try to check what prevents me from using InjectionIII.