-
Notifications
You must be signed in to change notification settings - Fork 479
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
Having Issue in Connecting with Android Versions 12 or more #211
Comments
The error is consistently coming but in other Android version it is working fine |
I have the same problem. Any solution to fix. Does not work on SDKs above 30. |
also have the same issue , I have android 13 , I added the permissions and gave access from the device settings to get it to work |
It is working now.
…On Tue, 20 Feb 2024 at 2:02 AM, Mubarak Lawal ***@***.***> wrote:
also have the same issue , I have android 13 , I added the permissions and
gave access from the device settings to get it to work
—
Reply to this email directly, view it on GitHub
<#211 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AWHBWCU2JEU2VESIUCTBD7LYUOZGZAVCNFSM6AAAAABCDFHYK2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNJTGEZDMNBSGM>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
@haisamk18
What should I modify to make it work?? |
Unfortunately after adding all the permissions in manifest file it won’t
work.But you can manually give permissions to the app on your phone and
them it will work.
…On Wed, 21 Feb 2024 at 10:48 PM, fernandomorse ***@***.***> wrote:
@haisamk18 <https://github.com/haisamk18>
I still have the same problem, I'm using:
pubspec.yam
dependencies:
flutter_bluetooth_serial: ^0.4.0
AndroidManifest.xml
app\build.gradle
compileSdkVersion 31
What should I modify to make it work??
—
Reply to this email directly, view it on GitHub
<#211 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AWHBWCQFS3T36WESLXNNDMTYUYUAFAVCNFSM6AAAAABCDFHYK2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNJXGM3TAMZRGM>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@haisamk18 |
|
i was having the same issue don't know whether it has been solved or not but before that i am getting new issue whenever app launches it ask for location permission whenever i click on allow , only for this time or deny button the app crashes and it is only happening for android 13 |
I notice this if you don't grant nearby devices permission , try asking for nearby devices permission at run time with permission handler |
|
i think the flutter bluetooth serial package does not supports android 13 |
No ,It does. The thing is for some devices it works fine and for some it
gives error even after giving all permission in manifest file but when
giving the permission of nearby devices from phone it works fine.
…On Fri, 23 Feb 2024 at 5:10 PM, Lokesh_Enata ***@***.***> wrote:
i think the flutter bluetooth serial package does not supports android 13
—
Reply to this email directly, view it on GitHub
<#211 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AWHBWCUYO2GHFMMJLMI6DSLYVB54FAVCNFSM6AAAAABCDFHYK2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNRRGE3TQMRUHA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
yes may be you are right but my app first ask location even if i allow it crashes i m not getting why |
@Lokesh-Enata same problem here, did you find a solution ? |
yess , i used flutter bluetooth serial ble package that solved my problem. |
hello , can you help with a link to the package please |
sure, 'https://pub.dev/packages/flutter_bluetooth_serial_ble' this is the link for the package. |
thanks alot |
Unfortunately the flutter flutter_bluettoth_serial_ble has the same problem. When request location at the first time in android 12 or later, crashs the app. there are another similar packages that do the same, but the owners sounds like do not approve the pr's 🙃 |
I'm running a build and looking for a fix , I'll let you know how it goes |
ive been able to fix this you can add
in your manifest not all of them are required? then before anything else request for the bluetooth Connect permission
you can use the permission_handler package then initialize the bluetooth method , below is the full code
and lastly i had to use compileSdkVersion 33 |
No what i have done is if we go and directly run the repo app of this project it will work fine on android 12 but will crash in android 13 so i imported discovery page, bluetooth list and connnection page code only from the repo project and i used scoped model and flutter bluetooth serial ble package and that fixed my issue i can connect , send and receive data |
Hi guys, I add all permissions in manifest, updated the permission_handler pacakge and compileSdkVersion is 33. I just do Permission.bluetoothConnect.request(); with permission_handler, and automatically, request bluetooth and location. Even if is granted, the app crash at the first time, and shows the error: E/AndroidRuntime(11660): FATAL EXCEPTION: main |
can you share your code , so I can test with my device |
Sorry, i can't, but I just trying requestPermission using: flutter_bluetooth_serial: ^0.4.0 Manifest: like:
|
ok I'll try it |
The same happens with flutter_bluetooth_serial_ble |
This is my error:
Cannot connect, exception occurred: PlatformException(connect_error, Need android.permission.BLUETOOTH_SCAN permission for android.content.AttributionSource@2d842ac7: AdapterService cancelDiscovery, java.lang.SecurityException: Need android.permission.BLUETOOTH_SCAN permission for android.content.AttributionSource@2d842ac7: AdapterService cancelDiscovery
My AndroidManifest.xml code :
Help with the issue although I am not using any Scan logic .
The text was updated successfully, but these errors were encountered: