johnno1962 / injectionforxcode

Runtime Code Injection for Objective-C & Swift
MIT License
6.55k stars 565 forks source link

Symbol not found: __llvm_gcda_emit_arcs #275

Open davisford opened 5 years ago

davisford commented 5 years ago

Hi, I'm using XCode 10.1

I had hit #274 and so I turned off test coverage in the scheme.

screen shot 2019-02-21 at 3 42 37 pm

Now, I'm hitting this:

💉 *** Compiling /Users/dford/git/myproject/Classes/Controllers/AppUpdateViewController.m ***
💉 Loading .dylib - Ignore any duplicate class warning...
💉 *** dlopen() error: dlopen(/Users/dford/Library/Containers/com.johnholdsworth.InjectionIII/Data/eval101.dylib, 2): Symbol not found: _llvm_gcda_emit_arcs
  Referenced from: /Users/dford/Library/Containers/com.johnholdsworth.InjectionIII/Data/eval101.dylib
  Expected in: flat namespace

So I tried turning off coverage in the linker settings, to no avail. Any idea how to work past this issue?

screen shot 2019-02-21 at 3 24 30 pm
davisford commented 5 years ago

Also did a full clean and rebuild, to no avail.

johnno1962 commented 5 years ago

Not encountered this exact error before, You may not be able to inject that file. Any ideas @zenangst?

zenangst commented 5 years ago

This is a new one for me, but then again I only use Swift these days. @davisford you reckon that this could be replicated in an example project so that we could try it out and test it in isolation?

davisford commented 5 years ago

I now realize that I posted this in the old injection repo. I am using InjectionIII I believe. I installed it via the App Store on Mojave. Does that make a difference at all? I can look at trying to create a demo project.

HighwayLaw commented 5 years ago

I have solved this by setting GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = NO GCC_GENERATE_TEST_COVERAGE_FILES = NO. If you don't need code coverage, this would be a good way. @davisford @johnno1962 @zenangst

johnno1962 commented 5 years ago

Thanks for letting us know @lhwcqu. It was a bit of a mystery. What version of Xcode is this?

HighwayLaw commented 5 years ago

Thanks for letting us know @lhwcqu. It was a bit of a mystery. What version of Xcode is this?

That's all right. Am using Xcode 10.2.1