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

Unable to make 3rd party modules / plugins use local forked version of React Native #21776

Closed
3 tasks done
MarkOSullivan94 opened this issue Oct 13, 2018 · 13 comments
Closed
3 tasks done
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@MarkOSullivan94
Copy link

Environment

React Native Environment Info:
    System:
      OS: macOS High Sierra 10.13.6
      CPU: x64 Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz
      Memory: 4.87 GB / 32.00 GB
      Shell: 5.3 - /bin/zsh
    Binaries:
      Node: 10.12.0 - /usr/local/bin/node
      npm: 6.4.1 - /usr/local/bin/npm
    SDKs:
      iOS SDK:
        Platforms: iOS 12.0, macOS 10.14, tvOS 12.0, watchOS 5.0
      Android SDK:
        Build Tools: 23.0.1, 27.0.3, 28.0.2
        API Levels: 23, 26, 27, 28
    IDEs:
      Xcode: 10.0/10A255 - /usr/bin/xcodebuild
    npmPackages:
      react: 16.6.0-alpha.8af6728 => 16.6.0-alpha.8af6728
      react-native: github:MarkOSullivan94/react-native#develop => 0.57.3
    npmGlobalPackages:
      react-native-cli: 2.0.1

Description

Following the steps of the Building React Native from source documentation and I'm stuck on step 4.

It looked like everything was working fine until I noticed this in Android Studio

screen shot 2018-10-13 at 22 19 55

Unfortunately this is preventing me from running a local version of React Native so I can test my changes.

My version of React Native can be found here: https://github.com/MarkOSullivan94/react-native/tree/develop

Reproducible Demo

My project containing the error: https://github.com/MarkOSullivan94/ReactNativeShareExample

Clone the project, install the node modules and then try and run it in Android Studio and you'll see warning issues.

If you use the command react-native run-android it'll produce the following error.

error: cannot find symbol import com.facebook.react.modules.core.PermissionAwareActivity;

@gengjiawen
Copy link
Contributor

Looks like this issue affect this: #13094.

@gengjiawen
Copy link
Contributor

You may need to publish your own npm package, you can refer to https://github.com/facebook/react-native/blob/master/.circleci/config.yml to how achieve this.

@MarkOSullivan94
Copy link
Author

My own npm package containing what?

@gengjiawen
Copy link
Contributor

Contain build android aar.

@MarkOSullivan94
Copy link
Author

Build android aar for the share example project or my local version of React Native ?

What would I do after that?

@guyca
Copy link

guyca commented Oct 15, 2018

@MarkOSullivan94 Have you followed this step from the documentation?

@MarkOSullivan94
Copy link
Author

@guyca yes, hence why I opened an issue on the React Native website too: facebook/react-native-website#624

@MarkOSullivan94
Copy link
Author

@gengjiawen could you provide a guide for what you want me to do?

@guyca
Copy link

guyca commented Oct 17, 2018

@MarkOSullivan94
Try the workaround posted here, basically it replaces the react native dependency of all third party moduels with your own.

@MarkOSullivan94
Copy link
Author

@guyca that workaround didn't work and it looks like it didn't work for anyone else in that issue thread. Not sure why it was marked as resolved and closed by @hramos.

@gengjiawen
Copy link
Contributor

@MarkOSullivan94 After yarn install, change node_modules\react-native-image-crop-picker\android\build.gradle to

dependencies {
    implementation project(':ReactAndroid')
    compile 'com.github.yalantis:ucrop:2.2.2-native'
    compile 'id.zelory:compressor:2.1.0'
}

@gengjiawen
Copy link
Contributor

You may want to change this in postinstall hook in package.json for clearity.

@MarkOSullivan94
Copy link
Author

@gengjiawen just tried your changes and I've some how got the app running again! Thank you!

Red error screens but at least the app's running now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

4 participants