kirillzyusko / react-native-wifi-p2p

Library that provide access for working with wi-fi direct (p2p) module in android.
174 stars 32 forks source link

startDiscoveringPeers function is working in debug mode but not working in release apk anyone has any solution about that? #95

Open Suyashbajpai27 opened 6 months ago

Suyashbajpai27 commented 6 months ago

I am trying to connect two android devices for sending data from one device to other device using this library but in debug mode it is working to search Nearby Devices but when i create a release build or apk ,then it is not able to search any nearby devices.

kirillzyusko commented 6 months ago

@Suyashbajpai27 do you see any error in logcat output? Maybe there will be a useful hints what exactly blocks peers from being discovered?

Suyashbajpai27 commented 6 months ago

No ,because it is working in debug mode , i have no clue about that in release mode.

On Sat, 16 Mar 2024 at 00:15, Kirill Zyusko @.***> wrote:

@Suyashbajpai27 https://github.com/Suyashbajpai27 do you see any error in logcat output? Maybe there will be a useful hints what exactly blocks peers from being discovered?

— Reply to this email directly, view it on GitHub https://github.com/kirillzyusko/react-native-wifi-p2p/issues/95#issuecomment-2000252046, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQ7JYZZC4WRLMUTK6OTZQVLYYM6VXAVCNFSM6AAAAABEYPNKASVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMBQGI2TEMBUGY . You are receiving this because you were mentioned.Message ID: @.***>

kirillzyusko commented 6 months ago

@Suyashbajpai27 you can spin up a logcat instance by adb logcat command or simply open it in Android Studio 🙂 And check your logs (it should contain all logs).

I'm more than sure that Android will log a root cause of why discovery fails. Feel free to try 🙌

Suyashbajpai27 commented 6 months ago

No , I didn't get any unusual logs in adb logcat in android studio.

kirillzyusko commented 6 months ago

@Suyashbajpai27 can you share them here? (Just for 5-10 seconds, when you started to discover peers and got a particular status)

Suyashbajpai27 commented 6 months ago

AdbLogcat.txt this is too long that is why i send this in txt format

Suyashbajpai27 commented 6 months ago

Hey! this library is working in Android version 11 or 12 or older version of android but not in 13.check the issue please.

kirillzyusko commented 6 months ago

@Suyashbajpai27 according to yours logs I see that device actually can be found:

03-16 01:51:59.634  5539  5539 W unknown:ReactNative: Calling JS function after bridge has been destroyed: RCTDeviceEventEmitter.emit(["WIFI_P2P:PEERS_UPDATED",\{"devices":[\{"status":3,"primaryDeviceType":"10-0050F204-5","isGroupOwner":false,"secondaryDeviceType":null,"deviceAddress":"f2:7c:3f:99:35:60","deviceName":"realme 8s 5G"\}]\}])\
03-16 01:51:59.648  5539 11072 I ReactNativeJS: 'OnPeersUpdated', [ \{ status: 3,\
03-16 01:51:59.648  5539 11072 I ReactNativeJS:     primaryDeviceType: '10-0050F204-5',\
03-16 01:51:59.648  5539 11072 I ReactNativeJS:     isGroupOwner: false,\
03-16 01:51:59.648  5539 11072 I ReactNativeJS:     secondaryDeviceType: null,\
03-16 01:51:59.648  5539 11072 I ReactNativeJS:     deviceAddress: 'f2:7c:3f:99:35:60',\
03-16 01:51:59.648  5539 11072 I ReactNativeJS:     deviceName: 'realme 8s 5G' \} ]\
03-16 01:51:59.689   949  1055 E Light   : AmbienteLight: 116.000000\
03-16 01:51:59.694  5539 11072 I ReactNativeJS: 'Devicesssss', [ \{ status: 3,\
03-16 01:51:59.694  5539 11072 I ReactNativeJS:     primaryDeviceType: '10-0050F204-5',\
03-16 01:51:59.694  5539 11072 I ReactNativeJS:     isGroupOwner: false,\
03-16 01:51:59.694  5539 11072 I ReactNativeJS:     secondaryDeviceType: null,\
03-16 01:51:59.694  5539 11072 I ReactNativeJS:     deviceAddress: 'f2:7c:3f:99:35:60',\
03-16 01:51:59.694  5539 11072 I ReactNativeJS:     deviceName: 'realme 8s 5G' \} ]\

Regarding Android 13 - have you seen this thread/comment https://github.com/kirillzyusko/react-native-wifi-p2p/issues/59#issuecomment-1519228702?

Suyashbajpai27 commented 6 months ago

I know but it is in debug mode that is why i am able to send you the logcat and i found this issue is from version,like when i am trying to run the app in android version 11 or lower then it is working but it is not working in upgraded version(more than Android 11).

kirillzyusko commented 6 months ago

I know but it is in debug mode that is why i am able to send you the logcat

logcat should work on both debug and release builds.

Do I correctly understand, that you opened an issue that it doesn't work in release mode and when I asked you to share adb-logs, then you shared them for debug build?..