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

Does not work for Android #25

Closed
RyanMitchellWilson opened this issue Jul 28, 2016 · 4 comments
Closed

Does not work for Android #25

RyanMitchellWilson opened this issue Jul 28, 2016 · 4 comments

Comments

@RyanMitchellWilson
Copy link

RyanMitchellWilson commented Jul 28, 2016

This works just fine on IOS but does not work for Android. I've doubled checked I have everything in the correct files, but when I run react-native run-android it fails to compile and I get this error:
error: method does not override or implement a method from a supertype @Override

And when I remove @Override from the function it compiles and loads the app onto the emulator, but then all I get is Cannot read property 'URL' of undefined or undefined is not an object (evaluating '_reactNativeConfig2.default.URL')

Running React-native 0.29.0 and Java 1.8 Oracle

@RyanMitchellWilson
Copy link
Author

Ok figured out the problem. Starting in React-Native 0.29.0 (https://github.com/facebook/react-native/releases/tag/v0.29.0) they added a new file inside the same folder as MainActivity.java called MainApplication.java where they want you to add your customizations. So instead of adding

protected List<ReactPackage> getPackages() {
    return Arrays.<ReactPackage>asList(
        new MainReactPackage(),
        new ReactNativeConfigPackage() // add package
    );
}

To your MainActivity.java you need to add it to MainApplication.java

@RyanMitchellWilson
Copy link
Author

Tried to create a pull request for this but I don't have permissions to push a new branch.

@perkola
Copy link

perkola commented Aug 15, 2016

Bump. Can you PR this into the master branch?

@pedro pedro closed this as completed in c8aa8f0 Sep 14, 2016
@pedro
Copy link
Contributor

pedro commented Sep 14, 2016

Done! Sorry for the delay, and thanks for the feedback folks.

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

3 participants