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

target version 32 needs permission #65

Open
Tushar-Kanvinde opened this issue Nov 25, 2022 · 11 comments
Open

target version 32 needs permission #65

Tushar-Kanvinde opened this issue Nov 25, 2022 · 11 comments

Comments

@Tushar-Kanvinde
Copy link

Android 11.0.0
Cordova 11.0.0
plugin 0.1.0-dev

I had to add



to AndroidManifest.xml

And also request permission for BLUETOOTH_SCAN and BLUETOOTH_CONNECT

@Tushar-Kanvinde
Copy link
Author

The tag hid what i added. Putting them here.
uses-permission android:name="android.permission.BLUETOOTH_SCAN"
uses-permission android:name="android.permission.BLUETOOTH_CONNECT"
uses-feature android:name="android.hardware.bluetooth" android:required="false"
uses-feature android:name="android.hardware.bluetooth_le" android:required="false"

@gsusalvarado
Copy link

Hello @Tushar-Kanvinde , did you add that to the config.xml?

@lapisanlangit
Copy link

any solution?

@Tushar-Kanvinde
Copy link
Author

@gsusalvarado

I am not familiar about how to add things to the AndroidManifest via config.xml

I added it to AndroidManifest.xml and then gave the gradlew bundleRelease command rather than the cordova build command.

I also have
cordova.plugins.permissions.requestPermission(cordova.plugins.permissions.BLUETOOTH_SCAN,
and
cordova.plugins.permissions.requestPermission(cordova.plugins.permissions.BLUETOOTH_CONNECT);
in javascript

@lapisanlangit
Copy link

@gsusalvarado

I am not familiar about how to add things to the AndroidManifest via config.xml

I added it to AndroidManifest.xml and then gave the gradlew bundleRelease command rather than the cordova build command.

I also have cordova.plugins.permissions.requestPermission(cordova.plugins.permissions.BLUETOOTH_SCAN, and cordova.plugins.permissions.requestPermission(cordova.plugins.permissions.BLUETOOTH_CONNECT); in javascript

this is working or not?

@Tushar-Kanvinde
Copy link
Author

@lapisanlangi

Yes. It is working for me.

I already had the permissions plugin in my project. You may need to add that.

@lapisanlangit
Copy link

@lapisanlangi

Yes. It is working for me.

I already had the permissions plugin in my project. You may need to add that.

ok nice info..I will try it again.. I am remember I already add that but still failed.. can you gave us full sample code in AndroidManifest.xml? I don't understand what do you mean about gradlew bundleRelease command... how to use it?

@Tushar-Kanvinde
Copy link
Author

edit the file platforms/android/app/src/main/AndroidManifest.xml
search for uses-permission
make a copy of that tag below it and then change android.permission.whatever to android.permission.BLUETOOTH_SCAN
and again same with android.permission.BLUETOOTH_CONNECT

below that add tags
uses-feature android:name="android.hardware.bluetooth" android:required="false" /
uses-feature android:name="android.hardware.bluetooth_le" android:required="false" /

Then cd to the folder platforms/android

you will have a file named gradlew and another called gradlew.bat there

so the command
./gradlew bundleRelease
will give you aab file to upload to store

instead of bundleRelease use packageDebug for apk to debug

I am building on a linux machine. Things should be the same on windows.

@lapisanlangit
Copy link

edit the file platforms/android/app/src/main/AndroidManifest.xml search for uses-permission make a copy of that tag below it and then change android.permission.whatever to android.permission.BLUETOOTH_SCAN and again same with android.permission.BLUETOOTH_CONNECT

below that add tags uses-feature android:name="android.hardware.bluetooth" android:required="false" / uses-feature android:name="android.hardware.bluetooth_le" android:required="false" /

Then cd to the folder platforms/android

you will have a file named gradlew and another called gradlew.bat there

so the command ./gradlew bundleRelease will give you aab file to upload to store

instead of bundleRelease use packageDebug for apk to debug

I am building on a linux machine. Things should be the same on windows.

ok thanks @Tushar-Kanvinde I will try soon

@LimSieKuang
Copy link

Any update?

@perry1100
Copy link

@gsusalvarado

I am not familiar about how to add things to the AndroidManifest via config.xml

I added it to AndroidManifest.xml and then gave the gradlew bundleRelease command rather than the cordova build command.

I also have cordova.plugins.permissions.requestPermission(cordova.plugins.permissions.BLUETOOTH_SCAN, and cordova.plugins.permissions.requestPermission(cordova.plugins.permissions.BLUETOOTH_CONNECT); in javascript

thank sir!

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

5 participants