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

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

Closed
1 task
lisong opened this issue Jun 4, 2016 · 23 comments
Closed
1 task

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

lisong opened this issue Jun 4, 2016 · 23 comments
Labels
Platform: iOS iOS applications. Resolution: Locked This issue was locked by the bot.

Comments

@lisong
Copy link

lisong commented Jun 4, 2016

  • 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
@charpeni
Copy link
Contributor

charpeni commented Jun 4, 2016

@facebook-github-bot label Android

1 similar comment
@charpeni
Copy link
Contributor

charpeni commented Jun 7, 2016

@facebook-github-bot label Android

@jak4
Copy link

jak4 commented Jun 16, 2016

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

@Cap32
Copy link

Cap32 commented Jun 19, 2016

The same issue with 0.27.2

@Kureev
Copy link
Contributor

Kureev commented Jul 25, 2016

It happens on iOS as well: #8996

@Kureev Kureev added the Platform: iOS iOS applications. label Jul 25, 2016
@289420843
Copy link

How to solve?

@jatazoulja
Copy link

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

@sodik82
Copy link

sodik82 commented Nov 23, 2016

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.

@Micjoyce
Copy link

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?

@aayushanand99
Copy link

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

@Lxxyx
Copy link
Contributor

Lxxyx commented Jan 24, 2017

SameProblem.

@mayhs
Copy link

mayhs commented Jan 25, 2017

You might wanna check this solution.

#505 (comment)

@FuadBalashov
Copy link

Still seeing this with 0.42

@jedt
Copy link

jedt commented May 16, 2017

this works as a workaround for me: #505 (comment)

@Traviskn
Copy link

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

@bitfabrikken
Copy link

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

@hyochan35
Copy link

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

@hramos hramos added the Icebox label Sep 21, 2017
@hramos
Copy link
Contributor

hramos commented Sep 21, 2017

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 hramos closed this as completed Sep 21, 2017
@yosimasu
Copy link

yosimasu commented Sep 28, 2017

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

I create new issue

@HHuiHao
Copy link

HHuiHao commented Nov 24, 2017

this works as for me!!!

@Lxxyx
Copy link
Contributor

Lxxyx commented Nov 24, 2017

@HHuiHao Great
This works. You just need write a simple shell script to cpoy you html files to android assets.

jeanregisser added a commit to jeanregisser/react-native that referenced this issue Dec 21, 2017
This was seen in release builds see the following issues:
facebook#16133
facebook#7924
@arash-hacker
Copy link

#16133
just ckeckout my answer it worked for me
i used ckeditor

Scriptonita pushed a commit to Scriptonita/qa-react-native-technical-test that referenced this issue Jun 25, 2018
@facebook facebook locked as resolved and limited conversation to collaborators Sep 21, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Sep 21, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Platform: iOS iOS applications. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests