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

Building React Native from source doesn't work #11677

Closed
skv-headless opened this issue Dec 30, 2016 · 7 comments
Closed

Building React Native from source doesn't work #11677

skv-headless opened this issue Dec 30, 2016 · 7 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@skv-headless
Copy link
Contributor

Description

Building React Native from source doesn't work
FIRMessagingModule.java:36: error: FIRMessagingModule is not abstract and does not override abstract method onActivityResult(int,int,Intent) in ActivityEventListener

I'm pretty sure that gradle choose old react-native version for react-native-fcm

Reproduction

  1. react-native init AwesomeProject
  2. follow this article https://facebook.github.io/react-native/docs/android-building-from-source.html
  3. npm install react-native-fcm --save
  4. react-native link react-native-fcm

here https://github.com/skv-headless/rn-build-fail project with this steps.

exclude should work but it doesn't make any difference https://facebook.github.io/react-native/docs/android-building-from-source.html#4-making-3rd-party-modules-use-your-fork

All projects which behave same way set repositories { mavenCentral() } inside their build.gradle

Solution

I've added to package.json

"postinstall": "find . -type f -name build.gradle -not -path \"*/react-native/*\" -not -path \"*/Examples/*\" -not -path \"*/examples/*\" -print0 -exec sed -i '' \"s/.*com.facebook.react:react-native:.*/ compile project(':ReactAndroid')/\" {} +"

but I don't think it is the best solution.

Additional Information

  • React Native version: [master, "facebook/react-native#01af9ee8a7ec8921590e4cac29bf14267b068ddc"]
  • Platform: [Android]
  • Operating System: [MacOS]
@chirag04
Copy link
Contributor

building RN from source works for us. Looking at your project here are some pointers:

    compile fileTree(dir: "libs", include: ["*.jar"])
    compile "com.android.support:appcompat-v7:23.0.1"
    compile project(':react-native-android')
    compile project(':react-native-fcm')

If i remember correctly calling it ReactAndroid excluded RN dependency itself.

@skv-headless
Copy link
Contributor Author

@chirag04 thank you for response I made changes that you suggested (I hope I did it right) skv-headless/rn-build-fail@97649bf but I have same error 😞

@ssomnoremac
Copy link

ssomnoremac commented Jan 25, 2017

@skv-headless , man I with you. I can't get rid of the
FIRMessagingModule is not abstract and does not override abstract method onActivityResult(int,int,Intent) in ActivityEventListener error using every suggestion in the fcm issue and everything here. Still using a separate repo without my forked RN to build Android. Moving to RN40 soon which will allow me to avoid using my fork, but at some point I want to understand what's going on here.

@chrisbianca
Copy link

I've got the same issue when trying to build from a fork of React Native 0.41.2.

Have spent the whole afternoon trying to get it to work with all sorts of different fixes suggested arounf the web but it doesn't want to work. As soon as I switch back and point at 0.41.2 from npm it works fine, even when building from source!!

I haven't managed to figure out what's different between building from source on npm and from source on my fork...

@LucasSouzaa
Copy link

Somebody with an solution ?? I'm with the same error and I can not found no one solution

@farazs
Copy link

farazs commented Mar 8, 2017

Same issue here. I suspect the issue is this chunk in build.gradle:

allprojects {
    repositories {
        mavenLocal()
        jcenter()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url "$rootDir/../node_modules/react-native/android"
        }
    }
}

These files exist when a version is installed from npm but not in the forked react-native:
screen shot 2017-03-08 at 2 17 34 pm

I couldn't use this information to find a solution but maybe someone else can. You could add those files to your forked repo and then it would probably work but that doesn't seem correct.

@hramos
Copy link
Contributor

hramos commented Jul 20, 2017

Hi there! This issue is being closed because it has been inactive for a while. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. Either way, we're automatically closing issues after a period of inactivity. Please do not take it personally!

If you think this issue should definitely remain open, please let us know. The following information is helpful when it comes to determining if the issue should be re-opened:

  • Does the issue still reproduce on the latest release candidate? Post a comment with the version you tested.
  • If so, is there any information missing from the bug report? Post a comment with all the information required by the issue template.
  • Is there a pull request that addresses this issue? Post a comment with the PR number so we can follow up.

If you would like to work on a patch to fix the issue, contributions are very welcome! Read through the contribution guide, and feel free to hop into #react-native if you need help planning your contribution.

@hramos hramos added the Icebox label Jul 20, 2017
@hramos hramos closed this as completed Jul 20, 2017
@facebook facebook locked as resolved and limited conversation to collaborators Jul 20, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 20, 2018
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

8 participants