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

React Native in privileged processes #22721

Closed
hhff opened this issue Dec 20, 2018 · 3 comments
Closed

React Native in privileged processes #22721

hhff opened this issue Dec 20, 2018 · 3 comments
Labels
Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.

Comments

@hhff
Copy link

hhff commented Dec 20, 2018

Environment

  React Native Environment Info:
    System:
      OS: macOS High Sierra 10.13.6
      CPU: x64 Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz
      Memory: 7.65 GB / 32.00 GB
      Shell: 5.5.1 - /usr/local/bin/zsh
    Binaries:
      Node: 10.8.0 - ~/.asdf/shims/node
      Yarn: 1.12.3 - /usr/local/bin/yarn
      npm: 6.2.0 - ~/.asdf/shims/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
      Android SDK:
        Build Tools: 23.0.1, 25.0.1, 26.0.3, 27.0.3, 28.0.2, 28.0.3
        API Levels: 23, 25, 26, 28
    IDEs:
      Android Studio: 3.1 AI-173.4907809
      Xcode: 10.1/10B61 - /usr/bin/xcodebuild
    npmPackages:
      react: 16.4.1 => 16.4.1
      react-native: 0.56.0 => 0.56.0
    npmGlobalPackages:
      react-native-cli: 2.0.1
      react-native-git-upgrade: 0.2.7

Description

Hi There! I checked stack overflow but this is a weird one!

I'm currently developing a system app for Android that will run React Native on the view layer. However, when adding:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    android:sharedUserId="android.uid.system" <-- this line
    xmlns:tools="http://schemas.android.com/tools">

To the AndroidManifest.xml, I see the following error (on react-native run-android):

java.lang.UnsupportedOperationException: For security reasons, WebView is not allowed in privileged processes

When I build the app as a release, the error doesn't show, so I'm guessing the WebView it's talking about is some type of developer tool.

Scratch that - it appears to happen for debug and release builds.

Is there a way around this when developing a system app with React Native? Can I disable this tool?

Reproducible Demo

  • Obtain the Platform keys for an Android AOSP Image
  • Add the above line to the AndroidManifest.xml
  • Setup Gradle to sign the debug build with the Platform keys, and ensure you're running the app on a device with the Android AOSP Image installed (that the platform keys correspond to)
  • run react-native run-android
@react-native-bot
Copy link
Collaborator

It looks like you are using an older version of React Native. Please update to the latest release, v0.57 and verify if the issue still exists.

The "⏪Old Version" label will be removed automatically once you edit your original post with the results of running react-native info on a project using the latest release.

@vovkasm
Copy link
Contributor

vovkasm commented Dec 20, 2018

Well, I think when react-native-community/discussions-and-proposals#3 will be implemented and then WebView core component will be removed you will be allowed to use stock RN code. Until that you only option is fork RN code and remove all references to WebView manually (AFAIK).

@react-native-bot
Copy link
Collaborator

I am closing this issue because it does not appear to have been verified on the latest release, and there has been no followup in a while.

If you found this thread after encountering the same issue in the latest release, please feel free to create a new issue with up-to-date information by clicking here.

@react-native-bot react-native-bot added the Ran Commands One of our bots successfully processed a command. label Jan 4, 2019
@facebook facebook locked as resolved and limited conversation to collaborators Jan 4, 2020
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jan 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

3 participants