Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#import React/RCTBridgeModule.h not found #16

Open
AndreiArba opened this issue Mar 25, 2019 · 5 comments
Open

#import React/RCTBridgeModule.h not found #16

AndreiArba opened this issue Mar 25, 2019 · 5 comments

Comments

@AndreiArba
Copy link

AndreiArba commented Mar 25, 2019

Hello,

While integrating this library on ios with react-native ~0.57, I reached the same issue as described in this isssue #8.
After manually adding the .framework folder in node_modules, I'm having an import React/RCTBridgeModule.h not found in RNWikitude.h:15. Did anyone else encounter this issue?
Thanks in advance,

Andrei

@AndreiArba
Copy link
Author

Later on, I figured out the above was related to Header Search Path of the RNWikitude subproject. However, after fixing that, I'm getting another error that suggests the manual linking had no effect:

Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_WTArchitectView", referenced from:
      objc-class-ref in libRNWikitude.a(ARViewController.o)
ld: symbol(s) not found for architecture x86_64

Was anyone able to get this working on ios?

Thanks

@AndreiArba
Copy link
Author

Ok, I was able to make it work in the end - I will publish tomorrow a full guide to save others from going through the same process.

@AndreiArba
Copy link
Author

AndreiArba commented Mar 27, 2019

As the react-native link won't really work on ios,
here is a complete list of steps to manually link this library.

1. npm install react-native-wikitude
2. cd ios && pod install
3. download WikitudeSDK.framework from wikitude website
4. add it to xcode frameworks
5. copy it in your ios project sources as well
6. manually drag the RNWikitude.xcodeproj from node_modules/react-native-wikitude/RNWikitude/ folder to xcode Libraries folder(create one if you don't have it)
7. select RNWikitude.xcodeproj as build target
8. Go to build settings - search for Header Search Path
9. Add new entry for path_to_project/ios/Pods/Headers/Public/React - non-recursive
10. Add another entry for path_to_project/ios/Pods/Headers/Public/React/React - non-recursive
11. Another last entry for path_to_project/ios/WikitudeSDK.framework/Headers (copied at step 4)
12. At run targets - select RNWikitude - and build (at this point, you'll notice the libRNWikitude.a file in RNWikitude/Products is not red anymore)
13. select back your project as build target
14. Go to build phases
15. Drag your libRNWikitude.a to your "Link Binary with Libraries" section
16. Go to General tab
17. drag your WikitudeSDK.framework to Embedded Binaries
18. remove WikitudeSDK.framework entry that is automatically added in LinkedFramework and Libraries after the previous step
19. Go to build settings - search for Header Search Path
20. Add new entry for path_to_project/ios/Pods/Headers/Public/React - non-recursive
21. Add another entry for path_to_project/ios/Pods/Headers/Public/React/React - non-recursive
22. Another last entry for path_to_project/ios/WikitudeSDK.framework/Headers (copied at step 4) 
23. search for Framework Search Path
24. Add the path_to_project/ios/WikitudeSDK.framework
25. now build again your project and it should work with the react-native-wikitude linked

*if you encounter any issues at build - choose Product -> clean your build folder and rebuild

*if the issue persists: close xcode, rm -rf ~/Library/Developer/Xcode/DerivedData, reopen xcode and build

I hope it's less painful now, using these steps.

@saurabhd
Copy link

saurabhd commented Aug 8, 2019

Hey @AndreiArba - thanks for providing detailed notes and steps but unfortunately they did not work for me.

I am facing below issues with React Native version 0.60.4. Below are my pointers:

  1. React Native version > 0.60 uses POD to generate the iOS build.
  2. Seems like the Wikitude packages has not been managed from last 10 months and therefore does not support latest React Native version.
  3. Seems like we need to manually link the package but unfortunately that results in error #import React/RCTBridgeModule.h not found at build time..

@MichaelPote @JanOwiesniak @FJLessing - please provide any resolutions for this. Thanks a lot.

@ali-tit
Copy link

ali-tit commented Jan 12, 2021

Hi ! here is my workaround

    • yarn add react-native-wikitude
    • npx react-native link react-native-wikitude
    • download the JavaScript API then copy WikitudeSDK.framework to ios/ folder
    • then make a copy of WikitudeSDK.framework into node_modules/react-native-wikitude/ios/RNWikitude/
    • open xcode, add files to Frameworks folder and select the previously copied ios/WikitudeSDK.framework
    • now drag the WikitudeSDK.framework from Frameworksfolder to Frameworks, Librairies and Embeded content
    • in Frameworks, Librairies and Embeded content remove the libRNWikitude.a and then re-added it again ( it should have a real icon now )
    • in Build phases -> Link Binary with Libraries make sure & WikitudeSDK.framework is in the list ( if it is not the case drag & drop from Frameworks folder )
    • under Build Settings -> Architectures -> Architectures change the $(ARCHS_STANDARD) to $(ARCHS_STANDARD_64_BIT) because WikitudeSdk is not supporting old architecture anymore

i'm using react-native 0.59, xcode 11, WikitudeSDK 9.5
hope it helps !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants