无法将类 JSharePackage中的构造器 JSharePackage应用到给定类型;
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
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());也去掉了 这个网友提到的问题:https://github.com/jpush/jshare-react-native/issues/132#issuecomment-535768313