viromedia / viro

ViroReact: AR and VR using React Native
MIT License
2.3k stars 482 forks source link

iOS deprecated UIWebView #718

Open cristianoccazinsp opened 5 years ago

cristianoccazinsp commented 5 years ago

Environment

Please provide the following information about your environment:

  1. Development OS: Mac
  2. Device OS & Version: iOS 12.4.1
  3. Version: "react-viro": "2.16.0" "react-native": "0.60.5"
  4. Device(s): iPhone 7

Description

iOS is removing UIWebView and any submitted application will now receive a warning. After a bunch of updates, it seems like this library is the final culprit still using this.

grep -r UIWebView node_modules/*

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/static_lib/armv7_arm64/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
Binary file node_modules/react-viro/ios/dist/ViroRenderer/armv7_arm64/ViroKit.framework/ViroKit matches

Can we have an update that removes this?

kala888 commented 5 years ago

Same issue report to my email from Apple when upload App to Store

ITMS-90809: Deprecated API Usage - Apple will stop accepting submissions of apps that use UIWebView APIs . See https://developer.apple.com/documentation/uikit/uiwebview for more information.
cristianoccazinsp commented 5 years ago

Any updates on this? Is it really react viro using it or is it something else? I can't really seem to find any other culprit.

radvani commented 5 years ago

It turns out this was Google Cardboard (their iOS GVR SDK) that had this dependency. If Google fixes this on their end then we'll update with the correction; otherwise we'll have to remove support for Google Cardboard.

cristianoccazinsp commented 5 years ago

Is it possible to shrink down / remove iOS dependencies if they are not needed? Similar to what you've done with Android that some dependencies can be omitted.

Truth is we only use the library to support 360 images.

vpallegar commented 4 years ago

Hi All. Does anyone know if there is a resolution here? seems like any new app submissions will be rejected from apple until this is resolved.

cristianoccazinsp commented 4 years ago

Is apple rejecting uploads already? Are we all sure the deprecation warning comes from here? Should be as simple as updating any google's reference. I believe google has updated their SDKs already.

cristianoccazinsp commented 4 years ago

Are these libraries the culprits maybe? https://github.com/viromedia/virocore/blob/master/ios/Podfile

Note that they are not even from viro react, but rather the core. When using the static lib, I'm not even sure if updating this is possible without having a new build of the static libs.

vpallegar commented 4 years ago

The last email i got from apple regarding my dev app was that Apple will stop accepting submissions of apps that use UIWebView APIs - so i'm assuming any new app submissions will be rejected.

Digging deeper as radvani mentioned it seems to be GVRSDK which has the issue. Going thru the viro source code and running grep -r UIWebView * on the Pods folder (Virocore/ios/Pods) it returns Binary file GVRSDK/Libraries/libGVRSDK.a matches...and looks like google does not support that anymore, telling users to upgrade cardboard instead. I tried pulling out the GVRSDK dependency but that causes part of the code to no longer work when recompiling viro.

radvani commented 4 years ago

Yes, Google just open sourced Cardboard but it looks like they’re effectively deprecating it. We may need to release a version without Cardboard to mitigate this.

Raj

On Nov 12, 2019, at 12:28 PM, vpallegar notifications@github.com wrote:

 The last email i got from apple regarding my dev app was that Apple will stop accepting submissions of apps that use UIWebView APIs - so i'm assuming any new app submissions will be rejected.

Digging deeper as radvani mentioned it seems to be GVRSDK which has the issue. Going thru the viro source code and running grep -r UIWebView * on the Pods folder (Virocore/ios/Pods) it returns Binary file GVRSDK/Libraries/libGVRSDK.a matches...and looks like google does not support that anymore, telling users to upgrade cardboard instead. I tried pulling out the GVRSDK dependency but that causes part of the code to no longer work when recompiling viro.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

Hless commented 4 years ago

@radvani I checked the open source Cardboard library, and I don't get the impression they are trying to abandon the project. We are on a tight release schedule with our current project, but we will keep relying on viro, so eventually we will have to get rid of the UIWebView depedency before we are unable to release updates for our app.

Apparently the UIWebView dependency also no longer exist in the new Cardboard library.

Can you please point me in the general direction of where to start to replace the GVRSDK libary with the new Cardboard library in the viro core? I will take a swing at it as soon as I can.

Edit: Perhaps we should continue the discussion here: https://github.com/viromedia/virocore/issues/320

TwR-Slice commented 4 years ago

Are there any news about this issue?

Jackyaung commented 4 years ago

I am facing the same problem, any solution and how to replace the GVRSDK

Jackyaung commented 4 years ago

@TwR-Slice did you solve the problem.

cristianoccazinsp commented 4 years ago

Any updates on this? Looks like Apple will stop accepting uploads with UIWebView starting in April 2020 (i.e., now). This has just become a breaking change and needs immediate attention. Any guide on how to update GVRSDK is welcome.

cristianoccazinsp commented 4 years ago

I've been trying to upgrade react's version to 0.61.5 in this branch (https://github.com/cristianoccazinsp/viro/tree/rn-upgrade-attempt) alongside updating google SDKs for iOS to remove some deprecation warnings. Compilation of the new android aar file seems fine, but the iOS migration step is harder than I thought and I can't seem to make it compile with the new podspec file. If someone is interested in taking it from there... I'm most likely not putting more effort into this and will be searching for another 360 viewer shortly.

cristianoccazinsp commented 4 years ago

Well, as much as I tried, fixing the iOS project to work with the new RN pods setup seems impossible. Will pass on this one.

Also, seems like updating Google's SDK won't fix the issue since it hasn't been updated in some time.

ManigandanRaamanathan commented 4 years ago

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

ManigandanRaamanathan commented 4 years ago

@dthian please fix the OS deprecated UIWebView issue

dthian commented 4 years ago

Hey @ManigandanRaamanathan, unfortunately I'm not actively working on Viro at the moment. Having said that, Viro + ViroCore is open sourced now, so you should be able to go in and patch the source to remove the UIWebview. Good luck!

cristianoccazinsp commented 4 years ago

I don't think there's any way to patch this. Viro uses google VR SDK, which is deprecated and hasn't been updated in ages. To fix it you need to upgrade to the new google cardboard API; most likely a lot of work.

dthian commented 4 years ago

Another way as well (if you are using AR) is to just remove GVR from the build, and comment out (or abstract out) the components that are using it. The ARCode path vs VR Code path is different, so that should work and is easier to do.

silvainSayduck commented 4 years ago

Hi @dthian,

Thanks for the pointer! For an AR-only app, would you have any practical advice as to how does one remove GVR from the build, and find out which components are using it?

I've been trying a few different search and replace approaches, and tried removing libraries from the Podfile, directly from Xcode, ... but the warning always remained.

ManigandanRaamanathan commented 4 years ago

@silvainSayduck @dthian may I know how to remove GVR out? Im new to native iOS

mbryk commented 4 years ago

@ManigandanRaamanathan @silvainSayduck I haven't gotten into the core of this library at all, but my best guess would be to follow the "Manual Building of the Renderer" instructions here, remove GVR there, and make sure to do 3b in the iOS section to build the ViroKit_static_lib. Then, use this result in your node_modules instead of the old ViroKit.

If after doing this, you can run grep -r UIWebView node_modules/* and get no results, you should be good. (And if you do try this and it works, please post a fork! Thanks!)

ManigandanRaamanathan commented 4 years ago

@mbryk for the time being I'm using this commits v2.18.0 from @HedwigAR https://github.com/mendix/viro/pull/1

dthian commented 4 years ago

Hedwig managed to remove it and it seems to be working on his end. The commit for the changes here might help. @mbryk

silvainSayduck commented 4 years ago

Hi,

Due to #835, I had to use a Viro custom build, and thus tried to also not reference to UIWebView that will not be accepted on the App Store by Apple anymore after December 2020, but it didn't work... Would anyone be able to explain why my approach did not work? Thanks in advance!

Here are the steps I followed, losely inspired from several issues and forks and the various Viro README instructions. Disclaimer: I am very unexperienced with this kind of manoeuvre, and as such, some or all of this might actually be clumsy or unnecessary

If this also helps, here are my fixed libViroReact.a and ViroRenderer: https://drive.google.com/file/d/1X09c3UUpl7g9MhyJOOwFrMzYMnA0eyx7/view?usp=sharing

Huge thanks to all the contributors that enabled me to patch this together, and especially @dthian, @HedwigJDoets and @HedwigAR!

namquyuit commented 4 years ago

Awesome @silvainSayduck I just ran into this issue yesterday. You saved me! Thank you very much!

cristianocca commented 4 years ago

@silvainSayduck any thoughts on making the build process easier? With RN >= 0.60, everything can be migrated to pods (including manually linked RN libraries). Ideally, one project should include the other with just a podfile configuration rather than including pre-built files.

A similar issue happens with Android. There's one build step that is linked directly against a specific RN version, which is then copied over to the other project. Quite messy.

Take this lib for example, multiple dependencies, all resolved nicely, even swift dependencies: https://github.com/lightbasenl/react-native-panorama-view

silvainSayduck commented 4 years ago

@cristianocca Unfortunately, as I stated, I know very little about build processes, both for Xcode and Android... The above steps were the results of a painful trial-and-error approach, and I'm not sure they all make sense at all...

@namquyuit do you mean that for you, my steps above worked to solve this issue (references to UIWebView which will be refused by Apple from December 2020), or the crashes on iOS 13.4+ (#835)?

ranjanpoudel1234 commented 4 years ago

@silvainSayduck , thank you for sharing. I tried your steps and copy pasted the libViroReact.a file and ViroRenderer folder respectively. However, after that, when I did grep -r UIWebView node_modules/, I am still seeing the following. Did you or @namquyuit see the same ? @ManigandanRaamanathan , you said it worked for you, could you please share your steps ?

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

ManigandanRaamanathan commented 4 years ago

@ranjanpoudel1234 My way was much easier, I did not modify the native static_lib's. I simply installed directly from this branch in package.json https://github.com/mendix/viro/pull/1 and it starts working fine. @HedwigAR have already removed the GVR contents and rebuilt the static_lib in that branch.

@silvainSayduck @dthian

namquyuit commented 4 years ago

@silvainSayduck I used your shared library files in Google Drive and patched to my project, it passed Apple rejection.

MinhazMM commented 4 years ago

@ManigandanRaamanathan I am developing a VR related application, so if I remove GVR will it not remove the entire VR support in the application?

ManigandanRaamanathan commented 4 years ago

@MinhazMM I'm afraid VR wont work in iOS build after stripping GVR feature. You may refer changes made by @HedwigAR

quangduz commented 4 years ago

Hi,

Due to #835, I had to use a Viro custom build, and thus tried to also not reference to UIWebView that will not be accepted on the App Store by Apple anymore after December 2020, but it didn't work... Would anyone be able to explain why my approach did not work? Thanks in advance!

Here are the steps I followed, losely inspired from several issues and forks and the various Viro README instructions. Disclaimer: I am very unexperienced with this kind of manoeuvre, and as such, some or all of this might actually be clumsy or unnecessary

  • Clone the repo into your workspace with git: git clone https://github.com/mendix/virocore/
  • Revert to the commit with the fix for NSURLResponse crash: git reset 621b2524f44f8e93a08085b3770d457f5e002e43 --hard
  • Clone the react-viro repo (named viro) in the same workspace (same parent directory as virocore) with git: git clone https://github.com/mendix/viro.git
  • Revert to commit with the fix for UIWebView deprecation: git checkout build and git reset ecc4a15e456aeea57d782e189ca2318b829958f5 --hard
  • $ cd virocore/ios/ and $ pod install
  • Open ViroRenderer.xcworkspace in Xcode (make sure you open the .xcworkpace file, and not the .xcodeproj file!). Build ViroKit scheme with Build Configuration set to Release and target set to Generic iOS Device
  • (Optional) A build error might happen as Xcode tries to find ios/Pods/Target Support Files in ios/Pods/Pods/Target Support Files. If so, copy/paste all files and folders from ios/Pods to ios/Pods/Pods
  • When the build succeeds, you should see an updated armv7_arm64 folder and updated ViroKit.podspec file in the viro/ios/dist/ViroRenderer folder
  • $ cd viro and $ npm install
  • $ cd viro/ios and $ pod install
  • Open ViroReact.xcworkspace in Xcode.
  • Build ViroReact scheme with Build Configuration set to Release and target set to Generic iOS Device
  • You should see a new file libViroReact.a at ios/dist/lib/libViroReact.a
  • Replace your_project/node_modules/react-viro/ios/dist/lib/libViroReact.a with the newly generated ios/dist/lib/libViroReact.a
  • Replace your_project/node_modules/react-viro/ios/dist/ViroRenderer with the one from viro/ios/dist/ViroRenderer
  • Build your project

If this also helps, here are my fixed libViroReact.a and ViroRenderer: https://drive.google.com/file/d/1X09c3UUpl7g9MhyJOOwFrMzYMnA0eyx7/view?usp=sharing

Huge thanks to all the contributors that enabled me to patch this together, and especially @dthian, @HedwigJDoets and @HedwigAR!

Thank you so much ! You save my life, now i can go to sleep

silvainSayduck commented 4 years ago

@silvainSayduck I used your shared library files in Google Drive and patched to my project, it passed Apple rejection.

I didn't work for me, but I guess it means that some other library I use has some reference to UIWebView too... Thanks for the confirmation :)

dthian commented 4 years ago

We've also attempted removing GVR from the renderer in ViroCore, you guys could also try the built one from the pipeline here.

Jackyaung commented 4 years ago

@ManigandanRaamanathan can you please tell how I install the version 2.18.0 ? I tried to run yarn add react-viro@2.18.0, but there is no option for this one. I am stucking at this issue now.

ktemby commented 4 years ago

@dthian thank you for this amazing project! For the GVR removal I was able to get through the UIWebView issue in my RN 0.62.2 project last night - details here https://github.com/viromedia/viro/issues/852#issuecomment-641810778

amirhosein5858 commented 4 years ago

Hi,

Due to #835, I had to use a Viro custom build, and thus tried to also not reference to UIWebView that will not be accepted on the App Store by Apple anymore after December 2020, but it didn't work... Would anyone be able to explain why my approach did not work? Thanks in advance!

Here are the steps I followed, losely inspired from several issues and forks and the various Viro README instructions. Disclaimer: I am very unexperienced with this kind of manoeuvre, and as such, some or all of this might actually be clumsy or unnecessary

  • Clone the repo into your workspace with git: git clone https://github.com/mendix/virocore/
  • Revert to the commit with the fix for NSURLResponse crash: git reset 621b2524f44f8e93a08085b3770d457f5e002e43 --hard
  • Clone the react-viro repo (named viro) in the same workspace (same parent directory as virocore) with git: git clone https://github.com/mendix/viro.git
  • Revert to commit with the fix for UIWebView deprecation: git checkout build and git reset ecc4a15e456aeea57d782e189ca2318b829958f5 --hard
  • $ cd virocore/ios/ and $ pod install
  • Open ViroRenderer.xcworkspace in Xcode (make sure you open the .xcworkpace file, and not the .xcodeproj file!). Build ViroKit scheme with Build Configuration set to Release and target set to Generic iOS Device
  • (Optional) A build error might happen as Xcode tries to find ios/Pods/Target Support Files in ios/Pods/Pods/Target Support Files. If so, copy/paste all files and folders from ios/Pods to ios/Pods/Pods
  • When the build succeeds, you should see an updated armv7_arm64 folder and updated ViroKit.podspec file in the viro/ios/dist/ViroRenderer folder
  • $ cd viro and $ npm install
  • $ cd viro/ios and $ pod install
  • Open ViroReact.xcworkspace in Xcode.
  • Build ViroReact scheme with Build Configuration set to Release and target set to Generic iOS Device
  • You should see a new file libViroReact.a at ios/dist/lib/libViroReact.a
  • Replace your_project/node_modules/react-viro/ios/dist/lib/libViroReact.a with the newly generated ios/dist/lib/libViroReact.a
  • Replace your_project/node_modules/react-viro/ios/dist/ViroRenderer with the one from viro/ios/dist/ViroRenderer
  • Build your project

If this also helps, here are my fixed libViroReact.a and ViroRenderer: https://drive.google.com/file/d/1X09c3UUpl7g9MhyJOOwFrMzYMnA0eyx7/view?usp=sharing

Huge thanks to all the contributors that enabled me to patch this together, and especially @dthian, @HedwigJDoets and @HedwigAR!

hi , i try your fixed files , and apple not accept :( is any steps that i forgot?

haider792 commented 3 years ago

@ktemby have you worked with the Vr feature in the react-viro?

nguyenvanphuc2203 commented 3 years ago

same issue for me, please help!