tradingview / charting-library-examples

Examples of Charting Library integrations with other libraries, frameworks and data transports
MIT License
1.32k stars 744 forks source link

Not working on React-native android build #357

Open kiran-bhalerao opened 10 months ago

kiran-bhalerao commented 10 months ago

Its not working when create android build "expo": "49.0.7", "react-native": "0.72.3", "react-native-webview": "13.2.2"

Showing blank white screen. but working on android emulator.

To Reproduce

create android apk build and run on physical device.

kiran-bhalerao commented 10 months ago

Datafeeds is undefined

vanditmehta commented 10 months ago

getting same issue

Remato commented 8 months ago

I have the same problem, it works normally on iOS, but on android it doesn't work.

When I change my HTML to something like

<!DOCTYPE html>
<html>
    <head>
        <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0">
        <meta http-equiv="X-UA-Compatible" content="IE=Edge">
    </head>

    <body>
             <h1>Hello World</h1>
    </body>
</html>

it works perfectly on Android, but the example doesn't work. @SlicedSilver Do you know what it could be?

I don't know if there is any permission, or if there is any additional HTML tag

SlicedSilver commented 8 months ago

Have you copied all the files to correct directories? https://github.com/tradingview/charting-library-examples/tree/master/react-native#how-to-start---android

The files are copied to different directories for iOS and Android.

To get a more concrete answer on what the issue is, you should connect the developer tools to the web view and see what the errors are (you may need to refresh the page).

Remato commented 8 months ago

Hi Mark, I managed to solve it!

For the next people who are going to integrate charting-library with Android and are testing in a simulator, when using Webview make sure to add the androidLayerType property

If it's set to hardware like me

androidLayerType="hardware"

just change it to:

androidLayerType="software"

this should fix the problem.