Viro: Looks like viro is dead for ios till update

Created on 1 May 2020  路  62Comments  路  Source: viromedia/viro

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.

bug

Most helpful comment

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!

All 62 comments

Our app was all ready to be released as well, but due to this, we are stuck. This is going to prevent any new apps from making to App Store and eventually, by December, all existing apps will stop working as well. Sounds like a high priority item. Any plans from Viro team to tackle this soon ?

Guys any update on this issue? Apple already stopped receiving the UIWebView API. Now we are unable to upload the app

@dthian please fix the OS deprecated UIWebView issue

Hey @ManigandanRaamanathan, as mentioned in the other post, I'm not currently working on ViroReact, and that ViroReact and ViroCore are both open sourced - so that shouldn't be any blocking factors preventing you from viewing the source and patching the fix.

As mentioned, You would essentially need to abstract the GVR implementations away such that they aren't build into the renderer on iOS, that should remove the webview dependency (hopefully). @HedwigAR might have made some progress, so I would check in with him.

@dthian, I tried @HedwigAr's GVR removed version v2.18.0, it works perfectly fine now

@ManigandanRaamanathan If we remove GVR that means we can't have VR support on the app yeah?

Yes @MinhazMM. That is indeed the case.

@ManigandanRaamanathan , where can I access the v2.18.0(the one with GVR removed)? and what react-native version are you using it with ? Thank you in advance.

Thank you very much @ManigandanRaamanathan . Please forgive my lack of knowledge on this. Did you use the github link(this one https://github.com/mendix/viro.git) directly on your package.json, or did you fork it and make npm package out of that build branch(which has the fix) ?

are we planing to release a new version that fix issue of Apple ? @ManigandanRaamanathan
with https://github.com/mendix/viro.git, seems IOS ok but Android cannot run because it does not have gvr @mendix

@diegothucao on my end, AR works on both android and ios version. I installed me ndix pull request version.

I've also installed mendix version (master branch on https://github.com/mendix/viro.git) but after I run yarn install and react-native run-android --variant=arDebug to open the app (in code-sample folder) on my device, it crashed out. Do you have any idea, is there any step I'm missing? or I'm using the incorrect branch (or git link)? @ManigandanRaamanathan thank you so much.

@namthan dont use master branch. Use the branch that is is pending merge request

@namthan dont use master branch. Use the branch that is is pending merge request

Do you mean branch UpdateReactNative ? I'm trying it on. This is an urgent issue in my project, hopefully can get your supports. Thanks a lot.

@diegothucao on my end, AR works on both android and ios version. I installed me ndix pull request version.

@ManigandanRaamanathan : I went to https://github.com/mendix/viro.git and do not see any pull request version ? Could you have time to support me a bit in detail how could I do ?
thanks so much for your reply.

hi @ManigandanRaamanathan , thanks for your answer.
I downloaded the build branch as in https://github.com/mendix/viro/pull/1
and run example with react-native run-android --variant=arDebug
However it crashes when Android app comes up.
Can the issue is about permission or missing something else from me?

@diegothucao the same version works fine on android 10 samsung s10 and note 9

Thanks @ManigandanRaamanathan
I used note 9 as well. But still issue
if you have any other idea for me. Please let me know.
Thanks so much.

Screen Shot 2020-05-30 at 12 20 03 PM
After building successfully with medix pr, I'm running into this error. @ManigandanRaamanathan could you please help?

Did anyone manage to create 2.18 alternative with reverted GVR removal?
I would like to have an updated version with fix for #835 .
I was trying to but I always get white screen in VR mode.

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!

Thanks for your detail explanation
Would you share the dist folder via google driver or dropbox ?
Because I am struggling to build "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)" stage all day long.
My react-native version is "react-native": "0.59.9"
When I build all the targets and 'static lib', it shows so many errors.
Thanks in advance.

@tscj3490 I don't think this will work for you - but feel free to try https://drive.google.com/file/d/1XnIN0tPXGiLT1bRwEAxE1HWW1rU1edxc/view?usp=sharing. I'll run through the full steps of building a RN 0.62.2 test app, and post that over the weekend.

Thanks for your dedicated effort and help.
I will try again. Thanks again.

I just did as your guide and deployed app that GVR is removed to test flight.
I did like below.

  1. Removed Viro from my current project npm uninstall react-viro
  2. Ran npm install git+https://github.com/ktemby/viro
  3. Copied to the dist folder you shared and pasted to {my work project}/node_modules/react-viro/ios/dist/ .
  4. Ran pod install again and then, I could build app successfully.
    But once I deploy app to test flight, apple doesn't still allow my app. It shows same error. (Apple doesn't allow UIWebView)
    Please guide me again.

I can't be sure- but you may need to clean your build folder completely first. I'd also isolate out what contains the UIWebview https://stackoverflow.com/questions/58091231/how-to-search-for-any-uiwebview-component-usage-inside-a-current-project.
You may also want to ensure you're using the static lib - added step 2 to Part 4.
I may have missed one of the steps I took, I'll do this for a clean test app on the weekend.

I can't be sure- but you may need to clean your build folder completely first. I'd also isolate out what contains the UIWebview https://stackoverflow.com/questions/58091231/how-to-search-for-any-uiwebview-component-usage-inside-a-current-project.
You may also want to ensure you're using the static lib - added step 2 to Part 4.
I may have missed one of the steps I took, I'll do this for a clean test app on the weekend.

Hi, Ktemby. Did u do the work ? If you did, please share.. Thanks.

I can't be sure- but you may need to clean your build folder completely first. I'd also isolate out what contains the UIWebview https://stackoverflow.com/questions/58091231/how-to-search-for-any-uiwebview-component-usage-inside-a-current-project.
You may also want to ensure you're using the static lib - added step 2 to Part 4.
I may have missed one of the steps I took, I'll do this for a clean test app on the weekend.

Hi, ktemby
I can't still deploy app to app store. Could you share source code that apple can approve ?
Thanks in advance.

I can't be sure- but you may need to clean your build folder completely first. I'd also isolate out what contains the UIWebview https://stackoverflow.com/questions/58091231/how-to-search-for-any-uiwebview-component-usage-inside-a-current-project.
You may also want to ensure you're using the static lib - added step 2 to Part 4.
I may have missed one of the steps I took, I'll do this for a clean test app on the weekend.

Hi, ktemby. Would you share test app apple approved ? I tried as your guide, but again, I got a mail like below. I am struggling on this for a long time.

ITMS-90809: Deprecated API Usage - New apps that use UIWebView are no longer accepted. Instead, use WKWebView for improved security and reliability. Learn more (https://developer.apple.com/documentation/uikit/uiwebview).

Please help me.. If apple doesn't approve this Viro app, this isn't really useful. Thanks.

Hello,

Good news for everyone, i have just make changes in SDK for issue of UIWebView and i am getting successful to do that.
now my iOS app is live on app store.
so here is my solution :
just download dist file from following link and extract and replace it in "..node_modules/react-viro/ios" path.

Link : https://drive.google.com/file/d/1F_5i59mCIWorF8N7f5A-CbuugrFKv3ia/view

please download it and paste in path and upload your app to app store.

Hello,

Good news for everyone, i have just make changes in SDK for issue of UIWebView and i am getting successful to do that.
now my iOS app is live on app store.
so here is my solution :
just download dist file from following link and extract and replace it in "..node_modules/react-viro/ios" path.

Link : https://drive.google.com/file/d/1F_5i59mCIWorF8N7f5A-CbuugrFKv3ia/view

please download it and paste in path and upload your app to app store.

Thanks for your update.. I just replaced the dist folder in "..node_modules/react-viro/ios" and deployed app again to test flight, but apple doesn't still approve... What did I missed else ? Thanks in advance.

Hello,
Good news for everyone, i have just make changes in SDK for issue of UIWebView and i am getting successful to do that.
now my iOS app is live on app store.
so here is my solution :
just download dist file from following link and extract and replace it in "..node_modules/react-viro/ios" path.
Link : https://drive.google.com/file/d/1F_5i59mCIWorF8N7f5A-CbuugrFKv3ia/view
please download it and paste in path and upload your app to app store.

Thanks for your update.. I just replaced the dist folder in "..node_modules/react-viro/ios" and deployed app again to test flight, but apple doesn't still approve... What did I missed else ? Thanks in advance.

Please check somewhere else you have used UIWebview?

Hello,
Good news for everyone, i have just make changes in SDK for issue of UIWebView and i am getting successful to do that.
now my iOS app is live on app store.
so here is my solution :
just download dist file from following link and extract and replace it in "..node_modules/react-viro/ios" path.
Link : https://drive.google.com/file/d/1F_5i59mCIWorF8N7f5A-CbuugrFKv3ia/view
please download it and paste in path and upload your app to app store.

Thanks for your update.. I just replaced the dist folder in "..node_modules/react-viro/ios" and deployed app again to test flight, but apple doesn't still approve... What did I missed else ? Thanks in advance.

Please check somewhere else you have used UIWebview?

In my project, I searched UIWebview, but I couldn't find. By the way, I am not sure why apple don't approve.. Could you share the source code apple approved ?

Hello,
Good news for everyone, i have just make changes in SDK for issue of UIWebView and i am getting successful to do that.
now my iOS app is live on app store.
so here is my solution :
just download dist file from following link and extract and replace it in "..node_modules/react-viro/ios" path.
Link : https://drive.google.com/file/d/1F_5i59mCIWorF8N7f5A-CbuugrFKv3ia/view
please download it and paste in path and upload your app to app store.

Thanks for your update.. I just replaced the dist folder in "..node_modules/react-viro/ios" and deployed app again to test flight, but apple doesn't still approve... What did I missed else ? Thanks in advance.

Please check somewhere else you have used UIWebview?

In my project, I searched UIWebview, but I couldn't find. By the way, I am not sure why apple don't approve.. Could you share the source code apple approved ?

Based on this Stackoverflow answer you can 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 ~/Downloads/dist/ViroRenderer/static_lib/ViroKit_static_lib.framework/ViroKit_static_lib matches

I guess UIWebView is still there (of course the build was rejected by Apple).

@Cosmitar strange. The dist worked for me and my app is in the store

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! 馃帀

To anyone still struggling with this problem, I will share my experience hoping it could help someone.

I need to integrate viro AR functionality in a react native 0.62.2 project targeting both android and ios.

To make it work on android without androidX problems, I used the citychallenge fork: https://github.com/citychallenge/viro

That worked good both on android on iOS, but I could not submit my app on the apple store due to UIWebView.

I followed the suggestions in this very same thread and, while I managed to get it working on iOS using @ktemby instructions, it didn't work on android anymore and the solution could not be "gitted" due to large files that required copy-pasting.

So:

  • I forked @citychallenge repo ( my org repo: https://github.com/tiknil/viro )
  • I downloaded the dist.zip shared by @pradipBhuva27 , with library files way smaller then the dist.zip shared by @ktemby and therefore could be committed. (it also reduced by 80MB the size of my .ipa uploaded on Testflight)
  • I copy-pasted the dist folder inside my fork ios/dist folder
  • In my project I installed my repo: yarn add git+https://github.com/tiknil/viro
  • I setup both android and iOS to use my repo in ../node_modules/@tiknil/react-viro/
  • Both android and iOS are properly working with react native 0.62.2 and I was able to successfully submit my app to Testflight on the appstore
  • Anyone in my team can just run yarn install without the need of copy-pasting a separated folder inside node_modules

Note: I can not guarantee that my org repo will be maintained in the future, so if you decide to use it anyway it will be at your own risk.

Additional note: I could not build the dist folder by myself because the fork by @ktemby raised some errors about the react library missing. I run pod install on the ios folder, but the podfiile is actually empty so it didn't help. If anyone else managed to build its own dist folder I would be interested in undrstanding and replicating the process.

@gbalduzzi similar situation here for VR functionalities.

It works and is published on both iOS and Android stores

Hi @Cosmitar, @gbalduzzi

in android/settings.gradle
do I need to add the following

include ':react_viro', ':arcore_client', ':gvr_common', ':viro_renderer'
project(':arcore_client').projectDir = new File(rootProject.projectDir,'../node_modules/@citychallenge/react-viro/android/arcore_client')
project(':gvr_common').projectDir = new File(rootProject.projectDir,'../node_modules/@citychallenge/react-viro/android/gvr_common')
project(':viro_renderer').projectDir = new File(rootProject.projectDir,'../node_modules/@citychallenge/react-viro/android/viro_renderer')
project(':react_viro').projectDir = new File(rootProject.projectDir,'../node_modules/@citychallenge/react-viro/android/react_viro')

notice "@citychallenge"

If you are using the citychallenge fork yeah. Adjust those path to whatever fork you are using

@dam00n Anyone on the team working on this?

@Cosmitar VR is working fine after publishing over the apple store?

@haider792 it is working so far

can you please guide me on this. my android side is working good but on ios i have change the setting as you have described, i have installed the package and change the dist folder but it is still giving me the error.

Binary file ./node_modules/@citychallenge/react-viro/ios/dist/ViroRenderer/static_lib/ViroKit_static_lib.framework/ViroKit_static_lib matches.

Binary file ./ios/Pods/GVRSDK/Libraries/libGVRSDK.a matches

@Cosmitar

@gbalduzzi similar situation here for VR functionalities.

It works and is published on both iOS and Android stores

@haider792 the matches on grep -r UIWebView are still there, however Apple is accepting the build after overwriting dist folder. Did you tried to publish your app?

ITMS-90809: Deprecated API Usage - New apps that use UIWebView are no longer accepted. Instead, use WKWebView for improved security and reliability. Learn more (https://developer.apple.com/documentation/uikit/uiwebview).

this is the warning they are sending me in the email and not accepting the build on testflight

@haider792 two things that happened to me:
1 - I forgot to remove react-viro package after installing @citychallenge/react-viro package.
2 - typo in overwriting script wasn't overwriting /dist folder.

What I want to say with this, the patch works and probably in the whole mess there's a simple bothering mistake like I described above.
Don't give up, review the process, make sure you're overwriting the right /dist folder with the right downloaded source and that's the only react-viro code you're building.

@Cosmitar can you please guide me on this issue. attached is the image.

dyld`__abort_with_payload:
0x113a21ed4 <+0>: movl $0x2000209, %eax ; imm = 0x2000209
0x113a21ed9 <+5>: movq %rcx, %r10
0x113a21edc <+8>: syscall
-> 0x113a21ede <+10>: jae 0x113a21ee8 ; <+20>
0x113a21ee0 <+12>: movq %rax, %rdi
0x113a21ee3 <+15>: jmp 0x113a20408 ; cerror_nocancel
0x113a21ee8 <+20>: retq
0x113a21ee9 <+21>: nop
0x113a21eea <+22>: nop
0x113a21eeb <+23>: nop

crashing when changing the dist folder as you describe and ios is not running showing this error.

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

dyld: Symbol not found: _OBJC_CLASS_$_WKWebView

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

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

@gbalduzzi ?

@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.

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

@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 .

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

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

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
  1. 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

  2. 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

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

It can be fixed by replace the libs

It can be fixed by replace the libs

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

slycoder picture slycoder  路  4Comments

yabeow picture yabeow  路  4Comments

dimegusew picture dimegusew  路  3Comments

Thomas101 picture Thomas101  路  3Comments

vuthanhtrung0504 picture vuthanhtrung0504  路  5Comments