Permissions in AndroidManifest.xml are ignored in Flutter - android

In my Flutter application I need to use microphone. As I test application in emulator in myproject/android/app/src/debug/AndroidManifest.xml I have:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="temp.myproject.myproject">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
</manifest>
However, my application still doesn't have permission to use microphone. So, I need to use permission_handler library to make it work:
Map<Permission, PermissionStatus> statuses = await [Permission.microphone].request();
I thought that adding uses-permission.. in AndroidManifest is enough, but it doesn't work without permission_handler. Could anyone explain why, or what I do/understand wrong.

You can uninstall the app and install it again on your physical or emulator device, in order make sure that the app is running from fresh install, and to make sure that the AndroidManifest is re-register into the device

Related

Error with duplicate permissions with different maxSdkVersions (Flutter, reactiveBLE)

I am using the reactiveBLE library (which is by the way excellent, thank you for that).
However, with the newer version, it brings its own manifest file, so I don´t have to add any permissions to mine. The manifest file of reactiveBLE and one of my app are supposed to be merged together when building the app.
Because different rules are needed for different APIs, reactiveBLE adjusts its permissions accordingly. It seems that for Bluetooth, android.permission.ACCESS_FINE_LOCATION and android.permission.ACCESS_COARSE_LOCATION are only needed for APIs 23 - 30.
The code is then (for example):
uses-permission-sdk-23
android:name="android.permission.ACCESS_FINE_LOCATION"
android:maxSdkVersion="30"
However, as I also include other location services (which do need these permissions for other APIs as well), I would have to remove the "android:maxSdkVersion="30" part. This is also recommended in the official documentation:
official documentation on how to remove maxSdkVersion
However, this is not possible, because the manifest file of reactiveBle is generated automatically each time I build something (and my changes are overwritten again).
The app is working fine, but I am getting errors in the Play Console when uploading the app to the Playstore.
Please advise how I can merge the manifest files properly, so I do not get an error when uploading to the Play Console.
Kind regards
René
This solution from reactiveBLE issues worked for me.
To prevent conflicts with you own permissions, in your AndroidManifest.xml file include:
<uses-permission-sdk-23 android:name="android.permission.ACCESS_FINE_LOCATION" tools:node="remove"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission-sdk-23 android:name="android.permission.ACCESS_COARSE_LOCATION" tools:node="remove"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
You will also need to add xmlns:tools="http://schemas.android.com/tools" in the manifest tag at the top of the file.

SharedObject for High Score works in PC but not in Air for Android (Mobile)

I'm using the SharedObject code in ActionScript 3. It works perfectly fine when I publish it on my computer but when I publish it on Air for Android, the high score does not work anymore.
Edit:
i know that android.permission.WRITE_EXTERNAL_STORAGE also contain' READ permission, but as i remember I had the same problem in past which was fixed with it.
i guess android.permission.READ_PHONE_STATE is missing
in your appname-app.xml you should make permission's for SharedObject like it:
<android>
<manifestAdditions><![CDATA[
<manifest android:installLocation="auto">
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
</manifest>
]]></manifestAdditions>
</android>
finally found the solution, when using the the sharedobject, you just have to change this code
var playerHighScore:SharedObject = SharedObject.getLocal("myscore");
to this one:
"myscore" should be changed to the exact apk filename :))
so in my case my apk filename is pandaclash.apk, the sharedobject code should be:
var playerHighScore:SharedObject = SharedObject.getLocal("pandaclash");

how to use SET_DEBUG_APP permission

I found the SET_DEBUG_APP permission - it seems to grant permission to do exactly what I need to do at the moment - unfortunately I found no documentation on how to use it - can anybody shed some light on how to use it?
Like any other permission, add it to the AndroidManifest.xml file.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.somebody.amazing_app" >
...
<uses-permission android:name="android.permission.SET_DEBUG_APP" />
...
<application
...
</application>
...
</manifest>
Most of my devices don't need this; they debug just fine without this line. But one of my devices insists--it won't start running the app in debug mode without this line.

FlashBuilder adds INTERNET permission even though it is not in my APP XML when building APK

I have an Mobile AIR project in FlashBuilder 4.6(Using AIR 3.4) and I am having a real problem publishing an APK. Here is the section from my APP XML:
<manifestAdditions><![CDATA[
<manifest android:installLocation="auto">
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.DISABLE_KEYGUARD"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
</manifest>
]]></manifestAdditions>
For some reason, when I create an APK, the INTERNET permission is being tacked on the end of the manifest permissions block. Note that the application.xml in the asset/META-INF/AIR folder still looks correct.
Any ideas where I am going wrong?
After a lot more searching, I found my own answer:
Note: When you bundle the runtime, ADT adds the INTERNET and
BROADCAST_STICKY permissions to your application. These permissions
are required by the AIR runtime.
BROADCAST_STICKY seems to no longer be required, but apparently when using captive runtime we cannot get around this.

Android Application is not installed

I tried signing the application and tried just debugging it. I have the Galaxy nexus. i have been able to run on the device before but now when I compile and build it shows up on the device but when i try and run it it tells me the application is not installed. I have tried to reinstall it too!
thanks
You need to add Internet permission for the app you're installing, in its manifest file, by adding the following line to the manifest file:
<uses-permission android:name="android.permission.INTERNET" />
Do this before the <application ...> tag

Categories

Resources