viromedia / viro

ViroReact: AR and VR using React Native
MIT License
2.28k stars 481 forks source link

Looks like viro is dead for ios till update #852

Open ghost opened 4 years ago

ghost commented 4 years ago

ITMS-90809: Deprecated API Usage - Apple will no longer accept submissions of new apps that use UIWebView as of April 30, 2020 and app updates that use UIWebView as of December 2020. Instead, use WKWebView for improved security and reliability. Learn more ( https://developer.apple.com/documentation/uikit/uiwebview ).

react-viro uses UIWebView component, so since April 30 2020 it's will be rejected by apple, when you are trying to publish it.

haider792 commented 3 years ago

@gbalduzzi @Cosmitar can you help me out in this.

dyld: Symbol not found: _OBJCCLASS$_WKWebView

i have linked the webKit but still its showing the issue. can you please guide.

haider792 commented 3 years ago

@Cosmitar can you please help me out in this issue. i am stuck on this for long time

haider792 commented 3 years ago

@gbalduzzi ?

Cosmitar commented 3 years ago

@haider792 Is hard to say with just one line of error description, I googled it and looks like a configuration issue between versions of ios and web view component (it's my interpretation). Doesn't look like an error related to Viro itself and I can't say much more about that.

haider792 commented 3 years ago
Screenshot 2020-11-09 at 5 23 00 PM

@Cosmitar i tried the repo of the @gbalduzzi shared with us but it showing this error you have any clue about this? please

haider792 commented 3 years ago

@Cosmitar can you do a favour. might it will be helpful for many. can you please share the structure of the application including node_module. i know it is very difficult for you to do because its time taking. but it will be very helpfull for me as i am stuck in it for long time. or can you define the process step by step so i can do it and integrate directly. it will be very helpfull for me. having a tough time on it. Thanks .

haider792 commented 3 years ago

if you can send me your email so we can have some private discussion please. @Cosmitar @gbalduzzi

costerik commented 3 years ago

Hey @ManigandanRaamanathan, It seems the Mendix PR was merged on to master Should I use the master branch? Any advice? Thanks!

This is my result on Android after I run npx react-native run-android,

* What went wrong:
Could not determine the dependencies of task ':app:preDebugBuild'.
> Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
   > Could not resolve project :react-viro.
     Required by:
         project :app
      > Unable to find a matching configuration of project :react-viro:
          - None of the consumable configurations have attributes.

iOS works

This is the output for grep -r UIWebView node_modules/*

node_modules/create-react-class/node_modules/fbjs/lib/UserAgent.js.flow:   * - UIWebView
node_modules/create-react-class/node_modules/fbjs/lib/UserAgent.js:   * - UIWebView
node_modules/fbjs/lib/UserAgent.js.flow:   * - UIWebView
node_modules/fbjs/lib/UserAgent.js:   * - UIWebView
node_modules/jsc-android/dist/include/JSContextPrivate.h:/*! @abstract The delegate the context will use when trying to load a module. Note, this delegate will be ignored for contexts returned by UIWebView. */
node_modules/react-native-fbsdk/js/FBShareDialog.js:   * Displays the dialog in a UIWebView within the app.
Binary file node_modules/react-native-maps/.gradle/4.10.3/taskHistory/taskHistory.bin matches
node_modules/react-native-webview/README.md:- [7.0.1](https://github.com/react-native-community/react-native-webview/releases/tag/v7.0.1) - Removed UIWebView
Binary file node_modules/react-viro/ios/dist/ViroRenderer/static_lib/ViroKit_static_lib.framework/ViroKit_static_lib matches
Binary file node_modules/react-viro/ios/dist/ViroRenderer/static_lib/x86_64/ViroKit_static_lib.framework/ViroKit_static_lib matches
Binary file node_modules/react-viro/ios/dist/ViroRenderer/ViroKit.framework/ViroKit matches
Binary file node_modules/react-viro/ios/dist/ViroRenderer/x86_64/ViroKit.framework/ViroKit matches
node_modules/ua-parser-js/test/browser-test.json:        "ua"      : "Mozilla/5.0 (iPhone; CPU iPhone OS 10_0_2 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) Mobile/14A456 QQ/6.5.3.410 V1_IPH_SQ_6.5.3_1_APP_A Pixel/1080 Core/UIWebView NetType/WIFI Mem/26",

This is my setup

System:
    OS: macOS 10.15.6
    CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 348.93 MB / 16.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 10.15.2 - ~/.nvm/versions/node/v10.15.2/bin/node
    Yarn: 1.22.4 - /usr/local/bin/yarn
    npm: 6.4.1 - ~/.nvm/versions/node/v10.15.2/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: iOS 13.6, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
  IDEs:
    Android Studio: 4.0 AI-193.6911.18.40.6626763
    Xcode: 11.6/11E708 - /usr/bin/xcodebuild
  npmPackages:
    react: 16.9.0 => 16.9.0
    react-native: 0.61.5 => 0.61.5
costerik commented 3 years ago

Good news - Viro not dead for iOS! Making some further changes to the Viro source to get the static library compiling with no GVR (Viro in AR only mode), I was able to successfully upload to Apple/Testflight to get past the UIWebView blocker. Total hack, but happy to share what worked.

I'm now successfully using RN 0.62.2 and have Viro static library working great with no UIWebViews.

Note that below I'm using a temporary viro fork. This could be merged back to main if it meets the quality bar. I can't maintain a fork, I just want to contribute to viro. Below will take a couple of hours to figure out the details... it's taken me days to get this working, so I may be missing key steps.

Gist:

Part 1: Build the static lib with no GVR UIWebView:

  1. Clone my Viro repo git clone https://github.com/ktemby/viro (hacked edits to remove GVR from static library target, I make no claims to have quality tested properly, especially for Android).
  2. Build viro (from the viro folder, cd ios, pod install, then open ViroReact.xcworkspace in Xcode and build all the targets, the 'static lib' target last)

Part 2: Get your project to use my viro temp fork

  1. Remove Viro from your current project npm uninstall react-viro
  2. Install my github fork npm install git+https://github.com/ktemby/viro
  3. Clear your build folder by doing a clean build of your app.

Part 3: Copy the locally built static library over to your project

  1. Go back to where you built viro, we'll be copying the 'dist' (the static library files) over.
  2. cp /viro/ios/dist/* ~<your project in part 2>/node_modules/react-viro/ios/dist/
  3. Why? Because the static library files that I built won't upload to my repo (they're too large).

Part 4: Rebuild your app with the updated library

  1. Go back to your app directory.
  2. Ensure you're using the static lib in your Podfile (see https://docs.viromedia.com/docs/no_use_frameworks)
  3. Do pod install first from the ios folder.
  4. Now build in xcode or with NPX.
  5. Enjoy seeing your AR functionality now working in your app!
  6. Upload to Apple and enjoy the feeling of not being rejected due to UIWebView.

Next steps?

I can post a sample RN 0.62.2 + Viro project with key configurations on the weekend if more details needed.

Takeaway - I was able to get this to work, and successfully submitted to Apple, but the quality of my effort is a way lower bar than you want, so please proceed with caution and understand my good intentions for sharing what worked for me is no replacement for your own diligence!

Hey, @ktemby thanks in advance for this. I took these steps,

  1. Clone the repo git clone https://github.com/ktemby/viro.

  2. Run the commands yarn && npx pod-install ios

  3. Open ViroReact.xcworkspace

  4. Select ViroReact target and then select Any iOS device (arm64) and build the selected target.

    Screen Shot 2020-11-20 at 4 03 48 PM
  5. Select ViroReact_release_tests and then select Any iOS device (arm64) and build the selected target.

    Screen Shot 2020-11-20 at 4 07 00 PM
  6. Select ViroReact_static_lib and then select Any iOS device (arm64) and build the selected target.

    Screen Shot 2020-11-20 at 4 11 29 PM

On my project

  1. yarn remove react-viro
  2. yarn add git+https://github.com/ktemby/viro
  3. open my xcworkspace project and then run clean build folder(shift + command + k)
  4. run cp -rf ../viro/ios/dist/* node_modules/react-viro/ios/dist
  5. run npx pod-install ios
  6. run watchman watch-del-all && npx react-native start --reset-cache
  7. run npx react-native run-ios

The app runs but when I try to open the camera with the AR functionality I receive this error,

Screen Shot 2020-11-23 at 12 56 39 PM

This is the output of the command grep -r UIWebView node_modules/*.

node_modules/create-react-class/node_modules/fbjs/lib/UserAgent.js.flow:   * - UIWebView
node_modules/create-react-class/node_modules/fbjs/lib/UserAgent.js:   * - UIWebView
node_modules/fbjs/lib/UserAgent.js.flow:   * - UIWebView
node_modules/fbjs/lib/UserAgent.js:   * - UIWebView
node_modules/jsc-android/dist/include/JSContextPrivate.h:/*! @abstract The delegate the context will use when trying to load a module. Note, this delegate will be ignored for contexts returned by UIWebView. */
node_modules/react-native-fbsdk/js/FBShareDialog.js:   * Displays the dialog in a UIWebView within the app.
Binary file node_modules/react-native-maps/.gradle/4.10.3/taskHistory/taskHistory.bin matches
node_modules/react-native-webview/README.md:- [7.0.1](https://github.com/react-native-community/react-native-webview/releases/tag/v7.0.1) - Removed UIWebView
Binary file node_modules/react-viro/ios/dist/ViroRenderer/static_lib/ViroKit_static_lib.framework/ViroKit_static_lib matches
Binary file node_modules/react-viro/ios/dist/ViroRenderer/static_lib/x86_64/ViroKit_static_lib.framework/ViroKit_static_lib matches
Binary file node_modules/react-viro/ios/dist/ViroRenderer/ViroKit.framework/ViroKit matches
Binary file node_modules/react-viro/ios/dist/ViroRenderer/x86_64/ViroKit.framework/ViroKit matches
node_modules/ua-parser-js/test/browser-test.json:        "ua"      : "Mozilla/5.0 (iPhone; CPU iPhone OS 10_0_2 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) Mobile/14A456 QQ/6.5.3.410 V1_IPH_SQ_6.5.3_1_APP_A Pixel/1080 Core/UIWebView NetType/WIFI Mem/26",

This is my setup,

info Fetching system and libraries information...
System:
    OS: macOS 10.15.6
    CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 348.93 MB / 16.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 10.15.2 - ~/.nvm/versions/node/v10.15.2/bin/node
    Yarn: 1.22.4 - /usr/local/bin/yarn
    npm: 6.4.1 - ~/.nvm/versions/node/v10.15.2/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: iOS 13.6, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
  IDEs:
    Android Studio: 4.0 AI-193.6911.18.40.6626763
    Xcode: 11.6/11E708 - /usr/bin/xcodebuild
  npmPackages:
    react: 16.9.0 => 16.9.0
    react-native: 0.61.5 => 0.61.5
nguyenvanphuc2203 commented 3 years ago

it turns out that I had 2 different Viro packages and I was updating the dist folder into one but using the other. After updating the right folder the VR is working as expected and Apple accepted the build without warnings! 🎉

same issue, run grep -r UIWebView to detect the component. So I ran it into /dist folder shared by @pradipBhuva27 and had the following result Binary file ./node_modules/react-viro/ios/dist/ViroRenderer/static_lib/ViroKit_static_lib.framework/ViroKit_static_lib matches

diegothucao commented 3 years ago

It can be fixed by replace the libs

nguyenvanphuc2203 commented 3 years ago

It can be fixed by replace the libs

Could you have time to support me a bit in detail how could I do ?