prafulla-codes/react-native-wifi-and-hotspot-wizard

Getting Error method.invoke

Opened this issue · 10 comments

"react-native": "^0.60.5", "react-native-wifi-and-hotspot-wizard": "^1.0.6-beta.1",

\react-native-wifi-and-hotspot-wizard\android\src\main\java\com\reactnativewifiandhotspotwizard\RNWifiAndHotspotWizardModule.java:108: warning: non-varargs call of varargs method with inexact argument type for last parameter;
int actualState = (Integer) method.invoke(wifi,null);
^

Hey that one seems to be a warning

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 30s

at checkExecSyncError (child_process.js:629:11)
at execFileSync (child_process.js:647:13)
at runOnAllDevices (F:\android\nidlemobile\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:74:39)
at buildAndRun (F:\android\nidlemobile\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:158:41)
at then.result (F:\android\nidlemobile\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:125:12)
at process._tickCallback (internal/process/next_tick.js:68:7)

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! Nidle@0.0.1 android: npx react-native link && npx react-native run-android --no-jetifier && npx react-native log-android
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the Nidle@0.0.1 android script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\1600000064\AppData\Roaming\npm-cache_logs\2022-03-01T11_29_21_470Z-debug.log

But i am getting build failed !!

                                        ^

F:\android\nidlemobile\node_modules\react-native-wifi-and-hotspot-wizard\android\src\main\java\com\reactnativewifiandhotspotwizard\RNWifiAndHotspotWizardModule.java:108: warning: non-varargs call of varargs method with inexact argument type for last parameter;
int actualState = (Integer) method.invoke(wifi,null);
^
cast to Object for a varargs call
cast to Object[] for a non-varargs call and to suppress this warning
F:\android\nidlemobile\node_modules\react-native-wifi-and-hotspot-wizard\android\src\main\java\com\reactnativewifiandhotspotwizard\RNWifiAndHotspotWizardModule.java:135: warning: non-varargs call of varargs method with inexact argument type for last parameter;
int actualState = (Integer) method.invoke(wifi,null);
^
cast to Object for a varargs call
cast to Object[] for a non-varargs call and to suppress this warning
Note: F:\android\nidlemobile\node_modules\react-native-wifi-and-hotspot-wizard\android\src\main\java\com\reactnativewifiandhotspotwizard\RNWifiAndHotspotWizardModule.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error
5 warnings

@prafulla-codes can you help me ?

Sure, I will check on this and get back to you

Finally, it is working for API 28, after downgrading my API target Version.

This method was deprecated in API level 29.

a) See WifiNetworkSpecifier.Builder#build() for new mechanism to trigger connection to a Wi-Fi network. b) See addNetworkSuggestions(java.util.List), removeNetworkSuggestions(java.util.List) for new API to add Wi-Fi networks for consideration when auto-connecting to wifi. Compatibility Note: For applications targeting Build.VERSION_CODES.Q or above, this API will always fail and return -1.

Hey that one seems to be a warning

You imported
import sun.security.ec.point.ProjectivePoint.Mutable;

But where did you use it? I think this import creates some errors, If you comment this line , error will be fixed.

not working to me also can you give me a guide on how to be able run this library?

I am upgrading the library to support the latest version, this should fix the sun.security.ec.point.ProjectivePoint.Mutable error