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

JSharePackage error with RN 0.61.5 #141

Open
42997455 opened this issue Aug 6, 2020 · 3 comments
Open

JSharePackage error with RN 0.61.5 #141

42997455 opened this issue Aug 6, 2020 · 3 comments

Comments

@42997455
Copy link

42997455 commented Aug 6, 2020

When I try to run react-native run-android , got this error:

.../android/app/build/generated/rncli/src/main/java/com/facebook/react/PackageList.java:79: error: constructor JSharePackage in class JSharePackage cannot be applied to given types;
      new JSharePackage(),
      ^
  required: boolean,boolean
  found: no arguments
  reason: actual and formal argument lists differ in length
1 error

I find it caused by the RN 0.61.5 is auto-link, the auto generated class PackageList.java is as below:

  public ArrayList<ReactPackage> getPackages() {
    return new ArrayList<>(Arrays.<ReactPackage>asList(
      new MainReactPackage(mConfig),
      new JPushPackage(),
      new JSharePackage(),
      ...
   ));
  }

The JSharePackage should be JSharePackage(boolean, boolean), but the auto generated code is without parameter, could you please help with this issue? Thanks!

@mylesshie
Copy link

same error

@mylesshie
Copy link

node_modules/jshare-react-native/android/src/main/java/..../JsharePackage.java文件中添加如下代码。

public JSharePackage() {
Logger.SHUTDOWNTOAST = false;
Logger.SHUTDOWNLOG = false;
}

@mokai
Copy link

mokai commented Dec 16, 2021

react-native.config.js

module.exports = {
  dependencies: {
    'jshare-react-native': {
      platforms: {
        android: {
          packageInstance: 'new JSharePackage(false, false)',
        },
      },
    },
  },
};

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