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中的构造器 JSharePackage应用到给定类型; #153

Open
wangvili opened this issue Nov 20, 2023 · 1 comment

Comments

@wangvili
Copy link

wangvili commented Nov 20, 2023

xxx/android/app/build/generated/rncli/src/main/java/com/facebook/react/PackageList.java:126: 错误: 无法将类 JSharePackage中的构造器 JSharePackage应用到给定类型;
new JSharePackage(),
^
需要: boolean,boolean
找到: 没有参数
原因: 实际参数列表和形式参数列表长度不同

System:
  OS: macOS 13.5.2
  CPU: (10) arm64 Apple M2 Pro
  Memory: 87.50 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 20.0.0
    path: /usr/local/bin/node
  Yarn:
    version: 1.22.19
    path: /opt/homebrew/bin/yarn
  npm:
    version: 9.8.1
    path: /opt/homebrew/bin/npm
  Watchman:
    version: HEAD-fcdc2f1
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.13.0
    path: /usr/local/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.0
      - iOS 17.0
      - macOS 14.0
      - tvOS 17.0
      - watchOS 10.0
  Android SDK:
    API Levels:
      - "28"
      - "29"
      - "30"
      - "31"
      - "33"
      - "33"
    Build Tools:
      - 28.0.3
      - 29.0.2
      - 29.0.3
      - 30.0.2
      - 30.0.3
      - 31.0.0
      - 33.0.0
      - 33.0.2
      - 34.0.0
    System Images:
      - android-33 | Google APIs ARM 64 v8a
      - android-UpsideDownCake | Google APIs ARM 64 v8a
    Android NDK: Not Found
IDEs:
  Android Studio: 2022.1 AI-221.6008.13.2211.9619390
  Xcode:
    version: 15.0.1/15A507
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 11.0.18
    path: /usr/bin/javac
  Ruby:
    version: 3.0.0
    path: /Users/inkcrazy/.rvm/rubies/ruby-3.0.0/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.72.4
    wanted: 0.72.4
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false
@wangvili
Copy link
Author

wangvili commented Nov 20, 2023

node_modules/jshare-react-native/android/src/main/java/..../JsharePackage.java

把JSharePackage方法的参数都去掉了😂
public JSharePackage() {
Logger.SHUTDOWNTOAST = false;
Logger.SHUTDOWNLOG = false;
}

新的风暴:

java.lang.IllegalStateException: Native module RCTJShareModule tried to override JShareModule. Check the getPackages() method in MainApplication.java, it might be that module is being created twice. If this was your intention, set canOverrideExistingModule=true. This error may also be present if the package is present only once in getPackages() but is also automatically added later during build time by autolinking. Try removing the existing entry and rebuild.

把MainApplication.java下的getPackages方法的packages.add(new JSharePackage());也去掉了
这个网友提到的问题:#132 (comment)

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

1 participant