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

installation #24

Closed
johntom opened this issue Jul 20, 2017 · 7 comments
Closed

installation #24

johntom opened this issue Jul 20, 2017 · 7 comments

Comments

@johntom
Copy link

johntom commented Jul 20, 2017

Hi.
While I have no problems with IOS with the exact setup I've tried to install on a few windows 10 comptuters with RN 0.41 and get the following error
Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.

C:\React\nsp\NSPV6\NativeStarterPro-v6.0.0>npm install react-native-pdf --save
react-native-pdf@1.2.4 node_modules\react-native-pdf
├── crypto-js@3.1.9-1
└── react-native-fetch-blob@0.10.6 (glob@7.1.2)

C:\React\nsp\NSPV6\NativeStarterPro-v6.0.0>react-native link react-native-pdf
rnpm-install info Linking react-native-pdf android dependency
rnpm-install ERR! It seems something went wrong while linking. Error: ENOENT: no such file or directory, open 'C:\React\nsp\NSPV6\NativeStarterPro-v6.0.0\android\app\src\main\java\android\support\v7\appcompat\MainApplication.java'
Please file an issue here: https://github.com/facebook/react-native/issues

ENOENT: no such file or directory, open 'C:\React\nsp\NSPV6\NativeStarterPro-v6.0.0\android\app\src\main\java\android\support\v7\appcompat\MainApplication.java'

I have no problem installing and running your eample on the same win 10 computers, a bit lost.

John

@wonday
Copy link
Owner

wonday commented Jul 21, 2017

Hi

May be some setting is wrong/non-standard in your android project.

You can manual add the config.

  1. install modules
    npm install react-native-pdf --save
    npm install react-native-fetch-blob --save

  2. add the following code to MainApplication.java

    @Override
    protected List<ReactPackage> getPackages() {
      return Arrays.<ReactPackage>asList(
          new MainReactPackage(),
            new RNFetchBlobPackage(),  //add this
            new RCTPdfView()           //add this
      );
    }
  };
  1. add the following code to android/setting.gradle
include ':react-native-pdf'
project(':react-native-pdf').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-pdf/android')
include ':react-native-fetch-blob'
project(':react-native-fetch-blob').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-fetch-blob/android')
  1. add the following code to android/app/build.gradle
dependencies {
    compile project(':react-native-pdf')        //add this
    compile project(':react-native-fetch-blob') //add this
}

for detail, you can init a new project and diff with my example project.
Hope this can help you. :-)

@johntom
Copy link
Author

johntom commented Jul 23, 2017

Thanks so much for your assistance as a deeper dive indeed fixed the issues.

@johntom johntom closed this as completed Jul 23, 2017
@Noitidart
Copy link

Noitidart commented Mar 4, 2018

react-native link failed for me in RN 0.54, these instructions helped a lot!

@kusakusakusa
Copy link

With reference to issue #2, react-native-fetch-blob has been renamed to rn-fetch-blob since rn-fetch-blob v0.10.9 on June 24th.

@hophoppoppop
Copy link

Is there any manual Installation for IOS?

@kusakusakusa
Copy link

react-native link works fine for iOS for me. I will probably use git diff to see the changes in the files to figure out the what react-native link did to manually install it.

@robzedgames
Copy link

Note that react-native-fetch-blob has been renamed to rn-fetch-blob (the README mentions it by the updated name) so you will want to ensure that your settings.gradle and app/build.gradle refer to rn-fetch-blob instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants