Skip to content Skip to sidebar Skip to footer

React-native, Pdf Showing On Android Simulator But Getting Error On Actual Android Device

I have installed react-native-pdf and rn-fetch-blob packages to show pdf file.It work's fine on simulator but for some reason i am getting 'Error: open failed: ENOENT (No such file

Solution 1:

As suggested by @Hardik Virani above in comment, I have removed local url and did like below:

render() {
    const source = {uri:'bundle-assets://Product_Variants_Electric_Connections.pdf', cache: true};

    return (
        <Viewstyle={{width: '100%', height: '100%'}}><Pdfstyle={styles.pdf}source={source}

      /></View>
  );

And Remember Just put your actual pdf in the android/app/src/main/assets/pdf folder of your project.

Post a Comment for "React-native, Pdf Showing On Android Simulator But Getting Error On Actual Android Device"