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

iOS deprecated UIWebView #718

Open
3 tasks done
cristianoccazinsp opened this issue Sep 10, 2019 · 43 comments
Open
3 tasks done

iOS deprecated UIWebView #718

cristianoccazinsp opened this issue Sep 10, 2019 · 43 comments

Comments

@cristianoccazinsp
Copy link

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
Copy link

kala888 commented Sep 17, 2019

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
Copy link
Author

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
Copy link
Contributor

radvani commented Sep 30, 2019

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
Copy link
Author

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
Copy link

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
Copy link
Author

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
Copy link
Author

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
Copy link

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
Copy link
Contributor

radvani commented Nov 12, 2019 via email

@Hless
Copy link
Contributor

Hless commented Dec 20, 2019

@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:
viromedia/virocore#320

@TwR-Slice
Copy link

Are there any news about this issue?

@Jackyaung
Copy link

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

@Jackyaung
Copy link

@TwR-Slice did you solve the problem.

@cristianoccazinsp
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link

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

@ManigandanRaamanathan
Copy link

@dthian please fix the OS deprecated UIWebView issue

@dthian
Copy link
Member

dthian commented May 3, 2020

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
Copy link
Author

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
Copy link
Member

dthian commented May 3, 2020

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
Copy link

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
Copy link

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

@mbryk
Copy link

mbryk commented May 4, 2020

@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
Copy link

ManigandanRaamanathan commented May 4, 2020

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

@dthian
Copy link
Member

dthian commented May 4, 2020

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

@silvainSayduck
Copy link

silvainSayduck commented May 5, 2020

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!

@namquyuit
Copy link

namquyuit commented May 6, 2020

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

@cristianocca
Copy link

@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
Copy link

@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
Copy link

@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
Copy link

ManigandanRaamanathan commented May 11, 2020

@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
Copy link

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

@MinhazMM
Copy link

@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
Copy link

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

@quangduz
Copy link

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
Copy link

@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
Copy link
Member

dthian commented May 18, 2020

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

@Jackyaung
Copy link

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

@ktemby
Copy link

ktemby commented Jun 10, 2020

@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 #852 (comment)

@amirhosein5858
Copy link

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
Copy link

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

@nguyenvanphuc2203
Copy link

same issue for me, please help!

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