wonday / react-native-pdf

A <Pdf /> component for react-native

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Warning: Native component for "RCTPdf" does not exist

Tako opened this issue · comments

Still getting Warning: Native component for "RCTPdf" does not exist message on console.

How do you use it? in your app or only my example?
If my example, you should "npm install" first to install dependent modules.
If use it in your app, please

npm install react-native-pdf --save
react-native link react-native-pdf

and

npm install react-native-fetch-blob --save
react-native link react-native-fetch-blob

@Tako
I closed this.
If you still have problem, please give me more info and reopen it.

I'm getting the same error.

I was able to fix it. I think the link isn't working as expected.

I had to edit the MainApplication.java with:

...
import org.wonday.pdf.RCTPdfView;
import com.RNFetchBlob.RNFetchBlobPackage;
...

public class MainApplication extends NavigationApplication {
  ...

  protected List<ReactPackage> getPackages() {
        // Add additional packages you require here
        // No need to add RnnPackage and MainReactPackage
        return Arrays.<ReactPackage>asList(
                new RNFetchBlobPackage(),
                new RCTPdfView()
        );
  }
}

Add an answer above to README.me please

I have added it to README.me.

I was able to fix it. I think the link isn't working as expected.

I had to edit the MainApplication.java with:

...
import org.wonday.pdf.RCTPdfView;
import com.RNFetchBlob.RNFetchBlobPackage;
...

public class MainApplication extends NavigationApplication {
  ...

  protected List<ReactPackage> getPackages() {
        // Add additional packages you require here
        // No need to add RnnPackage and MainReactPackage
        return Arrays.<ReactPackage>asList(
                new RNFetchBlobPackage(),
                new RCTPdfView()
        );
  }
}

it's work for me