ionic-team / capacitor-plugins

Official plugins for Capacitor ⚡️
529 stars 594 forks source link

@capacitor/network crashing on Android 14(SDK 34) for Samsung and Google pixel devices. #2107

Open rahulsingh8990 opened 6 months ago

rahulsingh8990 commented 6 months ago

Bug Report

Plugin(s)

@capacitor/network: 5.0.0

Capacitor Version

@capacitor/Core: 5.0.0

PASTE OUTPUT HERE

Platform(s)

Android

Current Behavior

We are getting carsh report on @capacitor/network plugin, below is the exception This issue has been seen on following Android Version: Android(14), Android13,

Type: java.lang.NullPointerException

Exception java.lang.NullPointerException: Attempt to invoke interface method 'void.com.capacitorjs.plugins.network.Network$NetworkStatuschangeListener' at com.capacitorjs.plugins.network.Network$ConnectivityCallback.onCapabilitiesChanged (Network.java:37) at android.net ConnectivityManager$CallbackHandler;handleMessage (ConnectivityManager.java:4354) at android.os.Handler.dispatchMessage (Handler.java:106) at android.os.Looper.loopOnce (Looper.java:205) at anroid.os.Looper.loop (Looper.java:294) at android.os.handlerThread.run (HandlerThread.java:67)

Expected Behavior

Code Reproduction

Other Technical Details

Additional Context

Ionitron commented 5 months ago

This issue needs more information before it can be addressed. In particular, the reporter needs to provide a minimal sample app that demonstrates the issue. If no sample app is provided within 15 days, the issue will be closed.

Please see the Contributing Guide for how to create a Sample App.

Thanks! Ionitron 💙

rahulsingh8990 commented 5 months ago

Here is the sample minimal app GitHub URL https://github.com/rahulsingh8990/networkapp

this App is created with capacitor 5, with following packages "@capacitor/android": "^5.0.0", "@capacitor/camera": "^5.0.0", "@capacitor/core": "^5.0.0", "@capacitor/network": "^5.0.0", "@capacitor/splash-screen": "5.0.0"

To run the App please use following command npm run build npx cap sync

temp

Please do let me know if anything else is required.