react-native icon indicating copy to clipboard operation
react-native copied to clipboard

webview release source={require(xxx.html)} not work

Open lisong opened this issue 10 years ago • 23 comments

  • [ ] Provide a minimal code snippet / rnplay example that reproduces the bug.

<WebView source={require('./helloworld.html')} />

ios release/debug is OK, android debug is OK too, only broken on android release versions, is blank page, nothing rendered.

  • [0.27.rc1] What's the version of React Native you're using? 0.27.rc1
  • [android] Does this occur on iOS, Android or both? android release
  • [mac] Are you using Mac, Linux or Windows? mac

lisong avatar Jun 04 '16 05:06 lisong

@facebook-github-bot label Android

charpeni avatar Jun 04 '16 13:06 charpeni

@facebook-github-bot label Android

charpeni avatar Jun 07 '16 14:06 charpeni

I'm having the same issue with 0.26.3. Any known workarounds?

jak4 avatar Jun 16 '16 10:06 jak4

The same issue with 0.27.2

Cap32 avatar Jun 19 '16 08:06 Cap32

It happens on iOS as well: https://github.com/facebook/react-native/issues/8996

Kureev avatar Jul 25 '16 09:07 Kureev

How to solve?

sLin90 avatar Aug 02 '16 08:08 sLin90

happens on android release build, seems to be working on emulator. the url somehow points to http://localhost:8081/on debug build.

jatazoulja avatar Nov 08 '16 00:11 jatazoulja

same here 0.37 - onload event is fired but only white page is shown. what's funny that I could not "reuired" html between apk assets but maybe it is hidden somewhere else.

sodik82 avatar Nov 23 '16 07:11 sodik82

same here 0.39.2, When I release andorid apk, webview can not load html by require('./index.html') , but ios work well. How to fix this? someone has any idea?

Micjoyce avatar Jan 20 '17 07:01 Micjoyce

Facing same issue 0.38.1. Please tell how to solve or some workaround for webViewBridge?

aayushanand99 avatar Jan 23 '17 08:01 aayushanand99

SameProblem.

Lxxyx avatar Jan 24 '17 15:01 Lxxyx

You might wanna check this solution.

https://github.com/facebook/react-native/issues/505#issuecomment-244463151

mayhs avatar Jan 25 '17 12:01 mayhs

Still seeing this with 0.42

FuadBalashov avatar May 02 '17 18:05 FuadBalashov

this works as a workaround for me: https://github.com/facebook/react-native/issues/505#issuecomment-218480163

jedt avatar May 16 '17 06:05 jedt

I'm running into this issue on 0.44 as well.

Traviskn avatar May 24 '17 16:05 Traviskn

HTML files still not being packaged in Android release on React Native 0.45.1

bitfabrikken avatar Jun 29 '17 06:06 bitfabrikken

When will this be fixed? This is really annoying..

hyochan35 avatar Jul 13 '17 11:07 hyochan35

Hi there! This issue is being closed because it has been inactive for a while. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. Either way, we're automatically closing issues after a period of inactivity. Please do not take it personally!

If you think this issue should definitely remain open, please let us know. The following information is helpful when it comes to determining if the issue should be re-opened:

  • Does the issue still reproduce on the latest release candidate? Post a comment with the version you tested.
  • If so, is there any information missing from the bug report? Post a comment with all the information required by the issue template.
  • Is there a pull request that addresses this issue? Post a comment with the PR number so we can follow up.

If you would like to work on a patch to fix the issue, contributions are very welcome! Read through the contribution guide, and feel free to hop into #react-native if you need help planning your contribution.

hramos avatar Sep 21 '17 15:09 hramos

@hramos Please reopen this issue, its behaviour is different between ios and android release version

Is this a bug report?

Yes

Have you read the Contributing Guidelines?

Yes

Environment

Environment: OS: macOS Sierra 10.12.6 Node: 6.10.3 Yarn: 0.24.5 npm: 3.10.10 Watchman: 4.7.0 Xcode: Xcode 9.0 Build version 9A235 Android Studio: 2.3 AI-162.4069837

Packages: (wanted => installed) react: 16.0.0-alpha.12 => 16.0.0-alpha.12 react-native: 0.48.4 => 0.48.4

Steps to Reproduce

(Write your steps here:)

  1. create index.html
<html>
    <head>
        <title>Title</title>
    </head>
    <body>
        <h1>Hello World</h1>
    </body>
</html>
  1. modify index.ios.js and index.android.js
/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 * @flow
 */

import React, { Component } from 'react';
import {
  AppRegistry,
  StyleSheet,
  WebView,
  View
} from 'react-native';

export default class WebViewTest extends Component {
  render() {
    return (
      <View style={styles.container}>
        <WebView
          scalesPageToFit={true}
          source={require('WebViewTest/index.html')}
        />
      </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
  },
});

AppRegistry.registerComponent('WebViewTest', () => WebViewTest);
  1. Build Release APK
  2. Run On Android

Expected Behavior

Hello World show up on screen.

Actual Behavior

Nothing. Just Blank Screen

Reproducible Demo

https://github.com/yosimasu/WebViewTest

yosimasu avatar Sep 28 '17 08:09 yosimasu

I create new issue

yosimasu avatar Sep 29 '17 04:09 yosimasu