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

Example not working [ANDROID] #19

Open
Spad8 opened this issue May 25, 2021 · 11 comments
Open

Example not working [ANDROID] #19

Spad8 opened this issue May 25, 2021 · 11 comments

Comments

@Spad8
Copy link

Spad8 commented May 25, 2021

I'm trying out your plugin, but the example app doesn't seem to work at all.
I'm using two real devices, both showing the WiFi direct notification, but neither seeing the other.

This si my flutter doctor output:
flutter_doctor

I'm probably missing something, but I can't figure it out
Permissionas are set, too.

@Spad8
Copy link
Author

Spad8 commented May 25, 2021

I tried on iOS simulators, and it's working just fine, just like the README gif.
I can't really get it

@Spad8 Spad8 changed the title Example not working Example not working [ANDROID] May 25, 2021
@abedputra
Copy link

Tested, same not work on Android in real devices.

@VNAPNIC
Copy link
Owner

VNAPNIC commented Jun 14, 2021

android if using wifi means using the hotspot, and will affect internet connection
android only supports Bluetooth
If you still want to use wifi with android you can refer to
https://github.com/VNAPNIC/UDP-TCP-Flutter

@smoore-edare
Copy link

I tested this on Android devices as well, and I had the same result. The devices are not able to see each other.

@abedputra
Copy link

@VNAPNIC Thanks for your answer.

I use exactly the same from your example project:

await nearbyService.init( serviceType: 'mpconn', deviceName: devInfo, strategy: Strategy.P2P_CLUSTER, callback: (isRunning) async { if (isRunning) { if (widget.deviceType == DeviceType.browser) { await nearbyService.stopBrowsingForPeers(); await nearbyService.startBrowsingForPeers(); } else { await nearbyService.stopAdvertisingPeer(); await nearbyService.startAdvertisingPeer(); await nearbyService.stopBrowsingForPeers(); await nearbyService.startBrowsingForPeers(); } } });

the Strategy.P2P_CLUSTER use Bluetooth, right? if yes, it doesn't work.

@Heshara
Copy link

Heshara commented Jun 15, 2021

Same result here the plugin works perfectly with iOS but when testing it with an Android device the app even doesn't finish compiling and give the following errors

  1. class 'kotlin.unit' was compiled with an incompatible version of kotlin. the binary version of its metadata is 1.5.1, expected version is 1.1.16.
  2. execution failed for task ': "flutter_nearby_connections:" compiledebugkotlin'.

@smoore-edare
Copy link

  1. class 'kotlin.unit' was compiled with an incompatible version of kotlin. the binary version of its metadata is 1.5.1, expected version is 1.1.16.
  2. execution failed for task ': "flutter_nearby_connections:" compiledebugkotlin'.

@Heshara I had to make a couple of changes to get the app to compile:

  • Update the Compile and Target SDK Versions to 30 in example/android/app/build.gradle
  • Update the kotlin version variable in example/android/build.gradle to a newer version (I used 1.4.32)
  • In the same file, update the version number at the end of the gradle dependency to use a newer version (I used 4.1.3)

This solved the incompatible version of kotlin error for me.

@Heshara
Copy link

Heshara commented Jun 16, 2021

@smoore-edare thanks a lot it fixed the compilation error! Still Android devices are unable to identify each other

  1. class 'kotlin.unit' was compiled with an incompatible version of kotlin. the binary version of its metadata is 1.5.1, expected version is 1.1.16.
  2. execution failed for task ': "flutter_nearby_connections:" compiledebugkotlin'.

@Heshara I had to make a couple of changes to get the app to compile:

  • Update the Compile and Target SDK Versions to 30 in example/android/app/build.gradle
  • Update the kotlin version variable in example/android/build.gradle to a newer version (I used 1.4.32)
  • In the same file, update the version number at the end of the gradle dependency to use a newer version (I used 4.1.3)

This solved the incompatible version of kotlin error for me.

@VNAPNIC
Copy link
Owner

VNAPNIC commented Jun 17, 2021

@JAICHANGPARK
Copy link

@VNAPNIC
I have still this issues problem in android oreo real device

@pmahdicheraghi
Copy link

Me too! Still not working in real android devices

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

7 participants