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

MapsPackage wrong argument #305

Closed
LiquidWicked opened this issue Jun 18, 2016 · 8 comments
Closed

MapsPackage wrong argument #305

LiquidWicked opened this issue Jun 18, 2016 · 8 comments

Comments

@LiquidWicked
Copy link

This is error output from command "react-native run-android":

/MainActivity.java:42: error: constructor MapsPackage in class MapsPackage cannot be applied to given types; new MapsPackage(this) ^ required: no arguments found: MainActivity reason: actual and formal argument lists differ in length 1 error :app:compileDebugJavaWithJavac FAILED

MapsPackage.java file is there along with constructor that receives argument of type Activity. I am not sure if this has something to do with it, but first I installed npm package react-native-maps but realized that it is not updated so I installed from github using npm.

Also, I am using react native version 0.27.

@lilosir
Copy link

lilosir commented Jun 21, 2016

did you fix that?

@jacksnow00
Copy link

got the same error.
anyone can help ?

@DennisMG
Copy link
Contributor

DennisMG commented Jun 21, 2016

Just delete the this from new MapsPackage(this) that should work... 👍

@jacksnow00
Copy link

@DennisMG
It just build as well, but when app run you get the error
null is ...

@DennisMG
Copy link
Contributor

Weird.. It worked for me.. I don't get any null error... I'm using React Native 0.26.3

@morrigan
Copy link

@DennisMG depends on the device according to this PR. Maybe problem with the Maven repository 'com.airbnb.android:react-native-maps:0.5.0' ?

@cjbutcher
Copy link

@DennisMG solution worked for me. Thank you.

@thelalitmohan
Copy link

thelalitmohan commented Mar 4, 2018

I am getting the same error and I use the both new MapsPackage(this) and new MapsPackage(). But nothing works for me

And I see the MapsPackage class

They handling the both compatibility

  public MapsPackage(Activity activity) {
  } // backwards compatibility

  public MapsPackage() {
  }

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

7 participants