tweag / ignite-action-extension-example

Example of writing action extensions with in a React Native app using Ignite
4 stars 1 forks source link

Linker error when using ActionExtension #2

Closed shaneosullivan closed 7 years ago

shaneosullivan commented 7 years ago

I've been following the instructions for building an Action Extension with React Native at https://www.promptworks.com/blog/building-ios-app-extensions-with-react-native, and everything went fine until the ActionExtension part.

When I create ActionExtension.h and ActionExtension.m, the compilation breaks with the error:

Undefined symbols for architecture x86_64:
  "_actionViewController", referenced from:
      -[ActionExtension done] in ActionExtension.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Details: React Native version 0.48.1 XCode Version 8.3.3 I have ensured that ActionExtension.m is built for both targets, as in the instructions. The problem seems to stem from the fact that ActionExtension.m cannot see the actionViewController property that we have attempted to expose publicly.

My code, in it's current failing-to-build state is on Github at https://github.com/shaneosullivan/ReactNativeExampleBrowserExtension . The problem can be seen by checking out the code, running npm install then trying to build it.

shaneosullivan commented 7 years ago

I figured it out. It turns out that I needed to add ActionViewController.m to the compile sources of both targets for it to compile separately. Perhaps it's worth updating the instructions to say so?

patricksmith commented 7 years ago

@shaneosullivan Thanks for reporting back with the fix!

swyxio commented 7 years ago

agreed, i faced this too

ahtisham09 commented 3 years ago

@patricksmith did you fixed this issue

ahtisham09 commented 3 years ago

@patricksmith can you please update the documentation with latest version of React Native its will really helpful Thanks